dt-common-device 9.1.5 → 9.1.7
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/admin/Admin.repository.d.ts +7 -0
- package/dist/admin/Admin.repository.js +182 -0
- package/dist/admin/Admin.service.d.ts +5 -0
- package/dist/admin/Admin.service.js +17 -0
- package/dist/admin/index.d.ts +1 -0
- package/dist/admin/index.js +17 -0
- package/dist/audit/AuditProperties.d.ts +16 -0
- package/dist/audit/AuditProperties.js +2 -0
- package/dist/chronicle/Cronicle.service.d.ts +2 -6
- package/dist/chronicle/Cronicle.service.js +2 -19
- package/dist/chronicle/IChronicle.interface.d.ts +14 -0
- package/dist/chronicle/IChronicle.interface.js +2 -0
- package/dist/chronicle/ICronicle.interface.d.ts +0 -1
- package/dist/chronicle/chronicle.service.d.ts +4 -0
- package/dist/chronicle/chronicle.service.js +44 -0
- package/dist/connection/Connection.repository.d.ts +8 -0
- package/dist/connection/Connection.repository.js +92 -0
- package/dist/connection/Connection.service.d.ts +8 -0
- package/dist/connection/Connection.service.js +32 -0
- package/dist/connection/IConnection.d.ts +28 -0
- package/dist/connection/IConnection.js +16 -0
- package/dist/connection/index.d.ts +2 -0
- package/dist/connection/index.js +18 -0
- package/dist/copilotQueue/examples/CopilotQueue.example.d.ts +37 -0
- package/dist/copilotQueue/examples/CopilotQueue.example.js +140 -0
- package/dist/copilotQueue/examples/index.d.ts +1 -0
- package/dist/copilotQueue/examples/index.js +17 -0
- package/dist/copilotQueue/index.d.ts +4 -0
- package/dist/copilotQueue/index.js +21 -0
- package/dist/copilotQueue/interfaces/ICopilotQueueRequest.d.ts +27 -0
- package/dist/copilotQueue/interfaces/ICopilotQueueRequest.js +2 -0
- package/dist/copilotQueue/interfaces/ICopilotQueueService.d.ts +24 -0
- package/dist/copilotQueue/interfaces/ICopilotQueueService.js +2 -0
- package/dist/copilotQueue/interfaces/index.d.ts +2 -0
- package/dist/copilotQueue/interfaces/index.js +18 -0
- package/dist/copilotQueue/services/CopilotQueue.service.d.ts +13 -0
- package/dist/copilotQueue/services/CopilotQueue.service.js +196 -0
- package/dist/copilotQueue/services/index.d.ts +1 -0
- package/dist/copilotQueue/services/index.js +17 -0
- package/dist/copilotQueue/types/copilot.types.d.ts +13 -0
- package/dist/copilotQueue/types/copilot.types.js +2 -0
- package/dist/copilotQueue/types/index.d.ts +1 -0
- package/dist/copilotQueue/types/index.js +17 -0
- package/dist/copilotQueue/utils/index.d.ts +1 -0
- package/dist/copilotQueue/utils/index.js +17 -0
- package/dist/copilotQueue/utils/queueManager.d.ts +31 -0
- package/dist/copilotQueue/utils/queueManager.js +156 -0
- package/dist/device/cloud/entities/CloudConnection.d.ts +6 -0
- package/dist/device/cloud/entities/CloudConnection.js +6 -0
- package/dist/device/cloud/entities/CloudDevice.d.ts +16 -0
- package/dist/device/cloud/entities/CloudDevice.js +26 -0
- package/dist/device/cloud/entities/CloudDeviceService.d.ts +5 -0
- package/dist/device/cloud/entities/CloudDeviceService.js +9 -0
- package/dist/device/cloud/entities/DeviceFactory.d.ts +7 -0
- package/dist/device/cloud/entities/DeviceFactory.js +80 -0
- package/dist/device/cloud/entities/index.d.ts +3 -0
- package/dist/device/cloud/entities/index.js +19 -0
- package/dist/device/cloud/interface.d.ts +101 -0
- package/dist/device/cloud/interface.js +3 -0
- package/dist/device/cloud/interfaces/ICloudConnection.d.ts +5 -0
- package/dist/device/cloud/interfaces/ICloudConnection.js +2 -0
- package/dist/device/cloud/interfaces/ICloudDevice.d.ts +9 -0
- package/dist/device/cloud/interfaces/ICloudDevice.js +2 -0
- package/dist/device/cloud/interfaces/ICloudDeviceService.d.ts +4 -0
- package/dist/device/cloud/interfaces/ICloudDeviceService.js +2 -0
- package/dist/device/cloud/interfaces/IConnectionService.d.ts +7 -0
- package/dist/device/cloud/interfaces/IConnectionService.js +2 -0
- package/dist/device/cloud/interfaces/IDeviceConnectionService.d.ts +7 -0
- package/dist/device/cloud/interfaces/IDeviceConnectionService.js +3 -0
- package/dist/device/cloud/interfaces/IDeviceFactory.d.ts +4 -0
- package/dist/device/cloud/interfaces/IDeviceFactory.js +2 -0
- package/dist/device/cloud/interfaces/IDeviceService.d.ts +8 -0
- package/dist/device/cloud/interfaces/IDeviceService.js +2 -0
- package/dist/device/cloud/interfaces/IDevicesService.d.ts +9 -0
- package/dist/device/cloud/interfaces/IDevicesService.js +2 -0
- package/dist/device/cloud/interfaces/IHubService.d.ts +5 -0
- package/dist/device/cloud/interfaces/IHubService.js +2 -0
- package/dist/device/cloud/interfaces/IRawDataTransformer.d.ts +4 -0
- package/dist/device/cloud/interfaces/IRawDataTransformer.js +2 -0
- package/dist/device/cloud/interfaces/IRawDevice.d.ts +17 -0
- package/dist/device/cloud/interfaces/IRawDevice.js +11 -0
- package/dist/device/cloud/interfaces/index.d.ts +5 -0
- package/dist/device/cloud/interfaces/index.js +21 -0
- package/dist/device/cloud/services/CloudDevice.service.d.ts +5 -0
- package/dist/device/cloud/services/CloudDevice.service.js +9 -0
- package/dist/device/cloud/services/Connection.service.d.ts +8 -0
- package/dist/device/cloud/services/Connection.service.js +6 -0
- package/dist/device/cloud/services/Device.service.d.ts +39 -0
- package/dist/device/cloud/services/Device.service.js +9 -0
- package/dist/device/cloud/services/DeviceCloudService.d.ts +42 -0
- package/dist/device/cloud/services/DeviceCloudService.js +59 -0
- package/dist/device/cloud/services/DeviceHub.service.d.ts +3 -0
- package/dist/device/cloud/services/DeviceHub.service.js +6 -0
- package/dist/device/cloud/services/Hub.service.d.ts +25 -0
- package/dist/device/cloud/services/Hub.service.js +9 -0
- package/dist/device/cloud/services/SmartThingsDeviceService.d.ts +38 -0
- package/dist/device/cloud/services/SmartThingsDeviceService.js +52 -0
- package/dist/device/cloud/services/index.d.ts +2 -0
- package/dist/device/cloud/services/index.js +18 -0
- package/dist/device/cloud/types.d.ts +52 -0
- package/dist/device/cloud/types.js +15 -0
- package/dist/device/index.d.ts +4 -0
- package/dist/device/index.js +20 -0
- package/dist/device/local/entities/AlertBuilder.d.ts +87 -0
- package/dist/device/local/entities/AlertBuilder.example.d.ts +11 -0
- package/dist/device/local/entities/AlertBuilder.example.js +117 -0
- package/dist/device/local/entities/AlertBuilder.js +179 -0
- package/dist/device/local/entities/IssueBuilder.d.ts +109 -0
- package/dist/device/local/entities/IssueBuilder.example.d.ts +16 -0
- package/dist/device/local/entities/IssueBuilder.example.js +196 -0
- package/dist/device/local/entities/IssueBuilder.js +237 -0
- package/dist/device/local/entities/index.d.ts +2 -0
- package/dist/device/local/entities/index.js +7 -0
- package/dist/device/local/events/EventHandler.d.ts +11 -0
- package/dist/device/local/events/EventHandler.js +86 -0
- package/dist/device/local/events/Events.d.ts +54 -0
- package/dist/device/local/events/Events.js +57 -0
- package/dist/device/local/events/index.d.ts +2 -0
- package/dist/device/local/events/index.js +7 -0
- package/dist/device/local/handler/EventHandler.d.ts +7 -0
- package/dist/device/local/handler/EventHandler.js +44 -0
- package/dist/device/local/interface.d.ts +0 -0
- package/dist/device/local/interface.js +1 -0
- package/dist/device/local/interfaces/IConnection.d.ts +26 -0
- package/dist/device/local/interfaces/IConnection.js +14 -0
- package/dist/device/local/interfaces/IDevice.d.ts +68 -0
- package/dist/device/local/interfaces/IDevice.js +10 -0
- package/dist/device/local/interfaces/IDtDevice.d.ts +16 -0
- package/dist/device/local/interfaces/IDtDevice.js +2 -0
- package/dist/device/local/interfaces/IHub.d.ts +46 -0
- package/dist/device/local/interfaces/IHub.js +2 -0
- package/dist/device/local/interfaces/IProperty.d.ts +29 -0
- package/dist/device/local/interfaces/IProperty.js +2 -0
- package/dist/device/local/interfaces/ISchedule.d.ts +25 -0
- package/dist/device/local/interfaces/ISchedule.js +2 -0
- package/dist/device/local/interfaces/index.d.ts +3 -0
- package/dist/device/local/interfaces/index.js +19 -0
- package/dist/device/local/models/Alert.model.d.ts +28 -0
- package/dist/device/local/models/Alert.model.js +222 -0
- package/dist/device/local/models/Issue.model.d.ts +28 -0
- package/dist/device/local/models/Issue.model.js +260 -0
- package/dist/device/local/repository/Alert.repository.d.ts +106 -0
- package/dist/device/local/repository/Alert.repository.js +374 -0
- package/dist/device/local/repository/Connection.repository.d.ts +8 -0
- package/dist/device/local/repository/Connection.repository.js +92 -0
- package/dist/device/local/repository/Device.repository.d.ts +30 -0
- package/dist/device/local/repository/Device.repository.js +325 -0
- package/dist/device/local/repository/Hub.repository.d.ts +13 -0
- package/dist/device/local/repository/Hub.repository.js +139 -0
- package/dist/device/local/repository/Issue.repository.d.ts +113 -0
- package/dist/device/local/repository/Issue.repository.js +401 -0
- package/dist/device/local/repository/Property.repository.d.ts +8 -0
- package/dist/device/local/repository/Property.repository.js +95 -0
- package/dist/device/local/repository/Schedule.repository.d.ts +9 -0
- package/dist/device/local/repository/Schedule.repository.js +109 -0
- package/dist/device/local/services/Alert.service.d.ts +137 -0
- package/dist/device/local/services/Alert.service.js +475 -0
- package/dist/device/local/services/AlertService.example.d.ts +55 -0
- package/dist/device/local/services/AlertService.example.js +148 -0
- package/dist/device/local/services/Connection.service.d.ts +8 -0
- package/dist/device/local/services/Connection.service.js +32 -0
- package/dist/device/local/services/Device.service.d.ts +40 -0
- package/dist/device/local/services/Device.service.js +391 -0
- package/dist/device/local/services/DeviceHub.service.d.ts +11 -0
- package/dist/device/local/services/DeviceHub.service.js +40 -0
- package/dist/device/local/services/Hub.service.d.ts +12 -0
- package/dist/device/local/services/Hub.service.js +107 -0
- package/dist/device/local/services/Issue.service.d.ts +168 -0
- package/dist/device/local/services/Issue.service.js +642 -0
- package/dist/device/local/services/IssueService.example.d.ts +68 -0
- package/dist/device/local/services/IssueService.example.js +177 -0
- package/dist/device/local/services/Property.service.d.ts +8 -0
- package/dist/device/local/services/Property.service.js +36 -0
- package/dist/device/local/services/Schedule.service.d.ts +9 -0
- package/dist/device/local/services/Schedule.service.js +26 -0
- package/dist/device/local/services/index.d.ts +3 -0
- package/dist/device/local/services/index.js +19 -0
- package/dist/entities/accessGroup/AccessGroup.repository.d.ts +1 -2
- package/dist/entities/accessGroup/AccessGroup.repository.js +1 -4
- package/dist/entities/accessGroup/AccessGroup.service.d.ts +1 -2
- package/dist/entities/accessGroup/AccessGroup.service.js +3 -4
- package/dist/entities/guest/Guest.repository.d.ts +1 -1
- package/dist/entities/guest/Guest.repository.js +2 -5
- package/dist/entities/guest/Guest.service.d.ts +1 -1
- package/dist/entities/guest/Guest.service.js +1 -4
- package/dist/entities/schedules/Schedule.repository.d.ts +1 -1
- package/dist/entities/schedules/Schedule.repository.js +2 -5
- package/dist/entities/schedules/Schedule.service.d.ts +1 -1
- package/dist/entities/schedules/Schedule.service.js +1 -4
- package/dist/entities/user/User.repository.js +1 -4
- package/dist/entities/user/User.service.d.ts +1 -1
- package/dist/entities/user/User.service.js +1 -4
- package/dist/entities/zone/Zone.service.js +1 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/pms/IPms.d.ts +6 -0
- package/dist/pms/IPms.js +10 -0
- package/dist/pms/index.d.ts +1 -0
- package/dist/pms/index.js +18 -0
- package/dist/pms/webhookQueue/examples/index.d.ts +2 -0
- package/dist/pms/webhookQueue/examples/index.js +18 -0
- package/dist/pms/webhookQueue/examples/pms-integration.d.ts +65 -0
- package/dist/pms/webhookQueue/examples/pms-integration.js +254 -0
- package/dist/pms/webhookQueue/examples/usage.d.ts +7 -0
- package/dist/pms/webhookQueue/examples/usage.js +175 -0
- package/dist/pms/webhookQueue/index.d.ts +3 -0
- package/dist/pms/webhookQueue/index.js +20 -0
- package/dist/pms/webhookQueue/interfaces/IWebhookQueue.d.ts +33 -0
- package/dist/pms/webhookQueue/interfaces/IWebhookQueue.js +2 -0
- package/dist/pms/webhookQueue/interfaces/IWebhookWorker.d.ts +38 -0
- package/dist/pms/webhookQueue/interfaces/IWebhookWorker.js +2 -0
- package/dist/pms/webhookQueue/interfaces/index.d.ts +1 -0
- package/dist/pms/webhookQueue/interfaces/index.js +17 -0
- package/dist/pms/webhookQueue/services/WebhookQueueFactory.d.ts +38 -0
- package/dist/pms/webhookQueue/services/WebhookQueueFactory.js +131 -0
- package/dist/pms/webhookQueue/services/WebhookQueueIntegration.d.ts +70 -0
- package/dist/pms/webhookQueue/services/WebhookQueueIntegration.js +207 -0
- package/dist/pms/webhookQueue/services/WebhookQueueService.d.ts +45 -0
- package/dist/pms/webhookQueue/services/WebhookQueueService.js +270 -0
- package/dist/pms/webhookQueue/services/WebhookWorker.d.ts +37 -0
- package/dist/pms/webhookQueue/services/WebhookWorker.js +201 -0
- package/dist/pms/webhookQueue/services/index.d.ts +1 -0
- package/dist/pms/webhookQueue/services/index.js +17 -0
- package/dist/pms/webhookQueue/types/index.d.ts +1 -0
- package/dist/pms/webhookQueue/types/index.js +17 -0
- package/dist/pms/webhookQueue/types/webhook.types.d.ts +39 -0
- package/dist/pms/webhookQueue/types/webhook.types.js +2 -0
- package/dist/property/IProperty.d.ts +29 -0
- package/dist/property/IProperty.js +2 -0
- package/dist/property/Property.repository.d.ts +8 -0
- package/dist/property/Property.repository.js +109 -0
- package/dist/property/Property.service.d.ts +8 -0
- package/dist/property/Property.service.js +124 -0
- package/dist/property/index.d.ts +2 -0
- package/dist/property/index.js +18 -0
- package/dist/queue/interfaces/IHttpRequestJob.d.ts +9 -0
- package/dist/queue/interfaces/IHttpRequestJob.js +2 -0
- package/dist/types/alert.types.d.ts +57 -0
- package/dist/types/alert.types.js +22 -0
- package/dist/types/config.types.d.ts +19 -0
- package/dist/types/config.types.js +2 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +19 -0
- package/dist/types/issue.types.d.ts +90 -0
- package/dist/types/issue.types.js +40 -0
- package/dist/utils/http-utils.d.ts +13 -0
- package/dist/utils/http-utils.js +117 -0
- package/package.json +1 -1
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IssueBuilder = void 0;
|
|
4
|
+
const issue_types_1 = require("../../../types/issue.types");
|
|
5
|
+
/**
|
|
6
|
+
* IssueBuilder - A builder pattern implementation for constructing CreateIssueData objects
|
|
7
|
+
*
|
|
8
|
+
* This builder provides a fluent interface for creating issue data with proper validation
|
|
9
|
+
* and default values. It follows the Builder pattern which is a standard design pattern
|
|
10
|
+
* in TypeScript for constructing complex objects.
|
|
11
|
+
*
|
|
12
|
+
* Usage example:
|
|
13
|
+
* const issueData = new IssueBuilder()
|
|
14
|
+
* .setCategory(IssuesCategory.OPERATIONS)
|
|
15
|
+
* .setPropertyId("prop123")
|
|
16
|
+
* .setTitle("Device Maintenance Required")
|
|
17
|
+
* .setDescription("Device requires scheduled maintenance")
|
|
18
|
+
* .setEntityId("device456")
|
|
19
|
+
* .setEntityType(EntityType.DEVICE)
|
|
20
|
+
* .setPriority(IssuePriority.HIGH)
|
|
21
|
+
* .setAssignedTo("tech789")
|
|
22
|
+
* .setCreatedBy("user123")
|
|
23
|
+
* .setDueDate(new Date("2024-01-15"))
|
|
24
|
+
* .build();
|
|
25
|
+
*/
|
|
26
|
+
class IssueBuilder {
|
|
27
|
+
constructor() {
|
|
28
|
+
this.data = {};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Sets the issue category
|
|
32
|
+
*/
|
|
33
|
+
setCategory(category) {
|
|
34
|
+
this.data.category = category;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Sets the property ID
|
|
39
|
+
*/
|
|
40
|
+
setPropertyId(propertyId) {
|
|
41
|
+
if (!propertyId || propertyId.trim() === "") {
|
|
42
|
+
throw new Error("Property ID is required and cannot be empty");
|
|
43
|
+
}
|
|
44
|
+
this.data.propertyId = propertyId;
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Sets the issue title
|
|
49
|
+
*/
|
|
50
|
+
setTitle(title) {
|
|
51
|
+
if (!title || title.trim() === "") {
|
|
52
|
+
throw new Error("Title is required and cannot be empty");
|
|
53
|
+
}
|
|
54
|
+
this.data.title = title.trim();
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Sets the issue description
|
|
59
|
+
*/
|
|
60
|
+
setDescription(description) {
|
|
61
|
+
if (!description || description.trim() === "") {
|
|
62
|
+
throw new Error("Description is required and cannot be empty");
|
|
63
|
+
}
|
|
64
|
+
this.data.description = description.trim();
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Sets the entity ID (optional)
|
|
69
|
+
*/
|
|
70
|
+
setEntityId(entityId) {
|
|
71
|
+
if (entityId !== undefined) {
|
|
72
|
+
this.data.entityId = entityId.trim() || undefined;
|
|
73
|
+
}
|
|
74
|
+
return this;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Sets the entity type
|
|
78
|
+
*/
|
|
79
|
+
setEntityType(entityType) {
|
|
80
|
+
this.data.entityType = entityType;
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Sets the issue priority (optional, defaults to MEDIUM)
|
|
85
|
+
*/
|
|
86
|
+
setPriority(priority) {
|
|
87
|
+
if (priority !== undefined) {
|
|
88
|
+
this.data.priority = priority;
|
|
89
|
+
}
|
|
90
|
+
return this;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Sets the user assigned to the issue (optional)
|
|
94
|
+
*/
|
|
95
|
+
setAssignedTo(assignedTo) {
|
|
96
|
+
if (assignedTo !== undefined) {
|
|
97
|
+
this.data.assignedTo = assignedTo.trim() || undefined;
|
|
98
|
+
}
|
|
99
|
+
return this;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Sets the user who created the issue (required)
|
|
103
|
+
*/
|
|
104
|
+
setCreatedBy(createdBy) {
|
|
105
|
+
if (!createdBy || createdBy.trim() === "") {
|
|
106
|
+
throw new Error("Created by user is required and cannot be empty");
|
|
107
|
+
}
|
|
108
|
+
this.data.createdBy = createdBy.trim();
|
|
109
|
+
return this;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Sets the due date (optional)
|
|
113
|
+
*/
|
|
114
|
+
setDueDate(dueDate) {
|
|
115
|
+
if (dueDate !== undefined) {
|
|
116
|
+
this.data.dueDate = dueDate;
|
|
117
|
+
}
|
|
118
|
+
return this;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Validates that all required fields are present
|
|
122
|
+
*/
|
|
123
|
+
validate() {
|
|
124
|
+
const requiredFields = ["category", "propertyId", "title", "description", "entityType", "createdBy"];
|
|
125
|
+
const missingFields = requiredFields.filter(field => !this.data[field]);
|
|
126
|
+
if (missingFields.length > 0) {
|
|
127
|
+
throw new Error(`Missing required fields: ${missingFields.join(", ")}`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Builds and returns the CreateIssueData object
|
|
132
|
+
* @throws Error if required fields are missing
|
|
133
|
+
*/
|
|
134
|
+
build() {
|
|
135
|
+
this.validate();
|
|
136
|
+
// Set default priority if not provided
|
|
137
|
+
if (!this.data.priority) {
|
|
138
|
+
this.data.priority = issue_types_1.IssuePriority.MEDIUM;
|
|
139
|
+
}
|
|
140
|
+
return this.data;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Resets the builder to its initial state
|
|
144
|
+
*/
|
|
145
|
+
reset() {
|
|
146
|
+
this.data = {};
|
|
147
|
+
return this;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Creates a new builder instance with predefined values for common issue types
|
|
151
|
+
*/
|
|
152
|
+
static createReadinessIssue() {
|
|
153
|
+
return new IssueBuilder()
|
|
154
|
+
.setCategory(issue_types_1.IssuesCategory.READINESS)
|
|
155
|
+
.setPriority(issue_types_1.IssuePriority.MEDIUM);
|
|
156
|
+
}
|
|
157
|
+
static createOperationsIssue() {
|
|
158
|
+
return new IssueBuilder()
|
|
159
|
+
.setCategory(issue_types_1.IssuesCategory.OPERATIONS)
|
|
160
|
+
.setPriority(issue_types_1.IssuePriority.HIGH);
|
|
161
|
+
}
|
|
162
|
+
static createSecurityIssue() {
|
|
163
|
+
return new IssueBuilder()
|
|
164
|
+
.setCategory(issue_types_1.IssuesCategory.SECURITY)
|
|
165
|
+
.setPriority(issue_types_1.IssuePriority.CRITICAL);
|
|
166
|
+
}
|
|
167
|
+
static createEnergyIssue() {
|
|
168
|
+
return new IssueBuilder()
|
|
169
|
+
.setCategory(issue_types_1.IssuesCategory.ENERGY)
|
|
170
|
+
.setPriority(issue_types_1.IssuePriority.LOW);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Creates a device-specific issue builder
|
|
174
|
+
*/
|
|
175
|
+
static createDeviceIssue(deviceId, propertyId) {
|
|
176
|
+
return new IssueBuilder()
|
|
177
|
+
.setEntityType(issue_types_1.EntityType.DEVICE)
|
|
178
|
+
.setEntityId(deviceId)
|
|
179
|
+
.setPropertyId(propertyId);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Creates a hub-specific issue builder
|
|
183
|
+
*/
|
|
184
|
+
static createHubIssue(hubId, propertyId) {
|
|
185
|
+
return new IssueBuilder()
|
|
186
|
+
.setEntityType(issue_types_1.EntityType.HUB)
|
|
187
|
+
.setEntityId(hubId)
|
|
188
|
+
.setPropertyId(propertyId);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Creates a user-specific issue builder
|
|
192
|
+
*/
|
|
193
|
+
static createUserIssue(userId, propertyId) {
|
|
194
|
+
return new IssueBuilder()
|
|
195
|
+
.setEntityType(issue_types_1.EntityType.USER)
|
|
196
|
+
.setEntityId(userId)
|
|
197
|
+
.setPropertyId(propertyId);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Creates a property-specific issue builder
|
|
201
|
+
*/
|
|
202
|
+
static createPropertyIssue(propertyId) {
|
|
203
|
+
return new IssueBuilder()
|
|
204
|
+
.setEntityType(issue_types_1.EntityType.PROPERTY)
|
|
205
|
+
.setEntityId(propertyId)
|
|
206
|
+
.setPropertyId(propertyId);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Creates a maintenance issue builder
|
|
210
|
+
*/
|
|
211
|
+
static createMaintenanceIssue(propertyId, entityId, entityType) {
|
|
212
|
+
const builder = new IssueBuilder()
|
|
213
|
+
.setCategory(issue_types_1.IssuesCategory.READINESS)
|
|
214
|
+
.setPropertyId(propertyId)
|
|
215
|
+
.setPriority(issue_types_1.IssuePriority.MEDIUM);
|
|
216
|
+
if (entityId)
|
|
217
|
+
builder.setEntityId(entityId);
|
|
218
|
+
if (entityType)
|
|
219
|
+
builder.setEntityType(entityType);
|
|
220
|
+
return builder;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Creates an urgent issue builder
|
|
224
|
+
*/
|
|
225
|
+
static createUrgentIssue(propertyId, entityId, entityType) {
|
|
226
|
+
const builder = new IssueBuilder()
|
|
227
|
+
.setCategory(issue_types_1.IssuesCategory.OPERATIONS)
|
|
228
|
+
.setPropertyId(propertyId)
|
|
229
|
+
.setPriority(issue_types_1.IssuePriority.URGENT);
|
|
230
|
+
if (entityId)
|
|
231
|
+
builder.setEntityId(entityId);
|
|
232
|
+
if (entityType)
|
|
233
|
+
builder.setEntityType(entityType);
|
|
234
|
+
return builder;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
exports.IssueBuilder = IssueBuilder;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IssueBuilder = exports.AlertBuilder = void 0;
|
|
4
|
+
var AlertBuilder_1 = require("./AlertBuilder");
|
|
5
|
+
Object.defineProperty(exports, "AlertBuilder", { enumerable: true, get: function () { return AlertBuilder_1.AlertBuilder; } });
|
|
6
|
+
var IssueBuilder_1 = require("./IssueBuilder");
|
|
7
|
+
Object.defineProperty(exports, "IssueBuilder", { enumerable: true, get: function () { return IssueBuilder_1.IssueBuilder; } });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class EventHandler {
|
|
2
|
+
private readonly source;
|
|
3
|
+
constructor();
|
|
4
|
+
onDeviceCreate(body: any): Promise<void>;
|
|
5
|
+
onDeviceUpdate(deviceId: string, body: any): Promise<void>;
|
|
6
|
+
onDeviceDelete(deviceId: string): Promise<void>;
|
|
7
|
+
onStateChange(deviceId: string, state: any): Promise<void>;
|
|
8
|
+
onStatusChange(deviceId: string, status: any): Promise<void>;
|
|
9
|
+
onBatteryLevelChange(deviceId: string, batteryLevel: number): Promise<void>;
|
|
10
|
+
onDeviceMetaChange(deviceId: string, metaData: Record<string, any>): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventHandler = void 0;
|
|
4
|
+
const dt_pub_sub_1 = require("dt-pub-sub");
|
|
5
|
+
const dt_audit_library_1 = require("dt-audit-library");
|
|
6
|
+
const Events_1 = require("./Events");
|
|
7
|
+
class EventHandler {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.source = "dt-common-device";
|
|
10
|
+
}
|
|
11
|
+
async onDeviceCreate(body) {
|
|
12
|
+
await dt_pub_sub_1.eventDispatcher.publishEvent(Events_1.DT_EVENT_TYPES.DEVICE.DEVICE.CREATED, body, this.source);
|
|
13
|
+
const payload = {
|
|
14
|
+
eventType: Events_1.DT_EVENT_TYPES.DEVICE.DEVICE.CREATED,
|
|
15
|
+
properties: {
|
|
16
|
+
...body,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
await (0, dt_audit_library_1.publishAudit)(payload);
|
|
20
|
+
}
|
|
21
|
+
async onDeviceUpdate(deviceId, body) {
|
|
22
|
+
await dt_pub_sub_1.eventDispatcher.publishEvent(Events_1.DT_EVENT_TYPES.DEVICE.DEVICE.UPDATED, { deviceId, body }, this.source);
|
|
23
|
+
const payload = {
|
|
24
|
+
eventType: Events_1.DT_EVENT_TYPES.DEVICE.DEVICE.UPDATED,
|
|
25
|
+
properties: {
|
|
26
|
+
...body,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
await (0, dt_audit_library_1.publishAudit)(payload);
|
|
30
|
+
}
|
|
31
|
+
async onDeviceDelete(deviceId) {
|
|
32
|
+
await dt_pub_sub_1.eventDispatcher.publishEvent(Events_1.DT_EVENT_TYPES.DEVICE.DEVICE.DELETED, { deviceId }, this.source);
|
|
33
|
+
const payload = {
|
|
34
|
+
eventType: Events_1.DT_EVENT_TYPES.DEVICE.DEVICE.DELETED,
|
|
35
|
+
properties: {
|
|
36
|
+
deviceId,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
await (0, dt_audit_library_1.publishAudit)(payload);
|
|
40
|
+
}
|
|
41
|
+
async onStateChange(deviceId, state) {
|
|
42
|
+
await dt_pub_sub_1.eventDispatcher.publishEvent(Events_1.DT_EVENT_TYPES.DEVICE.STATE.SET, { deviceId, state }, this.source);
|
|
43
|
+
const payload = {
|
|
44
|
+
eventType: Events_1.DT_EVENT_TYPES.DEVICE.STATE.SET,
|
|
45
|
+
properties: {
|
|
46
|
+
deviceId,
|
|
47
|
+
state,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
await (0, dt_audit_library_1.publishAudit)(payload);
|
|
51
|
+
}
|
|
52
|
+
async onStatusChange(deviceId, status) {
|
|
53
|
+
await dt_pub_sub_1.eventDispatcher.publishEvent(Events_1.DT_EVENT_TYPES.DEVICE.STATUS.SET, { deviceId, status }, this.source);
|
|
54
|
+
const payload = {
|
|
55
|
+
eventType: Events_1.DT_EVENT_TYPES.DEVICE.STATUS.SET,
|
|
56
|
+
properties: {
|
|
57
|
+
deviceId,
|
|
58
|
+
status,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
await (0, dt_audit_library_1.publishAudit)(payload);
|
|
62
|
+
}
|
|
63
|
+
async onBatteryLevelChange(deviceId, batteryLevel) {
|
|
64
|
+
await dt_pub_sub_1.eventDispatcher.publishEvent(Events_1.DT_EVENT_TYPES.DEVICE.BATTERY.SET, { deviceId, batteryLevel }, this.source);
|
|
65
|
+
const payload = {
|
|
66
|
+
eventType: Events_1.DT_EVENT_TYPES.DEVICE.BATTERY.SET,
|
|
67
|
+
properties: {
|
|
68
|
+
deviceId,
|
|
69
|
+
batteryLevel,
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
await (0, dt_audit_library_1.publishAudit)(payload);
|
|
73
|
+
}
|
|
74
|
+
async onDeviceMetaChange(deviceId, metaData) {
|
|
75
|
+
await dt_pub_sub_1.eventDispatcher.publishEvent(Events_1.DT_EVENT_TYPES.DEVICE.META_DATA.SET, { deviceId, metaData }, this.source);
|
|
76
|
+
const payload = {
|
|
77
|
+
eventType: Events_1.DT_EVENT_TYPES.DEVICE.META_DATA.SET,
|
|
78
|
+
properties: {
|
|
79
|
+
deviceId,
|
|
80
|
+
metaData,
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
await (0, dt_audit_library_1.publishAudit)(payload);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.EventHandler = EventHandler;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const DT_EVENT_TYPES: {
|
|
2
|
+
DEVICE: {
|
|
3
|
+
DEVICE: {
|
|
4
|
+
CREATED: string;
|
|
5
|
+
UPDATED: string;
|
|
6
|
+
DELETED: string;
|
|
7
|
+
};
|
|
8
|
+
STATE: {
|
|
9
|
+
SET: string;
|
|
10
|
+
UNKNOWN: string;
|
|
11
|
+
UPDATED: string;
|
|
12
|
+
CHANGED: string;
|
|
13
|
+
};
|
|
14
|
+
STATUS: {
|
|
15
|
+
SET: string;
|
|
16
|
+
ONLINE: string;
|
|
17
|
+
OFFLINE: string;
|
|
18
|
+
UNKNOWN: string;
|
|
19
|
+
UPDATED: string;
|
|
20
|
+
CHANGED: string;
|
|
21
|
+
};
|
|
22
|
+
BATTERY: {
|
|
23
|
+
SET: string;
|
|
24
|
+
UNKNOWN: string;
|
|
25
|
+
LOW: string;
|
|
26
|
+
CRITICAL: string;
|
|
27
|
+
UPDATED: string;
|
|
28
|
+
CHANGED: string;
|
|
29
|
+
};
|
|
30
|
+
META_DATA: {
|
|
31
|
+
SET: string;
|
|
32
|
+
UPDATED: string;
|
|
33
|
+
CHANGED: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
CONNECTION: {
|
|
37
|
+
CONNECTION: {
|
|
38
|
+
CREATED: string;
|
|
39
|
+
UPDATED: string;
|
|
40
|
+
DELETED: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
PROPERTY: {
|
|
44
|
+
PROPERTY: {
|
|
45
|
+
CREATED: string;
|
|
46
|
+
UPDATED: string;
|
|
47
|
+
DELETED: string;
|
|
48
|
+
};
|
|
49
|
+
PREFERENCES: {
|
|
50
|
+
UPDATED: string;
|
|
51
|
+
CREATED: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DT_EVENT_TYPES = void 0;
|
|
4
|
+
exports.DT_EVENT_TYPES = {
|
|
5
|
+
DEVICE: {
|
|
6
|
+
DEVICE: {
|
|
7
|
+
CREATED: "device.device.created",
|
|
8
|
+
UPDATED: "device.device.updated",
|
|
9
|
+
DELETED: "device.device.deleted",
|
|
10
|
+
},
|
|
11
|
+
STATE: {
|
|
12
|
+
SET: "device.state.set",
|
|
13
|
+
UNKNOWN: "device.state.unknown",
|
|
14
|
+
UPDATED: "device.state.updated",
|
|
15
|
+
CHANGED: "device.state.changed",
|
|
16
|
+
},
|
|
17
|
+
STATUS: {
|
|
18
|
+
SET: "device.status.set",
|
|
19
|
+
ONLINE: "device.status.online",
|
|
20
|
+
OFFLINE: "device.status.offline",
|
|
21
|
+
UNKNOWN: "device.status.unknown",
|
|
22
|
+
UPDATED: "device.status.updated",
|
|
23
|
+
CHANGED: "device.status.changed",
|
|
24
|
+
},
|
|
25
|
+
BATTERY: {
|
|
26
|
+
SET: "device.battery.set",
|
|
27
|
+
UNKNOWN: "device.battery.unknown",
|
|
28
|
+
LOW: "device.battery.low",
|
|
29
|
+
CRITICAL: "device.battery.critical",
|
|
30
|
+
UPDATED: "device.battery.updated",
|
|
31
|
+
CHANGED: "device.battery.changed",
|
|
32
|
+
},
|
|
33
|
+
META_DATA: {
|
|
34
|
+
SET: "device.metaData.set",
|
|
35
|
+
UPDATED: "device.metaData.updated",
|
|
36
|
+
CHANGED: "device.metaData.changed",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
CONNECTION: {
|
|
40
|
+
CONNECTION: {
|
|
41
|
+
CREATED: "connection.connection.created",
|
|
42
|
+
UPDATED: "connection.connection.updated",
|
|
43
|
+
DELETED: "connection.connection.deleted",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
PROPERTY: {
|
|
47
|
+
PROPERTY: {
|
|
48
|
+
CREATED: "property.property.created",
|
|
49
|
+
UPDATED: "property.property.updated",
|
|
50
|
+
DELETED: "property.property.deleted",
|
|
51
|
+
},
|
|
52
|
+
PREFERENCES: {
|
|
53
|
+
UPDATED: "property.preferences.updated",
|
|
54
|
+
CREATED: "property.preferences.created",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventHandler = exports.DT_EVENT_TYPES = void 0;
|
|
4
|
+
var Events_1 = require("./Events");
|
|
5
|
+
Object.defineProperty(exports, "DT_EVENT_TYPES", { enumerable: true, get: function () { return Events_1.DT_EVENT_TYPES; } });
|
|
6
|
+
var EventHandler_1 = require("./EventHandler");
|
|
7
|
+
Object.defineProperty(exports, "EventHandler", { enumerable: true, get: function () { return EventHandler_1.EventHandler; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare class EventHandler {
|
|
2
|
+
private readonly source;
|
|
3
|
+
constructor();
|
|
4
|
+
onStateChange(deviceId: string, state: any): Promise<void>;
|
|
5
|
+
onStatusChange(deviceId: string, status: any): Promise<void>;
|
|
6
|
+
onBatteryLevelChange(deviceId: string, batteryLevel: number): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventHandler = void 0;
|
|
4
|
+
const dt_pub_sub_1 = require("dt-pub-sub");
|
|
5
|
+
const dt_audit_library_1 = require("dt-audit-library");
|
|
6
|
+
class EventHandler {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.source = "dt-common-device";
|
|
9
|
+
}
|
|
10
|
+
async onStateChange(deviceId, state) {
|
|
11
|
+
await dt_pub_sub_1.eventDispatcher.publishEvent("device.state.set", { deviceId, state }, this.source);
|
|
12
|
+
const payload = {
|
|
13
|
+
eventType: "device.state.set",
|
|
14
|
+
properties: {
|
|
15
|
+
deviceId,
|
|
16
|
+
state,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
await (0, dt_audit_library_1.publishAudit)(payload);
|
|
20
|
+
}
|
|
21
|
+
async onStatusChange(deviceId, status) {
|
|
22
|
+
await dt_pub_sub_1.eventDispatcher.publishEvent("device.status.set", { deviceId, status }, this.source);
|
|
23
|
+
const payload = {
|
|
24
|
+
eventType: "device.status.set",
|
|
25
|
+
properties: {
|
|
26
|
+
deviceId,
|
|
27
|
+
status,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
await (0, dt_audit_library_1.publishAudit)(payload);
|
|
31
|
+
}
|
|
32
|
+
async onBatteryLevelChange(deviceId, batteryLevel) {
|
|
33
|
+
await dt_pub_sub_1.eventDispatcher.publishEvent("device.battery.set", { deviceId, batteryLevel }, this.source);
|
|
34
|
+
const payload = {
|
|
35
|
+
eventType: "device.battery.set",
|
|
36
|
+
properties: {
|
|
37
|
+
deviceId,
|
|
38
|
+
batteryLevel,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
await (0, dt_audit_library_1.publishAudit)(payload);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.EventHandler = EventHandler;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface IConnection {
|
|
2
|
+
id?: string;
|
|
3
|
+
createdAt?: Date;
|
|
4
|
+
updatedAt?: Date;
|
|
5
|
+
isDeleted?: boolean;
|
|
6
|
+
connectionName: string;
|
|
7
|
+
connectionRefId: string;
|
|
8
|
+
propertyId: string;
|
|
9
|
+
connectionProvider: ConnectionProvider;
|
|
10
|
+
accessToken?: string;
|
|
11
|
+
refreshToken?: string;
|
|
12
|
+
clientId?: string;
|
|
13
|
+
clientSecret: string;
|
|
14
|
+
isActive?: boolean;
|
|
15
|
+
metaData?: any;
|
|
16
|
+
}
|
|
17
|
+
export declare enum ConnectionProvider {
|
|
18
|
+
Smartthings = "Smartthings",
|
|
19
|
+
SaltoKS = "SaltoKS",
|
|
20
|
+
TTLock = "TTLock",
|
|
21
|
+
Tuya = "Tuya",
|
|
22
|
+
Schlage = "Schlage",
|
|
23
|
+
YaleWifi = "YaleWifi",
|
|
24
|
+
Sensibo = "Sensibo",
|
|
25
|
+
Devicethread = "Devicethread"
|
|
26
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConnectionProvider = void 0;
|
|
4
|
+
var ConnectionProvider;
|
|
5
|
+
(function (ConnectionProvider) {
|
|
6
|
+
ConnectionProvider["Smartthings"] = "Smartthings";
|
|
7
|
+
ConnectionProvider["SaltoKS"] = "SaltoKS";
|
|
8
|
+
ConnectionProvider["TTLock"] = "TTLock";
|
|
9
|
+
ConnectionProvider["Tuya"] = "Tuya";
|
|
10
|
+
ConnectionProvider["Schlage"] = "Schlage";
|
|
11
|
+
ConnectionProvider["YaleWifi"] = "YaleWifi";
|
|
12
|
+
ConnectionProvider["Sensibo"] = "Sensibo";
|
|
13
|
+
ConnectionProvider["Devicethread"] = "Devicethread";
|
|
14
|
+
})(ConnectionProvider || (exports.ConnectionProvider = ConnectionProvider = {}));
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export interface IDevice {
|
|
2
|
+
deviceId: string;
|
|
3
|
+
propertyId: string;
|
|
4
|
+
zoneId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
hubId: string[];
|
|
7
|
+
specifications: {
|
|
8
|
+
manufacturer?: string;
|
|
9
|
+
model?: string;
|
|
10
|
+
firmware?: {
|
|
11
|
+
version?: string;
|
|
12
|
+
newVersionAvailable?: boolean;
|
|
13
|
+
newVersion?: string;
|
|
14
|
+
mandatoryUpdate?: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
protocol: {
|
|
18
|
+
location?: {
|
|
19
|
+
id?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
city?: string;
|
|
22
|
+
};
|
|
23
|
+
name?: string;
|
|
24
|
+
room?: {
|
|
25
|
+
id?: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
};
|
|
28
|
+
accountId?: string;
|
|
29
|
+
};
|
|
30
|
+
connection: {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
};
|
|
34
|
+
deviceType: {
|
|
35
|
+
id: string;
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
status: IStatus;
|
|
39
|
+
isActive: {
|
|
40
|
+
value: boolean;
|
|
41
|
+
lastUpdated: string;
|
|
42
|
+
};
|
|
43
|
+
state?: Record<string, any>;
|
|
44
|
+
metaData?: Record<string, any>;
|
|
45
|
+
createdAt?: Date;
|
|
46
|
+
updatedAt?: Date;
|
|
47
|
+
hubDeviceDetails?: IDevice[];
|
|
48
|
+
capabilities?: Record<string, any>;
|
|
49
|
+
}
|
|
50
|
+
export declare class IStatus {
|
|
51
|
+
online: boolean;
|
|
52
|
+
liveStatus?: "ONLINE" | "OFFLINE";
|
|
53
|
+
error?: {
|
|
54
|
+
type?: string;
|
|
55
|
+
message?: string;
|
|
56
|
+
default?: object;
|
|
57
|
+
};
|
|
58
|
+
lastUpdated?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface IStatusQuery {
|
|
61
|
+
deviceIds?: string[];
|
|
62
|
+
zoneId?: string;
|
|
63
|
+
propertyId?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface IStatusUpdateRequest {
|
|
66
|
+
query: IStatusQuery;
|
|
67
|
+
status: IStatus;
|
|
68
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface IDtDevice {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
zoneId: string;
|
|
6
|
+
deviceType: string;
|
|
7
|
+
deviceId: string;
|
|
8
|
+
deviceNetworkId: string;
|
|
9
|
+
propertyId: string;
|
|
10
|
+
connectionId: string;
|
|
11
|
+
hubId: string;
|
|
12
|
+
isBatteryLowAlertSent: boolean;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
isActive: boolean;
|
|
16
|
+
}
|