@edgeiq/edgeiq-api-js 1.8.1 → 1.8.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.
- package/dist/devices/index.d.ts +1 -0
- package/dist/devices/index.js +16 -0
- package/dist/devices/models.d.ts +20 -0
- package/package.json +1 -1
package/dist/devices/index.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ interface DevicesInterface extends BaseModelInterface<Device, DeviceInput, Devic
|
|
|
42
42
|
[key: string]: unknown;
|
|
43
43
|
}): Promise<Command>;
|
|
44
44
|
bulkExecuteWorkflow(workflowId: string, ids: string[]): Promise<BulkActionResponse>;
|
|
45
|
+
revokeCertificate(id: string, certificateId: string, revoke: boolean): Promise<string>;
|
|
45
46
|
}
|
|
46
47
|
export declare const Devices: DevicesInterface;
|
|
47
48
|
export {};
|
package/dist/devices/index.js
CHANGED
|
@@ -639,4 +639,20 @@ export const Devices = class extends BaseModelClass {
|
|
|
639
639
|
}
|
|
640
640
|
});
|
|
641
641
|
}
|
|
642
|
+
static revokeCertificate(id, certificateId, revoke) {
|
|
643
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
644
|
+
try {
|
|
645
|
+
this.logAction(`${revoke ? 'Revoke' : 'Activate'} certificate with ID ${certificateId} on device ${id}`);
|
|
646
|
+
const axios = EdgeIQAPI.getAxios();
|
|
647
|
+
const result = yield axios.post(`${Endpoints.device}/${id}/device_certificates/${certificateId}/${revoke ? 'revoke' : 'activate'}`);
|
|
648
|
+
return result === null || result === void 0 ? void 0 : result.data;
|
|
649
|
+
}
|
|
650
|
+
catch (error) {
|
|
651
|
+
if (isApiError(error)) {
|
|
652
|
+
throw error;
|
|
653
|
+
}
|
|
654
|
+
throw error;
|
|
655
|
+
}
|
|
656
|
+
});
|
|
657
|
+
}
|
|
642
658
|
};
|
package/dist/devices/models.d.ts
CHANGED
|
@@ -23,6 +23,25 @@ export interface GeoJson {
|
|
|
23
23
|
geometry: Geometry;
|
|
24
24
|
properties: GeoJsonProperties;
|
|
25
25
|
}
|
|
26
|
+
export interface DeviceCertificate {
|
|
27
|
+
id: string;
|
|
28
|
+
created_at: string;
|
|
29
|
+
certificate_id: string;
|
|
30
|
+
certificate_pem: string;
|
|
31
|
+
company_id: string;
|
|
32
|
+
device_id: string;
|
|
33
|
+
device_unique_id: string;
|
|
34
|
+
expiration_date: string;
|
|
35
|
+
first_connected: string;
|
|
36
|
+
first_connected_ip: string;
|
|
37
|
+
issue_date: string;
|
|
38
|
+
last_connected: string;
|
|
39
|
+
last_connected_ip: string;
|
|
40
|
+
last_used_client_id: string;
|
|
41
|
+
revoked: boolean;
|
|
42
|
+
serial_number: string;
|
|
43
|
+
updated_at: string;
|
|
44
|
+
}
|
|
26
45
|
export interface DeviceInput {
|
|
27
46
|
name: string;
|
|
28
47
|
unique_id: string;
|
|
@@ -65,6 +84,7 @@ export interface DeviceInput {
|
|
|
65
84
|
parent_device_id?: string;
|
|
66
85
|
auth_method?: string;
|
|
67
86
|
notes?: string;
|
|
87
|
+
device_certificates?: DeviceCertificate[];
|
|
68
88
|
}
|
|
69
89
|
export interface Device extends DeviceInput, Base {
|
|
70
90
|
device_online?: boolean;
|