Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ndustrial/contxt-sdk

Package Overview
Dependencies
Maintainers
9
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ndustrial/contxt-sdk - npm Package Compare versions

Comparing version 0.0.23 to 0.0.24

docs/Events.md

9

CHANGELOG.md

@@ -1,3 +0,10 @@

## [v0.0.23](http://github.com/ndustrialio/contxt-sdk-js/tree/v0.0.22) (2018-08-01)
## [v0.0.24](http://github.com/ndustrialio/contxt-sdk-js/tree/v0.0.24) (2018-08-07)
**Added**
* Added `assetLabel` and `label` as fields associated with `AssetAttributeValues`
* Added Events module with ability to create, read, update, and delete events
## [v0.0.23](http://github.com/ndustrialio/contxt-sdk-js/tree/v0.0.23) (2018-08-01)
**Fixed**

@@ -4,0 +11,0 @@

@@ -38,2 +38,6 @@ ## Classes

</dd>
<dt><a href="./Events.md">Events</a></dt>
<dd><p>Module that provides access to, and the manipulation
of, information about different events</p>
</dd>
<dt><a href="./Facilities.md">Facilities</a></dt>

@@ -106,2 +110,4 @@ <dd><p>Module that provides access to, and the manipulation

</dd>
<dt><a href="./Typedefs.md#Event">Event</a> : <code>Object</code></dt>
<dd></dd>
<dt><a href="./Typedefs.md#ExternalModule">ExternalModule</a> : <code>Object</code></dt>

@@ -108,0 +114,0 @@ <dd><p>An external module to be integrated into the SDK as a first class citizen. Includes information

@@ -57,5 +57,7 @@ <a name="Asset"></a>

| assetAttributeId | <code>string</code> | UUID corresponding to the asset attribute |
| [assetLabel] | <code>string</code> | Label from the associated asset |
| createdAt | <code>string</code> | ISO 8601 Extended Format date/time string |
| effectiveDate | <code>string</code> | ISO 8601 Extended Format date/time string |
| id | <code>string</code> | UUID |
| [label] | <code>string</code> | Label from the associated asset attribute |
| [notes] | <code>string</code> | |

@@ -203,2 +205,41 @@ | updatedAt | <code>string</code> | ISO 8601 Extended Format date/time string |

**Kind**: global typedef
<a name="Event"></a>
## Event : <code>Object</code>
**Kind**: global typedef
**Properties**
| Name | Type | Description |
| --- | --- | --- |
| allowOthersToTrigger | <code>boolean</code> | Whether or not to allow non-owners to trigger the Event |
| createdAt | <code>string</code> | ISO 8601 Extended Format date/time string |
| [deletedAt] | <code>string</code> | ISO 8601 Extended Format date/time string |
| [eventType] | <code>Object</code> | |
| [eventType.clientId] | <code>string</code> | The ID of the client to which the event type belongs |
| [eventType.createdAt] | <code>string</code> | ISO 8601 Extended Format date/time string |
| [eventType.description] | <code>string</code> | |
| [eventType.id] | <code>string</code> | UUID formatted ID |
| [eventType.isRealtimeEnabled] | <code>boolean</code> | |
| [eventType.level] | <code>number</code> | |
| [eventType.name] | <code>string</code> | |
| [eventType.slug] | <code>string</code> | |
| [eventType.updatedAt] | <code>string</code> | ISO 8601 Extended Format date/time string |
| [eventTypeId] | <code>string</code> | UUID corresponding with an event type |
| [facilityId] | <code>number</code> | The facility associated with the event |
| id | <code>string</code> | UUID formatted ID |
| [isPublic] | <code>boolean</code> | |
| name | <code>string</code> | |
| [organizationId] | <code>string</code> | UUID of the organization to which the event belongs |
| [owner] | <code>Object</code> | |
| [owner.createdAt] | <code>string</code> | ISO 8601 Extended Format date/time string |
| [owner.email] | <code>string</code> | |
| [owner.firstName] | <code>string</code> | |
| [owner.id] | <code>string</code> | |
| [owner.isMachineUser] | <code>boolean</code> | |
| [owner.lastName] | <code>string</code> | |
| [owner.updatedAt] | <code>string</code> | ISO 8601 Extended Format date/time string |
| [ownerId] | <code>string</code> | The ID of the user who owns the event |
| [topicArn] | <code>number</code> | The Amazon Resource Name (ARN) associated with the event |
| updatedAt | <code>string</code> | ISO 8601 Extended Format date/time string |
<a name="ExternalModule"></a>

@@ -205,0 +246,0 @@

2

package.json
{
"name": "@ndustrial/contxt-sdk",
"version": "0.0.23",
"version": "0.0.24",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -49,5 +49,7 @@ import isPlainObject from 'lodash.isplainobject';

* @property {string} assetAttributeId UUID corresponding to the asset attribute
* @property {string} [assetLabel] Label from the associated asset
* @property {string} createdAt ISO 8601 Extended Format date/time string
* @property {string} effectiveDate ISO 8601 Extended Format date/time string
* @property {string} id UUID
* @property {string} [label] Label from the associated asset attribute
* @property {string} [notes]

@@ -54,0 +56,0 @@ * @property {string} updatedAt ISO 8601 Extended Format date/time string

@@ -12,2 +12,12 @@ export default {

},
events: {
staging: {
clientId: 'dn4MaocJFdKtsBy9sFFaTeuJWL1nt5xu',
host: 'https://events-staging.api.ndustrial.io'
},
production: {
clientId: '7jzwfE20O2XZ4aq3cO1wmk63G9GzNc8j',
host: 'https://events.api.ndustrial.io'
}
},
facilities: {

@@ -14,0 +24,0 @@ production: {

import Assets from './assets';
import Config from './config';
import Events from './events';
import Facilities from './facilities';

@@ -73,2 +74,3 @@ import Iot from './iot';

this.auth = this._createAuthSession(sessionType);
this.events = new Events(this, this._createRequest('events'));
this.facilities = new Facilities(this, this._createRequest('facilities'));

@@ -75,0 +77,0 @@ this.iot = new Iot(this, this._createRequest('iot'));

import times from 'lodash.times';
import Config from './config';
import ContxtSdk from './index';
import Events from './events';
import Facilities from './facilities';

@@ -69,2 +70,10 @@ import Iot from './iot';

it('creates an instance of the request module for Events', function() {
expect(createRequest).to.be.calledWith('events');
});
it('sets an instance of Events', function() {
expect(contxtSdk.events).to.be.an.instanceof(Events);
});
it('creates an instance of the request module for Facilities', function() {

@@ -71,0 +80,0 @@ expect(createRequest).to.be.calledWith('facilities');

@@ -335,3 +335,3 @@ import axios from 'axios';

const audienceNameOne = faker.hacker.adjective();
const audienceNameTwo = faker.hacker.adjective();
const audienceNameTwo = faker.lorem.word();
expectedPromiseOne = Promise.resolve();

@@ -338,0 +338,0 @@ expectedPromiseTwo = Promise.resolve();

@@ -7,5 +7,7 @@ /**

* @param {string} input.asset_id UUID corresponding to the asset
* @param {string} [input.asset_label] Label from the associated asset
* @param {string} input.created_at ISO 8601 Extended Format date/time string
* @param {string} input.effective_date ISO 8601 Extended Format date/time string
* @param {string} input.id UUID
* @param {string} [input.label] Label from the associated asset attribute
* @param {string} [input.notes]

@@ -23,5 +25,7 @@ * @param {string} input.updated_at ISO 8601 Extended Format date/time string

assetId: input.asset_id,
assetLabel: input.asset_label,
createdAt: input.created_at,
effectiveDate: input.effective_date,
id: input.id,
label: input.label,
notes: input.notes,

@@ -28,0 +32,0 @@ updatedAt: input.updated_at,

@@ -17,2 +17,3 @@ import omit from 'lodash.omit';

assetId: initialValue.asset_id,
assetLabel: initialValue.asset_label,
createdAt: initialValue.created_at,

@@ -25,2 +26,3 @@ effectiveDate: initialValue.effective_date,

'asset_id',
'asset_label',
'created_at',

@@ -27,0 +29,0 @@ 'effective_date',

@@ -9,3 +9,5 @@ /**

* @returns {string} output.asset_id UUID corresponding to the asset
* @returns {string} [output.asset_label] String label from the associated asset
* @returns {string} output.effective_date ISO 8601 Extended Format date/time string
* @returns {string} [output.label] Label from the associated asset attribute
* @returns {string} [output.notes]

@@ -20,3 +22,5 @@ * @returns {string} output.value

asset_id: input.assetId,
asset_label: input.assetLabel,
effective_date: input.effectiveDate,
label: input.label,
notes: input.notes,

@@ -23,0 +27,0 @@ value: input.value

@@ -15,2 +15,3 @@ import omit from 'lodash.omit';

asset_id: initialValue.assetId,
asset_label: initialValue.assetLabel,
effective_date: initialValue.effectiveDate

@@ -21,2 +22,3 @@ },

'assetId',
'assetLabel',
'createdAt',

@@ -23,0 +25,0 @@ 'effectiveDate',

@@ -12,5 +12,7 @@ 'use strict';

assetId: () => factory.build('asset').id,
assetLabel: () => faker.lorem.word(),
createdAt: () => faker.date.past().toISOString(),
effectiveDate: () => faker.date.recent().toISOString(),
id: () => faker.random.uuid(),
label: () => faker.lorem.word(),
notes: () => faker.lorem.sentence(),

@@ -31,2 +33,5 @@ updatedAt: () => faker.date.recent().toISOString(),

assetAttributeValue.asset_label = assetAttributeValue.assetLabel;
delete assetAttributeValue.assetLabel;
assetAttributeValue.created_at = assetAttributeValue.createdAt;

@@ -33,0 +38,0 @@ delete assetAttributeValue.createdAt;

@@ -13,2 +13,4 @@ 'use strict';

require('./defaultAudiences');
require('./event');
require('./eventType');
require('./facility');

@@ -22,2 +24,3 @@ require('./facilityGrouping');

require('./organization');
require('./owner');
require('./paginationMetadata');

@@ -24,0 +27,0 @@ require('./userProfile');

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc