This lib provides an SDK for the Timeline API from Ideagen. See the API code here
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
This Library works with NodeJS and is available in the npm registry. To install it execute:
npm install --save ideagen-timeline-sdk
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'
})
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)
})
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)
})
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)
})
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)
})
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)
})
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)
})
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)
})
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)
})
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)
})
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)
})
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)
})
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)
})
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)
})
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)
})
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)
})
- You need to install
node
andnpm
.
node
version: v8.9.1npm
version: 5.6.0
- Clone the repository
git clone https://github.com/dirchev/ip3-ideagen-timeline-sdk
- Enter the folder
cd ./ip3-ideagen-timeline-sdk
- Install dependencies
npm install
- Run Tests
npm test
Feel free to report bugs or suggest new features here.
If you want to fix/update/improve something - fork and create a PR to this repository. Please write/update the tests!