Skip to content
3PS Javascript SDK
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test
.babelrc
.editorconfig
.eslintignore
.eslintrc
.gitignore
.npmignore
README.md
package.json

README.md

Ideea


Ideea.io     Getting Started     Full Documentation     Cheat Sheet


3PS JS SDK

This is the official SDK for the 3PS/TPS platform. You can use this SDK to manage objects and object groups, jobs, job groups and job events, and addresses

Installation

$ npm install tps

Getting Started

const tps = require('TPS');

Methods

This is not a complete list of methods. Please refer to the full documentation for the full list of methods.

objects.create(user_id, group_id)

Creates an object

tps.objects.create(user_id, group_id).then(object => {
  console.log(object);
});

objects.get(objectID)

Get object by objectID

tps.objects.get('00ce6d6a-ea29-4840-9b5d-cd1f6ae3bc6b').then(object => {
  console.log(object);
});

object.update(objectID, {groupID, groupID})

Updates a single object

tps.objects.update(objectID, {userID, groupID}).then(object => {
  console.log(object);
});

object.delete(objectID)

Deletes a single object

tps.objects.delete(objectID).then(item => {
  console.log(item);
});

object.star(objectID)

stars an object

tps.objects.star(objectID).then(item => {
  console.log(item);
});

object.unStar(objectID)

un-Stars a single object

tps.objects.unStar(objectID).then(item => {
  console.log(item);
});

jobs.create(jobID, groupIdD

Creates a single job

tps.jobs.create(jobID, groupID).then(job => {
  console.log(job);
});

jobs.get(jobID)

Gets a single job

tps.jobs.get(jobID).then(job => {
  console.log(job);
});

jobs.getByGroupID(groupID)

Gets all jobs with the same group ID

tps.jobs.getByGroupID(groupID).then(jobs => {
  console.log(jobs);
});

jobs.createJobEvent(jobID, eventObj)

Creates an event for a job

tps.jobs.createJobEvent(jobID, eventObj).then(event => {
  console.log(event);
});

jobs.getJobEvents(jobID)

Get all job events

tps.jobs.getJobEvents(jobID).then(events => {
  console.log(events);
});

component.create({userID, groupID})

Creates a single component

tps.component.create({userID, groupID}).then(component => {
  console.log(component);
});

component.get(componentID)

Gets one component

tps.component.get(componentID).then(component => {
  console.log(component);
});

component.update(componentID, {groupID, userID})

Updates a component

tps.component.update(componentID, {groupID, userID}).then(component => {
  console.log(component);
});

component.delete(componentID)

Deletes a component

tps.component.delete(component).then(component => {
  console.log(component);
});

component.star(componentID)

Stars a component

tps.component.star(component).then(component => {
  console.log(component);
});

component.unStar(componentID)

Un-stars a component

tps.component.unStar(component).then(component => {
  console.log(component);
});

addresses.create(addressObj)

Created an address

tps.addresses.create(addressObj).then(address => {
  console.log(address);
});

addresses.get(addressID)

Gets an address

tps.addresses.get(addressID).then(address => {
  console.log(address);
});

addresses.update(addressID, addressUpdatedObj)

Updates an address

tps.addresses.update(addressID, addressUpdatedObj).then(address => {
  console.log(address);
});

addresses.setDefault(addressID)

Makes an address default

tps.addresses.setDefault(addressID).then(address => {
  console.log(address);
});

addresses.getByGroupID(groupID)

Gets all addresses associated with the provided groupID

tps.addresses.getByGroupID(groupID).then(addresses => {
  console.log(addresses);
});

addresses.delete(addressID)

Deletes an address

tps.addresses.delete(addressID).then(address => {
  console.log(address);
});
You can’t perform that action at this time.