@edgeiq/edgeiq-api-js 1.8.5 → 1.8.6
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.
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { PaginationFilter } from '../models';
|
|
2
|
-
import { CommandExecutionsFilters, PaginatedCommandExecutions } from './models';
|
|
2
|
+
import { CommandExecutionsFilters, CommandExecutionStatusFilters, PaginatedCommandExecutions, PaginatedCommandExecutionStatuses } from './models';
|
|
3
3
|
declare const CommandExecutions: {
|
|
4
4
|
list(filters?: CommandExecutionsFilters | undefined, pagination?: PaginationFilter | undefined): Promise<PaginatedCommandExecutions>;
|
|
5
|
+
listCommandExecutionStatuses(exectionId: string, filters?: CommandExecutionStatusFilters | undefined, pagination?: PaginationFilter | undefined): Promise<PaginatedCommandExecutionStatuses>;
|
|
5
6
|
getCommandExecutionsOutput(id: string): Promise<string>;
|
|
6
7
|
};
|
|
7
8
|
export { CommandExecutions };
|
|
@@ -37,6 +37,31 @@ const CommandExecutions = {
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
},
|
|
40
|
+
listCommandExecutionStatuses(exectionId, filters, pagination) {
|
|
41
|
+
var _a, _b, _c, _d;
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
try {
|
|
44
|
+
const axios = EdgeIQAPI.getAxios();
|
|
45
|
+
const result = yield axios.get(`${Endpoints.commandExecution}/${exectionId}/command_execution_statuses`, {
|
|
46
|
+
params: parseFilters(filters, pagination),
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
statuses: (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.resources,
|
|
50
|
+
pagination: {
|
|
51
|
+
page: (_b = result === null || result === void 0 ? void 0 : result.data) === null || _b === void 0 ? void 0 : _b.page,
|
|
52
|
+
itemsPerPage: (_c = result === null || result === void 0 ? void 0 : result.data) === null || _c === void 0 ? void 0 : _c.per_page,
|
|
53
|
+
total: (_d = result === null || result === void 0 ? void 0 : result.data) === null || _d === void 0 ? void 0 : _d.total,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
if (isApiError(error)) {
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
},
|
|
40
65
|
getCommandExecutionsOutput(id) {
|
|
41
66
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
67
|
try {
|
|
@@ -13,7 +13,15 @@ export interface CommandExecutionsFilters extends Filters {
|
|
|
13
13
|
device_id?: Filter;
|
|
14
14
|
status?: Filter;
|
|
15
15
|
}
|
|
16
|
+
export interface CommandExecutionStatusFilters extends Filters {
|
|
17
|
+
execution_id?: Filter;
|
|
18
|
+
status?: Filter;
|
|
19
|
+
}
|
|
16
20
|
export interface PaginatedCommandExecutions {
|
|
17
21
|
commandExecutions: CommandExecution[];
|
|
18
22
|
pagination: Pagination;
|
|
19
23
|
}
|
|
24
|
+
export interface PaginatedCommandExecutionStatuses {
|
|
25
|
+
statuses: Execution[];
|
|
26
|
+
pagination: Pagination;
|
|
27
|
+
}
|