Code Monkey home page Code Monkey logo

ip3-ideagen-timeline-sdk's Introduction

Ideagen Timeline SDK

This lib provides an SDK for the Timeline API from Ideagen. See the API code here

Usage

This library is intended to be used with NodeJS. It work on the front-end and on the back-end. In order to use it in the browser, you might consider using JavaScript bundler, such as Webpack as well as a javascript compiler, such as Babel

Install

This Library works with NodeJS and is available in the npm registry. To install it execute:

npm install --save ideagen-timeline-sdk

Initialisation

We can use the API by instantiating new timelineSDK object:

var IdeagenTimelineSDK = require('ideagen-timeline-sdk')
var ideagenTimelineSDK = new ideagenTimelineSDK({
  TenantId: 'PUT YOUR TENANT ID HERE',
  AuthToken: 'PUT YOUR AUTH TOKEN HERE'
})

Timelines

Create Timeline

ideagenTimelineSDK.timelines
  .create({
    TimelineId: '1234',
    Title: 'Some Title'
  })
  .then(function (response) {
    // response is the response object from the server
    console.log(response)
  })
  .catch(function (error) {
    // error is the error message
    console.error(error)
  })

Edit Timeline Title

ideagenTimelineSDK.timelines
  .editTimelineTitle('1234', 'New title')
  .then(function (response) {
    // response is the response object from the server
    console.log(response)
  })
  .catch(function (error) {
    // error is the error message
    console.error(error)
  })

Retrieve Timeline

ideagenTimelineSDK.timelines
  .get('1234')
  .then(function (response) {
    // response is the response object from the server
    console.log(response)
  })
  .catch(function (error) {
    // error is the error message
    console.error(error)
  })

List Timelines

ideagenTimelineSDK.timelines
  .getAll()
  .then(function (response) {
    // response is the response object from the server
    console.log(response)
  })
  .catch(function (error) {
    // error is the error message
    console.error(error)
  })

Delete Timeline

ideagenTimelineSDK.timelines
  .delete('1234')
  .then(function (response) {
    // response is the response object from the server
    console.log(response)
  })
  .catch(function (error) {
    // error is the error message
    console.error(error)
  })

Link Event to Timeline

ideagenTimelineSDK.timelines
  .linkEvent('TimelineId', 'EventId')
  .then(function (response) {
    // response is the response object from the server
    console.log(response)
  })
  .catch(function (error) {
    // error is the error message
    console.error(error)
  })

Unlink Event from Timeline

ideagenTimelineSDK.timelines
  .unlinkEvent('TimelineId', 'EventId')
  .then(function (response) {
    // response is the response object from the server
    console.log(response)
  })
  .catch(function (error) {
    // error is the error message
    console.error(error)
  })

Get Timeline Linked Events

ideagenTimelineSDK.timelines
  .getLinkedEvents('TimelineId')
  .then(function (response) {
    // response is the response object from the server
    console.log(response)
  })
  .catch(function (error) {
    // error is the error message
    console.error(error)
  })

TimelineEvent

Create Timeline Event

ideagenTimelineSDK.timelineEvents
  .create({
    TimelineEventId: '1234',
    Title: 'TestTitle',
    Description: 'TestDescription',
    EventDateTime: 'EventDateTime',
    Location: 'Location'
  })
  .then(function (response) {
    // response is the response object from the server
    console.log(response)
  })
  .catch(function (error) {
    // error is the error message
    console.error(error)
  })

Retrieve Timeline Event

ideagenTimelineSDK.timelineEvents
  .get('1234')
  .then(function (response) {
    // response is the response object from the server
    console.log(response)
  })
  .catch(function (error) {
    // error is the error message
    console.error(error)
  })

Edit Timeline Event Title

ideagenTimelineSDK.timelineEvents
  .editTitle('1234', 'New Title')
  .then(function (response) {
    // response is the response object from the server
    console.log(response)
  })
  .catch(function (error) {
    // error is the error message
    console.error(error)
  })

Edit Timeline Event Description

ideagenTimelineSDK.timelineEvents
  .editDescription('1234', 'New Description')
  .then(function (response) {
    // response is the response object from the server
    console.log(response)
  })
  .catch(function (error) {
    // error is the error message
    console.error(error)
  })

Edit Timeline Event Location

ideagenTimelineSDK.timelineEvents
  .editLocation('1234', 'New Location')
  .then(function (response) {
    // response is the response object from the server
    console.log(response)
  })
  .catch(function (error) {
    // error is the error message
    console.error(error)
  })

Edit Timeline Event DateTime

ideagenTimelineSDK.timelineEvents
  .editDateTime('1234', 'New Date Time')
  .then(function (response) {
    // response is the response object from the server
    console.log(response)
  })
  .catch(function (error) {
    // error is the error message
    console.error(error)
  })

Delete Timeline Event

ideagenTimelineSDK.timelineEvents
  .delete('1234')
  .then(function (response) {
    // response is the response object from the server
    console.log(response)
  })
  .catch(function (error) {
    // error is the error message
    console.error(error)
  })

Contribution

How to Install for Development:

  1. You need to install node and npm.
  • node version: v8.9.1
  • npm version: 5.6.0
  1. Clone the repository
git clone https://github.com/dirchev/ip3-ideagen-timeline-sdk
  1. Enter the folder
cd ./ip3-ideagen-timeline-sdk
  1. Install dependencies
npm install
  1. Run Tests
npm test

Bugs and New Features

Feel free to report bugs or suggest new features here.

Contribution

If you want to fix/update/improve something - fork and create a PR to this repository. Please write/update the tests!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.