@edgeiq/edgeiq-api-js 1.2.16 → 1.3.2

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.
@@ -228,9 +228,7 @@ exports.DeviceTransferRequests = (function (_super) {
228
228
  _a.trys.push([0, 2, , 3]);
229
229
  this.logAction("Accepting " + ids.length + " device transfer requests with device type with ID: " + deviceTypeId);
230
230
  axios = __1.EdgeIQAPI.getAxios();
231
- return [4, axios.post(constants_1.Endpoints.deviceTransferRequest + "/bulk/transfer", {
232
- data: { ids: ids, device_type_id: deviceTypeId },
233
- })];
231
+ return [4, axios.post(constants_1.Endpoints.deviceTransferRequest + "/bulk/transfer", { ids: ids, device_type_id: deviceTypeId })];
234
232
  case 1:
235
233
  result = _a.sent();
236
234
  return [2, result === null || result === void 0 ? void 0 : result.data];
@@ -389,7 +389,7 @@ exports.Devices = (function (_super) {
389
389
  this.logAction("Attaching " + rulesIds.length + " rules with to device with id " + id);
390
390
  axios = __1.EdgeIQAPI.getAxios();
391
391
  return [4, axios.post(constants_1.Endpoints.device + "/" + id + "/rules/bulk", {
392
- data: { ids: rulesIds },
392
+ ids: rulesIds,
393
393
  })];
394
394
  case 1:
395
395
  result = _a.sent();
@@ -2,6 +2,70 @@ import { Base, Filter, Filters, Pagination } from '../models';
2
2
  export declare type ListenerType = 'shell_polling' | 'icmp_polling' | 'snmp_polling' | 'tcp_server' | 'tcp_client' | 'udp_server' | 'udp_client' | 'http_server' | 'http_client' | 'dev' | 'tcp_modbus' | 'opcua' | 'bacnet' | 'dbus_signal' | 'cloud' | 'cloud_polling_inmarsat' | 'cloud_polling_orbcomm' | 'cloud_gcp_pubsub_jci' | 'cloud_polling_assetlink';
3
3
  export declare type IngestorType = 'edge' | 'cloud';
4
4
  export declare type HandlerType = 'fixed' | 'delimited' | 'router' | 'dbus' | 'passthrough';
5
+ export interface ListenerParam {
6
+ address?: string;
7
+ request_type?: string;
8
+ quantity?: number;
9
+ value?: number | string;
10
+ and_mask?: number;
11
+ or_mask?: number;
12
+ node_id?: string;
13
+ object_instance?: number;
14
+ object_type?: string;
15
+ property_id?: string;
16
+ }
17
+ export interface ListenerFilter {
18
+ interface?: string;
19
+ member?: string;
20
+ path?: string;
21
+ }
22
+ export interface DeviceTypeMapping {
23
+ device_type_id?: string;
24
+ key?: string;
25
+ value?: string;
26
+ }
27
+ export interface IngestorRoute {
28
+ method?: string;
29
+ path?: string;
30
+ }
31
+ export interface IngestorListener {
32
+ access_id?: string;
33
+ password?: string;
34
+ address?: string;
35
+ port?: number;
36
+ timeout?: number;
37
+ poll_interval?: number;
38
+ host?: string;
39
+ slave_id?: number;
40
+ retries?: number;
41
+ community?: string;
42
+ version?: string;
43
+ oids?: string[];
44
+ url?: string;
45
+ method?: string;
46
+ dev?: string;
47
+ baud?: string;
48
+ command?: string;
49
+ min_timeout_seconds?: number;
50
+ subscription_id?: string;
51
+ integration_id?: string;
52
+ create_discovered_device?: boolean;
53
+ auto_promote_discovered_device?: boolean;
54
+ heartbeat_period?: string;
55
+ params: ListenerParam;
56
+ filters: ListenerFilter[];
57
+ device_type_mapping: DeviceTypeMapping[];
58
+ }
59
+ export interface IngestorHandler {
60
+ strip_delimited?: boolean;
61
+ delimited?: string;
62
+ dbus_map_key?: string;
63
+ index?: number;
64
+ length?: number;
65
+ map_keys?: string[];
66
+ type?: string;
67
+ routes: IngestorRoute[];
68
+ }
5
69
  export interface IngestorInput {
6
70
  name: string;
7
71
  company_id: string;
@@ -11,13 +75,9 @@ export interface IngestorInput {
11
75
  };
12
76
  target_template?: string;
13
77
  listener_type: ListenerType;
14
- listener?: {
15
- [key: string]: unknown;
16
- };
78
+ listener: IngestorListener;
17
79
  handler_type: HandlerType;
18
- handler?: {
19
- [key: string]: unknown;
20
- };
80
+ handler: IngestorHandler;
21
81
  translator?: {
22
82
  [key: string]: unknown;
23
83
  };
@@ -6,6 +6,9 @@ export declare type RuleActionBodyType = 'html' | 'text';
6
6
  export declare type LocationVia = 'gps' | 'cell_tower' | 'bluetooth' | 'wifi' | 'other';
7
7
  export declare type GeneratedAtFormat = 'rfc3339' | 'unix_timestamp';
8
8
  export declare type LocationTransitionDirectionType = 'arriving' | 'leaving';
9
+ export declare type DerivedValuesTypes = 'count' | 'min' | 'max' | 'avg' | 'sum' | 'convert_indexed_keys';
10
+ export declare type WhereConditionTypes = 'where' | 'or_where';
11
+ export declare type WhereConditionOperators = 'equal' | 'not_equal' | 'greater_than' | 'greater_than_equal' | 'less_than' | 'less_than_equal' | 'in' | 'not_in' | 'starts_with' | 'ends_with' | 'contains' | 'strict_contains' | 'length_equals' | 'length_not_equals' | 'length_greater_than' | 'length_greater_than_equal' | 'length_less_than' | 'length_less_than_equal';
9
12
  export interface CredentialData {
10
13
  type?: string;
11
14
  value: string;
@@ -62,14 +65,30 @@ export interface RuleAction {
62
65
  channels?: PRTGChannel[];
63
66
  definition_id?: string;
64
67
  }
68
+ export interface WhereCondition {
69
+ type?: WhereConditionTypes;
70
+ operator?: WhereConditionOperators;
71
+ property?: string;
72
+ value?: string | string[];
73
+ }
74
+ export interface DerivedValue {
75
+ name?: string;
76
+ type?: DerivedValuesTypes;
77
+ property?: string;
78
+ properties?: string[];
79
+ data_set?: string;
80
+ where_conditions?: WhereCondition[];
81
+ }
65
82
  export interface RuleCondition {
66
83
  type: RuleConditionType;
67
84
  property?: string;
68
- value?: unknown;
85
+ value?: string[];
69
86
  value_type?: string;
70
87
  rule_conditions?: (RuleCondition | undefined)[];
71
88
  error_type?: DeviceErrorType;
72
89
  location_transition_evaluator?: LocationTransitionEvaluator;
90
+ cold_start_trigger?: boolean;
91
+ derived_values?: DerivedValue[];
73
92
  }
74
93
  export interface LocationTransitionEvaluator {
75
94
  region_id: string;
@@ -1,9 +1,10 @@
1
1
  import { BaseModelInterface } from '../core/ModelClass';
2
2
  import { BulkActionResponse } from '../models';
3
- import { SoftwareUpdate, SoftwareUpdateInput, SoftwareUpdatesFilters, PaginatedSoftwareUpdates } from './models';
3
+ import { SoftwareUpdate, SoftwareUpdateInput, SoftwareUpdatesFilters, PaginatedSoftwareUpdates, IssueSoftwareUpdateInput } from './models';
4
4
  interface SoftwareUpdatesInterface extends BaseModelInterface<SoftwareUpdate, SoftwareUpdateInput, SoftwareUpdatesFilters, PaginatedSoftwareUpdates> {
5
5
  update(softwareUpdate: SoftwareUpdate): Promise<SoftwareUpdate>;
6
6
  deleteMultiple(ids: string[]): Promise<BulkActionResponse>;
7
+ bulkSoftwareUpdate(payload: IssueSoftwareUpdateInput): Promise<BulkActionResponse>;
7
8
  }
8
9
  export declare const SoftwareUpdates: SoftwareUpdatesInterface;
9
10
  export {};
@@ -220,5 +220,29 @@ exports.SoftwareUpdates = (function (_super) {
220
220
  });
221
221
  });
222
222
  };
223
+ class_1.bulkSoftwareUpdate = function (payload) {
224
+ return __awaiter(this, void 0, void 0, function () {
225
+ var axios, result, error_7;
226
+ return __generator(this, function (_a) {
227
+ switch (_a.label) {
228
+ case 0:
229
+ _a.trys.push([0, 2, , 3]);
230
+ this.logAction("Issuing software updates with payload " + payload);
231
+ axios = __1.EdgeIQAPI.getAxios();
232
+ return [4, axios.post(constants_1.Endpoints.device + "/bulk/software_update", payload)];
233
+ case 1:
234
+ result = _a.sent();
235
+ return [2, result === null || result === void 0 ? void 0 : result.data];
236
+ case 2:
237
+ error_7 = _a.sent();
238
+ if ((0, helpers_1.isApiError)(error_7)) {
239
+ throw error_7;
240
+ }
241
+ throw error_7;
242
+ case 3: return [2];
243
+ }
244
+ });
245
+ });
246
+ };
223
247
  return class_1;
224
248
  }(ModelClass_1.BaseModelClass));
@@ -1,3 +1,4 @@
1
+ import { CommandSchedule } from '../gatewayCommands/models';
1
2
  import { Base, Filter, Filters, Pagination } from '../models';
2
3
  export interface FileLocation {
3
4
  name: string;
@@ -20,3 +21,10 @@ export interface PaginatedSoftwareUpdates {
20
21
  softwareUpdates: SoftwareUpdate[];
21
22
  pagination: Pagination;
22
23
  }
24
+ export declare type IssueSoftwareUpdateCommandType = 'software_update';
25
+ export interface IssueSoftwareUpdateInput {
26
+ ids: Array<string>;
27
+ software_update_id: string;
28
+ command_type: IssueSoftwareUpdateCommandType;
29
+ schedule?: CommandSchedule;
30
+ }
@@ -143,22 +143,104 @@ exports.TestIntegration2 = {
143
143
  from: 'test_from',
144
144
  };
145
145
  exports.NewIntegrationName = 'EIQSDK Integration Test Twilio';
146
- exports.EmptyIngestor = __assign(__assign({}, baseModel), { name: '', type: 'cloud', translator_id: '', handler_type: 'fixed', listener_type: 'cloud' });
146
+ exports.EmptyIngestor = __assign(__assign({}, baseModel), { company_id: '', name: '', type: 'edge', listener_type: 'shell_polling', handler_type: 'fixed', translator_id: '', listener: {
147
+ version: '1',
148
+ params: {
149
+ address: '',
150
+ },
151
+ filters: [
152
+ {
153
+ interface: '',
154
+ member: '',
155
+ path: '',
156
+ },
157
+ ],
158
+ device_type_mapping: [
159
+ {
160
+ device_type_id: '',
161
+ key: '',
162
+ value: '',
163
+ },
164
+ ],
165
+ }, handler: {
166
+ routes: [
167
+ {
168
+ method: 'get',
169
+ path: '',
170
+ },
171
+ ],
172
+ } });
147
173
  exports.TestIngestor = {
148
174
  company_id: parentCompanyId,
149
175
  name: 'EIQSDK Ingestor Test',
150
- handler_type: 'passthrough',
176
+ type: 'cloud',
151
177
  listener_type: 'cloud',
178
+ handler_type: 'passthrough',
152
179
  translator_id: '6091323844952b0001bf9b33',
153
- type: 'cloud',
180
+ listener: {
181
+ version: '1',
182
+ params: {
183
+ address: '',
184
+ },
185
+ filters: [
186
+ {
187
+ interface: '',
188
+ member: '',
189
+ path: '',
190
+ },
191
+ ],
192
+ device_type_mapping: [
193
+ {
194
+ device_type_id: '',
195
+ key: '',
196
+ value: '',
197
+ },
198
+ ],
199
+ },
200
+ handler: {
201
+ routes: [
202
+ {
203
+ method: 'get',
204
+ path: '',
205
+ },
206
+ ],
207
+ },
154
208
  };
155
209
  exports.TestIngestor2 = {
156
210
  company_id: parentCompanyId,
157
211
  name: 'EIQSDK Ingestor Test 2',
158
- handler_type: 'fixed',
212
+ type: 'edge',
159
213
  listener_type: 'shell_polling',
214
+ handler_type: 'fixed',
160
215
  translator_id: '618bcb593b04d60001358801',
161
- type: 'edge',
216
+ listener: {
217
+ version: '1',
218
+ params: {
219
+ address: '',
220
+ },
221
+ filters: [
222
+ {
223
+ interface: '',
224
+ member: '',
225
+ path: '',
226
+ },
227
+ ],
228
+ device_type_mapping: [
229
+ {
230
+ device_type_id: '',
231
+ key: '',
232
+ value: '',
233
+ },
234
+ ],
235
+ },
236
+ handler: {
237
+ routes: [
238
+ {
239
+ method: 'get',
240
+ path: '',
241
+ },
242
+ ],
243
+ },
162
244
  };
163
245
  exports.NewTestIngestorName = 'EIQSDK Ingestor Test updated';
164
246
  exports.EmptyPollableAttribute = __assign(__assign({}, baseModel), { name: '', type: 'snmp_mib', attributes: [], defaults: {}, interval: 16 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgeiq/edgeiq-api-js",
3
- "version": "1.2.16",
3
+ "version": "1.3.2",
4
4
  "author": "EdgeIQ",
5
5
  "license": "ISC",
6
6
  "description": "This project presents EdgeIQ API SDK.",