@edgeiq/edgeiq-api-js 1.3.2 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,9 @@ interface CommandsInterface extends BaseModelInterface<Command, CommandInput, Co
8
8
  assignToDeviceType(commandId: string, deviceTypeId: string): Promise<string>;
9
9
  removeFromDevice(commandId: string, deviceId: string): Promise<string>;
10
10
  removeFromDeviceType(commandId: string, deviceTypeId: string): Promise<string>;
11
- executeOnDevice(commandId: string, deviceId: string): Promise<string>;
11
+ executeOnDevice(commandId: string, deviceId: string, options: {
12
+ [key: string]: unknown;
13
+ }): Promise<string>;
12
14
  }
13
15
  export declare const Commands: CommandsInterface;
14
16
  export {};
@@ -316,7 +316,7 @@ exports.Commands = (function (_super) {
316
316
  });
317
317
  });
318
318
  };
319
- class_1.executeOnDevice = function (commandId, deviceId) {
319
+ class_1.executeOnDevice = function (commandId, deviceId, options) {
320
320
  return __awaiter(this, void 0, void 0, function () {
321
321
  var axios, error_11;
322
322
  return __generator(this, function (_a) {
@@ -325,7 +325,7 @@ exports.Commands = (function (_super) {
325
325
  _a.trys.push([0, 2, , 3]);
326
326
  this.logAction("executing command " + commandId + " on device " + deviceId);
327
327
  axios = __1.EdgeIQAPI.getAxios();
328
- return [4, axios.post(constants_1.Endpoints.device + "/" + deviceId + "/" + constants_1.Endpoints.command + "/" + commandId + "/execute")];
328
+ return [4, axios.post(constants_1.Endpoints.device + "/" + deviceId + "/" + constants_1.Endpoints.command + "/" + commandId + "/execute", options)];
329
329
  case 1:
330
330
  _a.sent();
331
331
  return [2, 'Command execution queued'];
@@ -8,7 +8,8 @@ export declare enum SenderType {
8
8
  shell_sender = "shell_sender",
9
9
  opcua_sender = "opcua_sender",
10
10
  modbus_sender = "modbus_sender",
11
- bacnet_sender = "bacnet_sender"
11
+ bacnet_sender = "bacnet_sender",
12
+ gcp_pubsub_sender = "gcp_pubsub_sender"
12
13
  }
13
14
  export interface CommandInput {
14
15
  name: string;
@@ -12,4 +12,5 @@ var SenderType;
12
12
  SenderType["opcua_sender"] = "opcua_sender";
13
13
  SenderType["modbus_sender"] = "modbus_sender";
14
14
  SenderType["bacnet_sender"] = "bacnet_sender";
15
+ SenderType["gcp_pubsub_sender"] = "gcp_pubsub_sender";
15
16
  })(SenderType = exports.SenderType || (exports.SenderType = {}));
@@ -5,6 +5,9 @@ export interface Branding {
5
5
  primary_color: string;
6
6
  logo_background_color: string;
7
7
  portal_title: string;
8
+ secondary_color: string;
9
+ sidebar_text_color: string;
10
+ gradient_sidbar: boolean;
8
11
  }
9
12
  export interface Aliases {
10
13
  gateway: string;
@@ -73,6 +73,7 @@ export declare const BaseEndpoints: {
73
73
  integration: string;
74
74
  integrationEvent: string;
75
75
  pollableAttribute: string;
76
+ lwm2mObjectLinks: string;
76
77
  region: string;
77
78
  report: string;
78
79
  rule: string;
@@ -102,6 +103,7 @@ export declare const Endpoints: {
102
103
  deviceTemplate: string;
103
104
  deviceType: string;
104
105
  device: string;
106
+ diviceLwm2mObjetLinks: string;
105
107
  deviceLocationObservation: string;
106
108
  downstreamSystem: string;
107
109
  discoveredDevice: string;
package/dist/constants.js CHANGED
@@ -89,6 +89,7 @@ exports.BaseEndpoints = {
89
89
  integration: 'integrations',
90
90
  integrationEvent: 'integration_events',
91
91
  pollableAttribute: 'pollable_attributes',
92
+ lwm2mObjectLinks: 'lwm2m_object_links',
92
93
  region: 'regions',
93
94
  report: 'reports',
94
95
  rule: 'rules',
@@ -118,6 +119,7 @@ exports.Endpoints = {
118
119
  deviceTemplate: "" + exports.BaseEndpoints.deviceTemplate,
119
120
  deviceType: "" + exports.BaseEndpoints.deviceType,
120
121
  device: "" + exports.BaseEndpoints.device,
122
+ diviceLwm2mObjetLinks: "" + exports.BaseEndpoints.lwm2mObjectLinks,
121
123
  deviceLocationObservation: "" + exports.BaseEndpoints.deviceLocationObservation,
122
124
  downstreamSystem: "" + exports.BaseEndpoints.downstreamSystem,
123
125
  discoveredDevice: "" + exports.BaseEndpoints.discoveredDevice,
@@ -3,6 +3,7 @@ import { BaseModelInterface } from '../core/ModelClass';
3
3
  import { Log } from '../log/models';
4
4
  import { GatewayCommand } from '../gatewayCommands/models';
5
5
  import { BulkActionResponse } from '../models';
6
+ import { Lwm2mObjectLinks } from '../lwm2m/models';
6
7
  import { DevicesFilters, Device, DeviceInput, PaginatedDevices } from './models';
7
8
  interface DevicesInterface extends BaseModelInterface<Device, DeviceInput, DevicesFilters, PaginatedDevices> {
8
9
  bulkCreate(uniqueIds: string[], deviceTypeId: string, namePrefix: string): Promise<BulkActionResponse>;
@@ -21,6 +22,7 @@ interface DevicesInterface extends BaseModelInterface<Device, DeviceInput, Devic
21
22
  csvBulkDownload(filters?: DevicesFilters): Promise<File>;
22
23
  getLogs(id: string): Promise<Log[]>;
23
24
  requestLogs(id: string): Promise<GatewayCommand>;
25
+ diviceLwm2mObjetLinks(id: string): Promise<Lwm2mObjectLinks[]>;
24
26
  }
25
27
  export declare const Devices: DevicesInterface;
26
28
  export {};
@@ -584,5 +584,29 @@ exports.Devices = (function (_super) {
584
584
  });
585
585
  });
586
586
  };
587
+ class_1.diviceLwm2mObjetLinks = function (id) {
588
+ return __awaiter(this, void 0, void 0, function () {
589
+ var axios, result, error_21;
590
+ return __generator(this, function (_a) {
591
+ switch (_a.label) {
592
+ case 0:
593
+ _a.trys.push([0, 2, , 3]);
594
+ this.logAction("Getting lwm2m object links attached to device with id " + id);
595
+ axios = __1.EdgeIQAPI.getAxios();
596
+ return [4, axios.get(constants_1.Endpoints.device + "/" + id + "/" + constants_1.Endpoints.diviceLwm2mObjetLinks)];
597
+ case 1:
598
+ result = _a.sent();
599
+ return [2, result === null || result === void 0 ? void 0 : result.data];
600
+ case 2:
601
+ error_21 = _a.sent();
602
+ if ((0, helpers_1.isApiError)(error_21)) {
603
+ throw error_21;
604
+ }
605
+ throw error_21;
606
+ case 3: return [2];
607
+ }
608
+ });
609
+ });
610
+ };
587
611
  return class_1;
588
612
  }(ModelClass_1.BaseModelClass));
@@ -0,0 +1,31 @@
1
+ import { Base } from '../models';
2
+ export interface Lwm2mObjectLinks extends Base {
3
+ device_id?: string;
4
+ links?: Lwm2mObjectLink[];
5
+ }
6
+ export interface Lwm2mObjectLink {
7
+ url?: string;
8
+ description?: string;
9
+ attributes?: Lwm2mAttributesCore;
10
+ }
11
+ export interface Lwm2mAttributesCore {
12
+ path?: ObjectPath;
13
+ rootPath?: string;
14
+ uriReference?: string;
15
+ attributes?: Lwm2mAttributes;
16
+ }
17
+ export interface ObjectPath {
18
+ objectId?: number;
19
+ objectInstanceId?: number;
20
+ }
21
+ export interface Lwm2mAttributes {
22
+ rt?: {
23
+ [key: string]: unknown;
24
+ };
25
+ ct?: {
26
+ [key: string]: unknown;
27
+ };
28
+ ver?: {
29
+ [key: string]: unknown;
30
+ };
31
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgeiq/edgeiq-api-js",
3
- "version": "1.3.2",
3
+ "version": "1.3.5",
4
4
  "author": "EdgeIQ",
5
5
  "license": "ISC",
6
6
  "description": "This project presents EdgeIQ API SDK.",