@edgeiq/edgeiq-api-js 1.2.16 → 1.3.0
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.
- package/dist/deviceTransferRequests/index.js +1 -3
- package/dist/devices/index.js +1 -1
- package/dist/ingestors/models.d.ts +66 -6
- package/dist/rules/models.d.ts +46 -1
- package/dist/softwareUpdates/index.d.ts +2 -1
- package/dist/softwareUpdates/index.js +24 -0
- package/dist/softwareUpdates/models.d.ts +8 -0
- package/package.json +1 -1
|
@@ -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];
|
package/dist/devices/index.js
CHANGED
|
@@ -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
|
-
|
|
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
|
};
|
package/dist/rules/models.d.ts
CHANGED
|
@@ -6,6 +6,35 @@ 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 = [
|
|
10
|
+
'count',
|
|
11
|
+
'min',
|
|
12
|
+
'max',
|
|
13
|
+
'avg',
|
|
14
|
+
'sum',
|
|
15
|
+
'convert_indexed_keys'
|
|
16
|
+
];
|
|
17
|
+
export declare type WhereConditionTypes = ['where', 'or_where'];
|
|
18
|
+
export declare type WhereConditionOperators = [
|
|
19
|
+
'equal',
|
|
20
|
+
'not_equal',
|
|
21
|
+
'greater_than',
|
|
22
|
+
'greater_than_equal',
|
|
23
|
+
'less_than',
|
|
24
|
+
'less_than_equal',
|
|
25
|
+
'in',
|
|
26
|
+
'not_in',
|
|
27
|
+
'starts_with',
|
|
28
|
+
'ends_with',
|
|
29
|
+
'contains',
|
|
30
|
+
'strict_contains',
|
|
31
|
+
'length_equals',
|
|
32
|
+
'length_not_equals',
|
|
33
|
+
'length_greater_than',
|
|
34
|
+
'length_greater_than_equal',
|
|
35
|
+
'length_less_than',
|
|
36
|
+
'length_less_than_equal'
|
|
37
|
+
];
|
|
9
38
|
export interface CredentialData {
|
|
10
39
|
type?: string;
|
|
11
40
|
value: string;
|
|
@@ -62,14 +91,30 @@ export interface RuleAction {
|
|
|
62
91
|
channels?: PRTGChannel[];
|
|
63
92
|
definition_id?: string;
|
|
64
93
|
}
|
|
94
|
+
export interface WhereCondition {
|
|
95
|
+
type?: WhereConditionTypes;
|
|
96
|
+
operator?: WhereConditionOperators;
|
|
97
|
+
property?: string;
|
|
98
|
+
value?: string | string[];
|
|
99
|
+
}
|
|
100
|
+
export interface DerivedValue {
|
|
101
|
+
name?: string;
|
|
102
|
+
type?: DerivedValuesTypes;
|
|
103
|
+
property?: string;
|
|
104
|
+
properties?: string[];
|
|
105
|
+
data_set?: string;
|
|
106
|
+
where_conditions?: WhereCondition[];
|
|
107
|
+
}
|
|
65
108
|
export interface RuleCondition {
|
|
66
109
|
type: RuleConditionType;
|
|
67
110
|
property?: string;
|
|
68
|
-
value?:
|
|
111
|
+
value?: string[];
|
|
69
112
|
value_type?: string;
|
|
70
113
|
rule_conditions?: (RuleCondition | undefined)[];
|
|
71
114
|
error_type?: DeviceErrorType;
|
|
72
115
|
location_transition_evaluator?: LocationTransitionEvaluator;
|
|
116
|
+
cold_start_trigger?: boolean;
|
|
117
|
+
derived_values?: DerivedValue[];
|
|
73
118
|
}
|
|
74
119
|
export interface LocationTransitionEvaluator {
|
|
75
120
|
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
|
+
}
|