@edgeiq/edgeiq-api-js 1.4.6 → 1.4.8
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/devices/index.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ interface DevicesInterface extends BaseModelInterface<Device, DeviceInput, Devic
|
|
|
28
28
|
bulkExecuteCommand(ids: string[], command: Command, generateChildCommandExecutions?: boolean): Promise<BulkActionResponse>;
|
|
29
29
|
getFiles(id: string): Promise<EIQFile[]>;
|
|
30
30
|
getCommandExecutions(id: string, filters: CommandExecutionsFilters, pagination: PaginationFilter): Promise<PaginatedCommandExecutions>;
|
|
31
|
+
startRemoteTerminal(id: string, executable?: string): Promise<string>;
|
|
32
|
+
stopRemoteTerminal(id: string): Promise<string>;
|
|
31
33
|
}
|
|
32
34
|
export declare const Devices: DevicesInterface;
|
|
33
35
|
export {};
|
package/dist/devices/index.js
CHANGED
|
@@ -754,5 +754,55 @@ exports.Devices = (function (_super) {
|
|
|
754
754
|
});
|
|
755
755
|
});
|
|
756
756
|
};
|
|
757
|
+
class_1.startRemoteTerminal = function (id, executable) {
|
|
758
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
759
|
+
var axios, error_27;
|
|
760
|
+
return __generator(this, function (_a) {
|
|
761
|
+
switch (_a.label) {
|
|
762
|
+
case 0:
|
|
763
|
+
_a.trys.push([0, 2, , 3]);
|
|
764
|
+
this.logAction("Start remote terminal with device: " + id);
|
|
765
|
+
axios = __1.EdgeIQAPI.getAxios();
|
|
766
|
+
return [4, axios.post(constants_1.Endpoints.device + "/" + id + "/start_remote_terminal", {
|
|
767
|
+
executable: executable !== null && executable !== void 0 ? executable : 'sh',
|
|
768
|
+
})];
|
|
769
|
+
case 1:
|
|
770
|
+
_a.sent();
|
|
771
|
+
return [2, "Remote terminal started for device: " + id];
|
|
772
|
+
case 2:
|
|
773
|
+
error_27 = _a.sent();
|
|
774
|
+
if ((0, helpers_1.isApiError)(error_27)) {
|
|
775
|
+
throw error_27;
|
|
776
|
+
}
|
|
777
|
+
throw error_27;
|
|
778
|
+
case 3: return [2];
|
|
779
|
+
}
|
|
780
|
+
});
|
|
781
|
+
});
|
|
782
|
+
};
|
|
783
|
+
class_1.stopRemoteTerminal = function (id) {
|
|
784
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
785
|
+
var axios, error_28;
|
|
786
|
+
return __generator(this, function (_a) {
|
|
787
|
+
switch (_a.label) {
|
|
788
|
+
case 0:
|
|
789
|
+
_a.trys.push([0, 2, , 3]);
|
|
790
|
+
this.logAction("Stops remote terminal with device: " + id);
|
|
791
|
+
axios = __1.EdgeIQAPI.getAxios();
|
|
792
|
+
return [4, axios.post(constants_1.Endpoints.device + "/" + id + "/stop_remote_terminal")];
|
|
793
|
+
case 1:
|
|
794
|
+
_a.sent();
|
|
795
|
+
return [2, "Remote terminal stoped for device: " + id];
|
|
796
|
+
case 2:
|
|
797
|
+
error_28 = _a.sent();
|
|
798
|
+
if ((0, helpers_1.isApiError)(error_28)) {
|
|
799
|
+
throw error_28;
|
|
800
|
+
}
|
|
801
|
+
throw error_28;
|
|
802
|
+
case 3: return [2];
|
|
803
|
+
}
|
|
804
|
+
});
|
|
805
|
+
});
|
|
806
|
+
};
|
|
757
807
|
return class_1;
|
|
758
808
|
}(ModelClass_1.BaseModelClass));
|
|
@@ -8,7 +8,7 @@ interface SoftwareUpdatesInterface extends BaseModelInterface<SoftwareUpdate, So
|
|
|
8
8
|
assignToDeviceType(softwareUpdateId: string, deviceTypeId: string): Promise<string>;
|
|
9
9
|
removeFromDevice(softwareUpdateId: string, deviceId: string): Promise<string>;
|
|
10
10
|
removeFromDeviceType(softwareUpdateId: string, deviceTypeId: string): Promise<string>;
|
|
11
|
-
bulkSoftwareUpdate(payload: IssueSoftwareUpdateInput): Promise<BulkActionResponse>;
|
|
11
|
+
bulkSoftwareUpdate(payload: IssueSoftwareUpdateInput, generateChildCommandExecutions?: boolean): Promise<BulkActionResponse>;
|
|
12
12
|
uploadFile(id: string, file: File[]): Promise<FileLocation[]>;
|
|
13
13
|
}
|
|
14
14
|
export declare const SoftwareUpdates: SoftwareUpdatesInterface;
|
|
@@ -14,6 +14,17 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
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
|
+
};
|
|
17
28
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
29
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
30
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -316,7 +327,7 @@ exports.SoftwareUpdates = (function (_super) {
|
|
|
316
327
|
});
|
|
317
328
|
});
|
|
318
329
|
};
|
|
319
|
-
class_1.bulkSoftwareUpdate = function (payload) {
|
|
330
|
+
class_1.bulkSoftwareUpdate = function (payload, generateChildCommandExecutions) {
|
|
320
331
|
return __awaiter(this, void 0, void 0, function () {
|
|
321
332
|
var axios, result, error_11;
|
|
322
333
|
return __generator(this, function (_a) {
|
|
@@ -325,7 +336,7 @@ exports.SoftwareUpdates = (function (_super) {
|
|
|
325
336
|
_a.trys.push([0, 2, , 3]);
|
|
326
337
|
this.logAction("Issuing software updates with payload " + payload);
|
|
327
338
|
axios = __1.EdgeIQAPI.getAxios();
|
|
328
|
-
return [4, axios.post(constants_1.Endpoints.device + "/bulk/software_update", payload)];
|
|
339
|
+
return [4, axios.post(constants_1.Endpoints.device + "/bulk/software_update", __assign(__assign({}, payload), { generate_child_command_executions: generateChildCommandExecutions !== null && generateChildCommandExecutions !== void 0 ? generateChildCommandExecutions : false }))];
|
|
329
340
|
case 1:
|
|
330
341
|
result = _a.sent();
|
|
331
342
|
return [2, result === null || result === void 0 ? void 0 : result.data];
|