Module: baseObjects

gitHubServer.js

Version:
  • 2.0.0
Author:
License:
  • Apache-2.0
Source:

Example

import {Companies, Interactions, Users, Billings} from './api/gitHubServer.js'
const companies = new Companies(token, org, processName)
const interactions = new Interactions(token, org, processName)
const users = new Users(token, org, processName)
const billings = new Billings(token, org, processName)

const allCompanies = await companies.getAll()
const allInteractions = await interactions.getAll()
const allUsers = await users.getAll()
const allBillings = await billings.getAll()

const company = await companies.findByName('myCompany')
const interaction = await interactions.findByName('myInteraction')
const user = await users.findByName('myUser')

Requires

Classes

Actions
Companies
Interactions
Storage
Studies
Users

Methods


<async, inner> createObj(objs)

Create objects in the mediumroast.io application

Parameters:
Name Type Description
objs Array

the objects to create in the backend

Source:
Returns:

the results from the called function mrRest class

Type
Array

<async, inner> deleteObj(id, endpoint)

Delete an object in the mediumroast.io application

Parameters:
Name Type Description
id String

the object to be deleted in the mediumroast.io application

endpoint String

defaults to findbyx and is combined with credential and version info

Source:
To Do:
  • implment when available in the backend
Returns:

the results from the called function mrRest class

Type
Array

<async, inner> findById(id, endpoint)

Find all objects by id from the mediumroast.io application

Parameters:
Name Type Description
id String

the id of the object to find

endpoint String

defaults to findbyx and is combined with credential and version info

Deprecated:
  • Yes
Source:
Returns:

the results from the called function mrRest class

Type
Array

<async, inner> findByName(name)

Find all objects by name from the mediumroast.io application

Parameters:
Name Type Description
name String

the name of the object to find

Source:
Returns:

the results from the called function mrRest class

Type
Array

<async, inner> findByX(attribute, value)

Find all objects by attribute and value pair from the mediumroast.io application

Parameters:
Name Type Description
attribute String

the attribute used to find objects

value String

the value for the defined attribute

Source:
Returns:

the results from the called function mrRest class

Type
Array

<async, inner> getAll()

Get all objects from the mediumroast.io application

Source:
Returns:

the results from the called function mrRest class

Type
Array

<async, inner> linkObj(objs)

Link objects in the mediumroast.io application

Parameters:
Name Type Description
objs Array

the objects to link in the backend

Source:
Returns:

the results from the called function mrRest class

Type
Array

<async, inner> updateObj(obj, endpoint)

Update an object in the mediumroast.io application

Parameters:
Name Type Description
obj Object

the object to update in the backend which includes the id and, the attribute and value to be updated

endpoint String

defaults to findbyx and is combined with credential and version info

Source:
Returns:

the results from the called function mrRest class

Type
Array