@edgeiq/edgeiq-api-js 1.0.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/README.md +74 -0
- package/dist/__tests__/auth.test.d.ts +1 -0
- package/dist/__tests__/auth.test.js +110 -0
- package/dist/__tests__/companies.test.d.ts +1 -0
- package/dist/__tests__/companies.test.js +196 -0
- package/dist/__tests__/deviceTypes.test.d.ts +1 -0
- package/dist/__tests__/deviceTypes.test.js +172 -0
- package/dist/__tests__/devices.test.d.ts +1 -0
- package/dist/__tests__/devices.test.js +204 -0
- package/dist/__tests__/ingestors.test.d.ts +1 -0
- package/dist/__tests__/ingestors.test.js +172 -0
- package/dist/__tests__/integrations.test.d.ts +1 -0
- package/dist/__tests__/integrations.test.js +192 -0
- package/dist/__tests__/pollableAttributes.test.d.ts +1 -0
- package/dist/__tests__/pollableAttributes.test.js +172 -0
- package/dist/__tests__/rules.test.d.ts +1 -0
- package/dist/__tests__/rules.test.js +172 -0
- package/dist/__tests__/testConstants.d.ts +7 -0
- package/dist/__tests__/testConstants.js +14 -0
- package/dist/__tests__/translators.test.d.ts +1 -0
- package/dist/__tests__/translators.test.js +172 -0
- package/dist/__tests__/users.test.d.ts +1 -0
- package/dist/__tests__/users.test.js +208 -0
- package/dist/auth/index.d.ts +6 -0
- package/dist/auth/index.js +95 -0
- package/dist/bulkResponses/index.d.ts +8 -0
- package/dist/bulkResponses/index.js +124 -0
- package/dist/bulkResponses/models.d.ts +43 -0
- package/dist/bulkResponses/models.js +2 -0
- package/dist/commands/index.d.ts +9 -0
- package/dist/commands/index.js +224 -0
- package/dist/commands/models.d.ts +28 -0
- package/dist/commands/models.js +2 -0
- package/dist/companies/index.d.ts +7 -0
- package/dist/companies/index.js +198 -0
- package/dist/companies/models.d.ts +94 -0
- package/dist/companies/models.js +2 -0
- package/dist/constants.d.ts +122 -0
- package/dist/constants.js +138 -0
- package/dist/core/ModelClass.d.ts +13 -0
- package/dist/core/ModelClass.js +19 -0
- package/dist/core/handleResponseError.d.ts +2 -0
- package/dist/core/handleResponseError.js +162 -0
- package/dist/core/index.d.ts +19 -0
- package/dist/core/index.js +63 -0
- package/dist/deviceConfigs/index.d.ts +9 -0
- package/dist/deviceConfigs/index.js +224 -0
- package/dist/deviceConfigs/models.d.ts +38 -0
- package/dist/deviceConfigs/models.js +2 -0
- package/dist/deviceLocationObservations/index.d.ts +5 -0
- package/dist/deviceLocationObservations/index.js +189 -0
- package/dist/deviceLocationObservations/models.d.ts +26 -0
- package/dist/deviceLocationObservations/models.js +2 -0
- package/dist/deviceTemplates/index.d.ts +9 -0
- package/dist/deviceTemplates/index.js +226 -0
- package/dist/deviceTemplates/models.d.ts +36 -0
- package/dist/deviceTemplates/models.js +2 -0
- package/dist/deviceTransferRequests/index.d.ts +7 -0
- package/dist/deviceTransferRequests/index.js +198 -0
- package/dist/deviceTransferRequests/models.d.ts +26 -0
- package/dist/deviceTransferRequests/models.js +2 -0
- package/dist/deviceTypes/index.d.ts +19 -0
- package/dist/deviceTypes/index.js +440 -0
- package/dist/deviceTypes/models.d.ts +104 -0
- package/dist/deviceTypes/models.js +2 -0
- package/dist/devices/index.d.ts +18 -0
- package/dist/devices/index.js +431 -0
- package/dist/devices/models.d.ts +113 -0
- package/dist/devices/models.js +2 -0
- package/dist/downstreamSystems/index.d.ts +7 -0
- package/dist/downstreamSystems/index.js +198 -0
- package/dist/downstreamSystems/models.d.ts +17 -0
- package/dist/downstreamSystems/models.js +2 -0
- package/dist/escrowDevices/index.d.ts +9 -0
- package/dist/escrowDevices/index.js +224 -0
- package/dist/escrowDevices/models.d.ts +20 -0
- package/dist/escrowDevices/models.js +2 -0
- package/dist/example/index.d.ts +1 -0
- package/dist/example/index.js +5 -0
- package/dist/filtersParser.d.ts +5 -0
- package/dist/filtersParser.js +43 -0
- package/dist/gatewayCommands/index.d.ts +10 -0
- package/dist/gatewayCommands/index.js +261 -0
- package/dist/gatewayCommands/models.d.ts +41 -0
- package/dist/gatewayCommands/models.js +2 -0
- package/dist/helpers.d.ts +3 -0
- package/dist/helpers.js +11 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +92 -0
- package/dist/ingestors/index.d.ts +9 -0
- package/dist/ingestors/index.js +224 -0
- package/dist/ingestors/models.d.ts +37 -0
- package/dist/ingestors/models.js +2 -0
- package/dist/integrations/index.d.ts +9 -0
- package/dist/integrations/index.js +306 -0
- package/dist/integrations/models.d.ts +61 -0
- package/dist/integrations/models.js +2 -0
- package/dist/models/index.d.ts +1893 -0
- package/dist/models/index.js +2 -0
- package/dist/models.d.ts +66 -0
- package/dist/models.js +2 -0
- package/dist/pollableAttributes/index.d.ts +7 -0
- package/dist/pollableAttributes/index.js +198 -0
- package/dist/pollableAttributes/models.d.ts +28 -0
- package/dist/pollableAttributes/models.js +2 -0
- package/dist/regions/index.d.ts +5 -0
- package/dist/regions/index.js +173 -0
- package/dist/regions/models.d.ts +17 -0
- package/dist/regions/models.js +2 -0
- package/dist/reports/index.d.ts +8 -0
- package/dist/reports/index.js +199 -0
- package/dist/reports/models.d.ts +25 -0
- package/dist/reports/models.js +2 -0
- package/dist/rules/index.d.ts +9 -0
- package/dist/rules/index.js +224 -0
- package/dist/rules/models.d.ts +108 -0
- package/dist/rules/models.js +2 -0
- package/dist/secrets/index.d.ts +5 -0
- package/dist/secrets/index.js +173 -0
- package/dist/secrets/models.d.ts +16 -0
- package/dist/secrets/models.js +2 -0
- package/dist/softwareUpdates/index.d.ts +9 -0
- package/dist/softwareUpdates/index.js +224 -0
- package/dist/softwareUpdates/models.d.ts +22 -0
- package/dist/softwareUpdates/models.js +2 -0
- package/dist/systemCommandJobs/index.d.ts +5 -0
- package/dist/systemCommandJobs/index.js +173 -0
- package/dist/systemCommandJobs/models.d.ts +32 -0
- package/dist/systemCommandJobs/models.js +2 -0
- package/dist/systemCommands/index.d.ts +7 -0
- package/dist/systemCommands/index.js +198 -0
- package/dist/systemCommands/models.d.ts +32 -0
- package/dist/systemCommands/models.js +2 -0
- package/dist/testConstants.d.ts +42 -0
- package/dist/testConstants.js +214 -0
- package/dist/translators/index.d.ts +9 -0
- package/dist/translators/index.js +224 -0
- package/dist/translators/models.d.ts +21 -0
- package/dist/translators/models.js +2 -0
- package/dist/userTypes/index.d.ts +7 -0
- package/dist/userTypes/index.js +198 -0
- package/dist/userTypes/models.d.ts +79 -0
- package/dist/userTypes/models.js +2 -0
- package/dist/users/index.d.ts +10 -0
- package/dist/users/index.js +252 -0
- package/dist/users/models.d.ts +41 -0
- package/dist/users/models.js +2 -0
- package/package.json +56 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
|
+
function step(op) {
|
|
42
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
43
|
+
while (_) try {
|
|
44
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
45
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
46
|
+
switch (op[0]) {
|
|
47
|
+
case 0: case 1: t = op; break;
|
|
48
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
49
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
50
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
51
|
+
default:
|
|
52
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
53
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
54
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
55
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
56
|
+
if (t[2]) _.ops.pop();
|
|
57
|
+
_.trys.pop(); continue;
|
|
58
|
+
}
|
|
59
|
+
op = body.call(thisArg, _);
|
|
60
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
61
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
+
exports.GatewayCommands = void 0;
|
|
66
|
+
var __1 = require("..");
|
|
67
|
+
var constants_1 = require("../constants");
|
|
68
|
+
var ModelClass_1 = require("../core/ModelClass");
|
|
69
|
+
var filtersParser_1 = require("../filtersParser");
|
|
70
|
+
var helpers_1 = require("../helpers");
|
|
71
|
+
exports.GatewayCommands = (function (_super) {
|
|
72
|
+
__extends(class_1, _super);
|
|
73
|
+
function class_1() {
|
|
74
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
75
|
+
}
|
|
76
|
+
class_1.create = function (gatewayCommand) {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
+
var axios, data, result, error_1;
|
|
79
|
+
return __generator(this, function (_a) {
|
|
80
|
+
switch (_a.label) {
|
|
81
|
+
case 0:
|
|
82
|
+
_a.trys.push([0, 2, , 3]);
|
|
83
|
+
this.logAction("Creating gateway command of type: " + gatewayCommand.command_type);
|
|
84
|
+
axios = __1.EdgeIQAPI.getAxios();
|
|
85
|
+
data = JSON.stringify(gatewayCommand);
|
|
86
|
+
return [4, axios.post(constants_1.Endpoints.gatewayCommand, data)];
|
|
87
|
+
case 1:
|
|
88
|
+
result = _a.sent();
|
|
89
|
+
return [2, result === null || result === void 0 ? void 0 : result.data];
|
|
90
|
+
case 2:
|
|
91
|
+
error_1 = _a.sent();
|
|
92
|
+
if ((0, helpers_1.isApiError)(error_1)) {
|
|
93
|
+
throw error_1;
|
|
94
|
+
}
|
|
95
|
+
throw error_1;
|
|
96
|
+
case 3: return [2];
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
class_1.bulkCreate = function (ids, gatewayCommand) {
|
|
102
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
103
|
+
var axios, result, error_2;
|
|
104
|
+
return __generator(this, function (_a) {
|
|
105
|
+
switch (_a.label) {
|
|
106
|
+
case 0:
|
|
107
|
+
_a.trys.push([0, 2, , 3]);
|
|
108
|
+
this.logAction("Creating " + ids.length + " gateway commands with type " + gatewayCommand.command_type);
|
|
109
|
+
axios = __1.EdgeIQAPI.getAxios();
|
|
110
|
+
return [4, axios.post(constants_1.Endpoints.device + "/bulk", {
|
|
111
|
+
data: __assign({ ids: ids }, gatewayCommand),
|
|
112
|
+
})];
|
|
113
|
+
case 1:
|
|
114
|
+
result = _a.sent();
|
|
115
|
+
return [2, result === null || result === void 0 ? void 0 : result.data];
|
|
116
|
+
case 2:
|
|
117
|
+
error_2 = _a.sent();
|
|
118
|
+
if ((0, helpers_1.isApiError)(error_2)) {
|
|
119
|
+
throw error_2;
|
|
120
|
+
}
|
|
121
|
+
throw error_2;
|
|
122
|
+
case 3: return [2];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
class_1.update = function (gatewayCommand) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
129
|
+
var axios, data, result, error_3;
|
|
130
|
+
return __generator(this, function (_a) {
|
|
131
|
+
switch (_a.label) {
|
|
132
|
+
case 0:
|
|
133
|
+
_a.trys.push([0, 2, , 3]);
|
|
134
|
+
this.logAction("Updating gateway command with ID: " + gatewayCommand._id);
|
|
135
|
+
axios = __1.EdgeIQAPI.getAxios();
|
|
136
|
+
data = JSON.stringify(gatewayCommand);
|
|
137
|
+
return [4, axios.put(constants_1.Endpoints.gatewayCommand + "/" + gatewayCommand._id, data)];
|
|
138
|
+
case 1:
|
|
139
|
+
result = _a.sent();
|
|
140
|
+
return [2, result === null || result === void 0 ? void 0 : result.data];
|
|
141
|
+
case 2:
|
|
142
|
+
error_3 = _a.sent();
|
|
143
|
+
if ((0, helpers_1.isApiError)(error_3)) {
|
|
144
|
+
throw error_3;
|
|
145
|
+
}
|
|
146
|
+
throw error_3;
|
|
147
|
+
case 3: return [2];
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
class_1.list = function (filters, pagination) {
|
|
153
|
+
var _a, _b, _c, _d;
|
|
154
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
155
|
+
var axios, result, error_4;
|
|
156
|
+
return __generator(this, function (_e) {
|
|
157
|
+
switch (_e.label) {
|
|
158
|
+
case 0:
|
|
159
|
+
_e.trys.push([0, 2, , 3]);
|
|
160
|
+
this.logAction("Listing gateway commands with following filters: " + (filters !== null && filters !== void 0 ? filters : '{}') + ".\n And pagination " + (pagination !== null && pagination !== void 0 ? pagination : '{}'));
|
|
161
|
+
axios = __1.EdgeIQAPI.getAxios();
|
|
162
|
+
return [4, axios.get(constants_1.Endpoints.gatewayCommand, {
|
|
163
|
+
params: (0, filtersParser_1.parseFilters)(filters, pagination),
|
|
164
|
+
})];
|
|
165
|
+
case 1:
|
|
166
|
+
result = _e.sent();
|
|
167
|
+
return [2, {
|
|
168
|
+
gatewayCommands: (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.resources,
|
|
169
|
+
pagination: {
|
|
170
|
+
page: (_b = result === null || result === void 0 ? void 0 : result.data) === null || _b === void 0 ? void 0 : _b.page,
|
|
171
|
+
itemsPerPage: (_c = result === null || result === void 0 ? void 0 : result.data) === null || _c === void 0 ? void 0 : _c.per_page,
|
|
172
|
+
total: (_d = result === null || result === void 0 ? void 0 : result.data) === null || _d === void 0 ? void 0 : _d.total,
|
|
173
|
+
},
|
|
174
|
+
}];
|
|
175
|
+
case 2:
|
|
176
|
+
error_4 = _e.sent();
|
|
177
|
+
if ((0, helpers_1.isApiError)(error_4)) {
|
|
178
|
+
throw error_4;
|
|
179
|
+
}
|
|
180
|
+
throw error_4;
|
|
181
|
+
case 3: return [2];
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
class_1.getOneById = function (id) {
|
|
187
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
188
|
+
var axios, result, error_5;
|
|
189
|
+
return __generator(this, function (_a) {
|
|
190
|
+
switch (_a.label) {
|
|
191
|
+
case 0:
|
|
192
|
+
_a.trys.push([0, 2, , 3]);
|
|
193
|
+
this.logAction("Getting gateway command with id: " + id);
|
|
194
|
+
axios = __1.EdgeIQAPI.getAxios();
|
|
195
|
+
return [4, axios.get(constants_1.Endpoints.gatewayCommand + "/" + id)];
|
|
196
|
+
case 1:
|
|
197
|
+
result = _a.sent();
|
|
198
|
+
return [2, result === null || result === void 0 ? void 0 : result.data];
|
|
199
|
+
case 2:
|
|
200
|
+
error_5 = _a.sent();
|
|
201
|
+
if ((0, helpers_1.isApiError)(error_5)) {
|
|
202
|
+
throw error_5;
|
|
203
|
+
}
|
|
204
|
+
throw error_5;
|
|
205
|
+
case 3: return [2];
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
class_1.delete = function (id) {
|
|
211
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
212
|
+
var axios, error_6;
|
|
213
|
+
return __generator(this, function (_a) {
|
|
214
|
+
switch (_a.label) {
|
|
215
|
+
case 0:
|
|
216
|
+
_a.trys.push([0, 2, , 3]);
|
|
217
|
+
this.logAction("Deleting gatewayCommand with id " + id);
|
|
218
|
+
axios = __1.EdgeIQAPI.getAxios();
|
|
219
|
+
return [4, axios.delete(constants_1.Endpoints.gatewayCommand + "/" + id)];
|
|
220
|
+
case 1:
|
|
221
|
+
_a.sent();
|
|
222
|
+
return [2, (0, helpers_1.getReturnDeleteMessage)('gatewayCommand')];
|
|
223
|
+
case 2:
|
|
224
|
+
error_6 = _a.sent();
|
|
225
|
+
if ((0, helpers_1.isApiError)(error_6)) {
|
|
226
|
+
throw error_6;
|
|
227
|
+
}
|
|
228
|
+
throw error_6;
|
|
229
|
+
case 3: return [2];
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
};
|
|
234
|
+
class_1.deleteMultiple = function (ids) {
|
|
235
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
236
|
+
var axios, result, error_7;
|
|
237
|
+
return __generator(this, function (_a) {
|
|
238
|
+
switch (_a.label) {
|
|
239
|
+
case 0:
|
|
240
|
+
_a.trys.push([0, 2, , 3]);
|
|
241
|
+
this.logAction("Deleting gateway commands with ids " + ids.join(', '));
|
|
242
|
+
axios = __1.EdgeIQAPI.getAxios();
|
|
243
|
+
return [4, axios.delete(constants_1.Endpoints.gatewayCommand + "/bulk", {
|
|
244
|
+
data: { ids: ids },
|
|
245
|
+
})];
|
|
246
|
+
case 1:
|
|
247
|
+
result = _a.sent();
|
|
248
|
+
return [2, result === null || result === void 0 ? void 0 : result.data];
|
|
249
|
+
case 2:
|
|
250
|
+
error_7 = _a.sent();
|
|
251
|
+
if ((0, helpers_1.isApiError)(error_7)) {
|
|
252
|
+
throw error_7;
|
|
253
|
+
}
|
|
254
|
+
throw error_7;
|
|
255
|
+
case 3: return [2];
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
};
|
|
260
|
+
return class_1;
|
|
261
|
+
}(ModelClass_1.BaseModelClass));
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Base, Filter, Filters, Pagination } from '../models';
|
|
2
|
+
export declare type GatewayCommandType = 'send_config' | 'data_restriction' | 'backup' | 'restore_backup' | 'log_level' | 'log_upload' | 'reboot' | 'heartbeat' | 'software_update' | 'status';
|
|
3
|
+
export interface CommandSchedule {
|
|
4
|
+
start_datetime: string;
|
|
5
|
+
end_datetime: string;
|
|
6
|
+
retry_interval?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface GatewayCommandStatus {
|
|
9
|
+
status: string;
|
|
10
|
+
status_message?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface GatewayCommandInput {
|
|
13
|
+
command_type: GatewayCommandType;
|
|
14
|
+
payload: {
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
schedule?: CommandSchedule;
|
|
18
|
+
timeout?: number;
|
|
19
|
+
statuses: {
|
|
20
|
+
[key: string]: GatewayCommandStatus;
|
|
21
|
+
};
|
|
22
|
+
device_config_id?: string;
|
|
23
|
+
device_id?: string;
|
|
24
|
+
device_unique_id?: string;
|
|
25
|
+
device_type_id?: string;
|
|
26
|
+
software_update_id?: string;
|
|
27
|
+
attached_device_ids: string[];
|
|
28
|
+
attached_device_unique_ids: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface GatewayCommand extends GatewayCommandInput, Base {
|
|
31
|
+
}
|
|
32
|
+
export interface GatewayCommandsFilters extends Filters {
|
|
33
|
+
command_type?: Filter;
|
|
34
|
+
device_id?: Filter;
|
|
35
|
+
device_unique_id?: Filter;
|
|
36
|
+
device_type_id?: Filter;
|
|
37
|
+
}
|
|
38
|
+
export interface PaginatedGatewayCommands {
|
|
39
|
+
gatewayCommands: GatewayCommand[];
|
|
40
|
+
pagination: Pagination;
|
|
41
|
+
}
|
package/dist/helpers.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isApiError = exports.getReturnDeleteMessage = void 0;
|
|
4
|
+
var getReturnDeleteMessage = function (model) {
|
|
5
|
+
return "The " + model + " has been deleted correctly.";
|
|
6
|
+
};
|
|
7
|
+
exports.getReturnDeleteMessage = getReturnDeleteMessage;
|
|
8
|
+
var isApiError = function (error) {
|
|
9
|
+
return error.message !== undefined;
|
|
10
|
+
};
|
|
11
|
+
exports.isApiError = isApiError;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export { EdgeIQAPI, EdgeIQAPIOptions } from './core';
|
|
2
|
+
export { Authentication } from './auth';
|
|
3
|
+
export { BulkResponses } from './bulkResponses';
|
|
4
|
+
export { Commands } from './commands';
|
|
5
|
+
export { Companies } from './companies';
|
|
6
|
+
export { DeviceConfigs } from './deviceConfigs';
|
|
7
|
+
export { DeviceLocationObservations } from './deviceLocationObservations';
|
|
8
|
+
export { Devices } from './devices';
|
|
9
|
+
export { DeviceTemplates } from './deviceTemplates';
|
|
10
|
+
export { DeviceTransferRequests } from './deviceTransferRequests';
|
|
11
|
+
export { DeviceTypes } from './deviceTypes';
|
|
12
|
+
export { DownstreamSystems } from './downstreamSystems';
|
|
13
|
+
export { EscrowDevices } from './escrowDevices';
|
|
14
|
+
export { GatewayCommands } from './gatewayCommands';
|
|
15
|
+
export { Ingestors } from './ingestors';
|
|
16
|
+
export { Integrations } from './integrations';
|
|
17
|
+
export { PollableAttributes } from './pollableAttributes';
|
|
18
|
+
export { Regions } from './regions';
|
|
19
|
+
export { Reports } from './reports';
|
|
20
|
+
export { Rules } from './rules';
|
|
21
|
+
export { Secrets } from './secrets';
|
|
22
|
+
export { SoftwareUpdates } from './softwareUpdates';
|
|
23
|
+
export { SystemCommands } from './systemCommands';
|
|
24
|
+
export { SystemCommandJobs } from './systemCommandJobs';
|
|
25
|
+
export { Translators } from './translators';
|
|
26
|
+
export { Users } from './users';
|
|
27
|
+
export { UserTypes } from './userTypes';
|
|
28
|
+
export * from './bulkResponses/models';
|
|
29
|
+
export * from './commands/models';
|
|
30
|
+
export * from './companies/models';
|
|
31
|
+
export * from './deviceConfigs/models';
|
|
32
|
+
export * from './deviceLocationObservations/models';
|
|
33
|
+
export * from './devices/models';
|
|
34
|
+
export * from './deviceTemplates/models';
|
|
35
|
+
export * from './deviceTransferRequests/models';
|
|
36
|
+
export * from './deviceTypes/models';
|
|
37
|
+
export * from './downstreamSystems/models';
|
|
38
|
+
export * from './escrowDevices/models';
|
|
39
|
+
export * from './gatewayCommands/models';
|
|
40
|
+
export * from './ingestors/models';
|
|
41
|
+
export * from './integrations/models';
|
|
42
|
+
export * from './pollableAttributes/models';
|
|
43
|
+
export * from './reports/models';
|
|
44
|
+
export * from './regions/models';
|
|
45
|
+
export * from './rules/models';
|
|
46
|
+
export * from './secrets/models';
|
|
47
|
+
export * from './softwareUpdates/models';
|
|
48
|
+
export * from './systemCommands/models';
|
|
49
|
+
export * from './systemCommandJobs/models';
|
|
50
|
+
export * from './translators/models';
|
|
51
|
+
export * from './users/models';
|
|
52
|
+
export * from './userTypes/models';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.UserTypes = exports.Users = exports.Translators = exports.SystemCommandJobs = exports.SystemCommands = exports.SoftwareUpdates = exports.Secrets = exports.Rules = exports.Reports = exports.Regions = exports.PollableAttributes = exports.Integrations = exports.Ingestors = exports.GatewayCommands = exports.EscrowDevices = exports.DownstreamSystems = exports.DeviceTypes = exports.DeviceTransferRequests = exports.DeviceTemplates = exports.Devices = exports.DeviceLocationObservations = exports.DeviceConfigs = exports.Companies = exports.Commands = exports.BulkResponses = exports.Authentication = exports.EdgeIQAPI = void 0;
|
|
14
|
+
var core_1 = require("./core");
|
|
15
|
+
Object.defineProperty(exports, "EdgeIQAPI", { enumerable: true, get: function () { return core_1.EdgeIQAPI; } });
|
|
16
|
+
var auth_1 = require("./auth");
|
|
17
|
+
Object.defineProperty(exports, "Authentication", { enumerable: true, get: function () { return auth_1.Authentication; } });
|
|
18
|
+
var bulkResponses_1 = require("./bulkResponses");
|
|
19
|
+
Object.defineProperty(exports, "BulkResponses", { enumerable: true, get: function () { return bulkResponses_1.BulkResponses; } });
|
|
20
|
+
var commands_1 = require("./commands");
|
|
21
|
+
Object.defineProperty(exports, "Commands", { enumerable: true, get: function () { return commands_1.Commands; } });
|
|
22
|
+
var companies_1 = require("./companies");
|
|
23
|
+
Object.defineProperty(exports, "Companies", { enumerable: true, get: function () { return companies_1.Companies; } });
|
|
24
|
+
var deviceConfigs_1 = require("./deviceConfigs");
|
|
25
|
+
Object.defineProperty(exports, "DeviceConfigs", { enumerable: true, get: function () { return deviceConfigs_1.DeviceConfigs; } });
|
|
26
|
+
var deviceLocationObservations_1 = require("./deviceLocationObservations");
|
|
27
|
+
Object.defineProperty(exports, "DeviceLocationObservations", { enumerable: true, get: function () { return deviceLocationObservations_1.DeviceLocationObservations; } });
|
|
28
|
+
var devices_1 = require("./devices");
|
|
29
|
+
Object.defineProperty(exports, "Devices", { enumerable: true, get: function () { return devices_1.Devices; } });
|
|
30
|
+
var deviceTemplates_1 = require("./deviceTemplates");
|
|
31
|
+
Object.defineProperty(exports, "DeviceTemplates", { enumerable: true, get: function () { return deviceTemplates_1.DeviceTemplates; } });
|
|
32
|
+
var deviceTransferRequests_1 = require("./deviceTransferRequests");
|
|
33
|
+
Object.defineProperty(exports, "DeviceTransferRequests", { enumerable: true, get: function () { return deviceTransferRequests_1.DeviceTransferRequests; } });
|
|
34
|
+
var deviceTypes_1 = require("./deviceTypes");
|
|
35
|
+
Object.defineProperty(exports, "DeviceTypes", { enumerable: true, get: function () { return deviceTypes_1.DeviceTypes; } });
|
|
36
|
+
var downstreamSystems_1 = require("./downstreamSystems");
|
|
37
|
+
Object.defineProperty(exports, "DownstreamSystems", { enumerable: true, get: function () { return downstreamSystems_1.DownstreamSystems; } });
|
|
38
|
+
var escrowDevices_1 = require("./escrowDevices");
|
|
39
|
+
Object.defineProperty(exports, "EscrowDevices", { enumerable: true, get: function () { return escrowDevices_1.EscrowDevices; } });
|
|
40
|
+
var gatewayCommands_1 = require("./gatewayCommands");
|
|
41
|
+
Object.defineProperty(exports, "GatewayCommands", { enumerable: true, get: function () { return gatewayCommands_1.GatewayCommands; } });
|
|
42
|
+
var ingestors_1 = require("./ingestors");
|
|
43
|
+
Object.defineProperty(exports, "Ingestors", { enumerable: true, get: function () { return ingestors_1.Ingestors; } });
|
|
44
|
+
var integrations_1 = require("./integrations");
|
|
45
|
+
Object.defineProperty(exports, "Integrations", { enumerable: true, get: function () { return integrations_1.Integrations; } });
|
|
46
|
+
var pollableAttributes_1 = require("./pollableAttributes");
|
|
47
|
+
Object.defineProperty(exports, "PollableAttributes", { enumerable: true, get: function () { return pollableAttributes_1.PollableAttributes; } });
|
|
48
|
+
var regions_1 = require("./regions");
|
|
49
|
+
Object.defineProperty(exports, "Regions", { enumerable: true, get: function () { return regions_1.Regions; } });
|
|
50
|
+
var reports_1 = require("./reports");
|
|
51
|
+
Object.defineProperty(exports, "Reports", { enumerable: true, get: function () { return reports_1.Reports; } });
|
|
52
|
+
var rules_1 = require("./rules");
|
|
53
|
+
Object.defineProperty(exports, "Rules", { enumerable: true, get: function () { return rules_1.Rules; } });
|
|
54
|
+
var secrets_1 = require("./secrets");
|
|
55
|
+
Object.defineProperty(exports, "Secrets", { enumerable: true, get: function () { return secrets_1.Secrets; } });
|
|
56
|
+
var softwareUpdates_1 = require("./softwareUpdates");
|
|
57
|
+
Object.defineProperty(exports, "SoftwareUpdates", { enumerable: true, get: function () { return softwareUpdates_1.SoftwareUpdates; } });
|
|
58
|
+
var systemCommands_1 = require("./systemCommands");
|
|
59
|
+
Object.defineProperty(exports, "SystemCommands", { enumerable: true, get: function () { return systemCommands_1.SystemCommands; } });
|
|
60
|
+
var systemCommandJobs_1 = require("./systemCommandJobs");
|
|
61
|
+
Object.defineProperty(exports, "SystemCommandJobs", { enumerable: true, get: function () { return systemCommandJobs_1.SystemCommandJobs; } });
|
|
62
|
+
var translators_1 = require("./translators");
|
|
63
|
+
Object.defineProperty(exports, "Translators", { enumerable: true, get: function () { return translators_1.Translators; } });
|
|
64
|
+
var users_1 = require("./users");
|
|
65
|
+
Object.defineProperty(exports, "Users", { enumerable: true, get: function () { return users_1.Users; } });
|
|
66
|
+
var userTypes_1 = require("./userTypes");
|
|
67
|
+
Object.defineProperty(exports, "UserTypes", { enumerable: true, get: function () { return userTypes_1.UserTypes; } });
|
|
68
|
+
__exportStar(require("./bulkResponses/models"), exports);
|
|
69
|
+
__exportStar(require("./commands/models"), exports);
|
|
70
|
+
__exportStar(require("./companies/models"), exports);
|
|
71
|
+
__exportStar(require("./deviceConfigs/models"), exports);
|
|
72
|
+
__exportStar(require("./deviceLocationObservations/models"), exports);
|
|
73
|
+
__exportStar(require("./devices/models"), exports);
|
|
74
|
+
__exportStar(require("./deviceTemplates/models"), exports);
|
|
75
|
+
__exportStar(require("./deviceTransferRequests/models"), exports);
|
|
76
|
+
__exportStar(require("./deviceTypes/models"), exports);
|
|
77
|
+
__exportStar(require("./downstreamSystems/models"), exports);
|
|
78
|
+
__exportStar(require("./escrowDevices/models"), exports);
|
|
79
|
+
__exportStar(require("./gatewayCommands/models"), exports);
|
|
80
|
+
__exportStar(require("./ingestors/models"), exports);
|
|
81
|
+
__exportStar(require("./integrations/models"), exports);
|
|
82
|
+
__exportStar(require("./pollableAttributes/models"), exports);
|
|
83
|
+
__exportStar(require("./reports/models"), exports);
|
|
84
|
+
__exportStar(require("./regions/models"), exports);
|
|
85
|
+
__exportStar(require("./rules/models"), exports);
|
|
86
|
+
__exportStar(require("./secrets/models"), exports);
|
|
87
|
+
__exportStar(require("./softwareUpdates/models"), exports);
|
|
88
|
+
__exportStar(require("./systemCommands/models"), exports);
|
|
89
|
+
__exportStar(require("./systemCommandJobs/models"), exports);
|
|
90
|
+
__exportStar(require("./translators/models"), exports);
|
|
91
|
+
__exportStar(require("./users/models"), exports);
|
|
92
|
+
__exportStar(require("./userTypes/models"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseModelInterface } from '../core/ModelClass';
|
|
2
|
+
import { BulkActionResponse } from '../models';
|
|
3
|
+
import { Ingestor, IngestorInput, IngestorsFilters, PaginatedIngestors } from './models';
|
|
4
|
+
interface IngestorsInterface extends BaseModelInterface<Ingestor, IngestorInput, IngestorsFilters, PaginatedIngestors> {
|
|
5
|
+
update(ingestor: Ingestor): Promise<Ingestor>;
|
|
6
|
+
deleteMultiple(ids: string[]): Promise<BulkActionResponse>;
|
|
7
|
+
}
|
|
8
|
+
export declare const Ingestors: IngestorsInterface;
|
|
9
|
+
export {};
|