dt-common-device 7.6.3 → 7.6.4
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/alerts/Alert.model.d.ts +1 -1
- package/dist/alerts/Alert.service.d.ts +2 -5
- package/dist/alerts/Alert.service.js +4 -4
- package/dist/constants/Event.d.ts +48 -14
- package/dist/constants/Event.js +48 -14
- package/dist/entities/accessGroup/AccessGroup.repository.d.ts +2 -1
- package/dist/entities/accessGroup/AccessGroup.repository.js +4 -1
- package/dist/entities/accessGroup/AccessGroup.service.d.ts +2 -1
- package/dist/entities/accessGroup/AccessGroup.service.js +4 -3
- package/dist/entities/guest/Guest.repository.d.ts +1 -1
- package/dist/entities/guest/Guest.repository.js +5 -2
- package/dist/entities/guest/Guest.service.d.ts +1 -1
- package/dist/entities/guest/Guest.service.js +4 -1
- package/dist/entities/schedules/Schedule.repository.d.ts +1 -1
- package/dist/entities/schedules/Schedule.repository.js +5 -2
- package/dist/entities/schedules/Schedule.service.d.ts +1 -1
- package/dist/entities/schedules/Schedule.service.js +4 -1
- package/dist/entities/user/User.repository.js +4 -1
- package/dist/entities/user/User.service.d.ts +1 -1
- package/dist/entities/user/User.service.js +4 -1
- package/dist/entities/zone/Zone.service.js +4 -1
- package/dist/events/DeviceEventHandler.js +1 -1
- package/dist/issues/Issue.model.d.ts +1 -1
- package/dist/issues/Issue.service.d.ts +2 -5
- package/dist/issues/Issue.service.js +4 -4
- package/package.json +1 -1
- package/dist/admin/Admin.repository.d.ts +0 -7
- package/dist/admin/Admin.repository.js +0 -182
- package/dist/admin/Admin.service.d.ts +0 -5
- package/dist/admin/Admin.service.js +0 -17
- package/dist/admin/index.d.ts +0 -1
- package/dist/admin/index.js +0 -17
- package/dist/audit/AuditProperties.d.ts +0 -16
- package/dist/audit/AuditProperties.js +0 -2
- package/dist/chronicle/IChronicle.interface.d.ts +0 -14
- package/dist/chronicle/IChronicle.interface.js +0 -2
- package/dist/chronicle/chronicle.service.d.ts +0 -4
- package/dist/chronicle/chronicle.service.js +0 -44
- package/dist/connection/Connection.repository.d.ts +0 -8
- package/dist/connection/Connection.repository.js +0 -92
- package/dist/connection/Connection.service.d.ts +0 -8
- package/dist/connection/Connection.service.js +0 -32
- package/dist/connection/IConnection.d.ts +0 -28
- package/dist/connection/IConnection.js +0 -16
- package/dist/connection/index.d.ts +0 -2
- package/dist/connection/index.js +0 -18
- package/dist/device/cloud/entities/CloudConnection.d.ts +0 -6
- package/dist/device/cloud/entities/CloudConnection.js +0 -6
- package/dist/device/cloud/entities/CloudDevice.d.ts +0 -16
- package/dist/device/cloud/entities/CloudDevice.js +0 -26
- package/dist/device/cloud/entities/CloudDeviceService.d.ts +0 -5
- package/dist/device/cloud/entities/CloudDeviceService.js +0 -9
- package/dist/device/cloud/entities/DeviceFactory.d.ts +0 -7
- package/dist/device/cloud/entities/DeviceFactory.js +0 -80
- package/dist/device/cloud/entities/index.d.ts +0 -3
- package/dist/device/cloud/entities/index.js +0 -19
- package/dist/device/cloud/interface.d.ts +0 -101
- package/dist/device/cloud/interface.js +0 -3
- package/dist/device/cloud/interfaces/ICloudConnection.d.ts +0 -5
- package/dist/device/cloud/interfaces/ICloudConnection.js +0 -2
- package/dist/device/cloud/interfaces/ICloudDevice.d.ts +0 -9
- package/dist/device/cloud/interfaces/ICloudDevice.js +0 -2
- package/dist/device/cloud/interfaces/ICloudDeviceService.d.ts +0 -4
- package/dist/device/cloud/interfaces/ICloudDeviceService.js +0 -2
- package/dist/device/cloud/interfaces/IConnectionService.d.ts +0 -7
- package/dist/device/cloud/interfaces/IConnectionService.js +0 -2
- package/dist/device/cloud/interfaces/IDeviceConnectionService.d.ts +0 -7
- package/dist/device/cloud/interfaces/IDeviceConnectionService.js +0 -3
- package/dist/device/cloud/interfaces/IDeviceFactory.d.ts +0 -4
- package/dist/device/cloud/interfaces/IDeviceFactory.js +0 -2
- package/dist/device/cloud/interfaces/IDeviceService.d.ts +0 -8
- package/dist/device/cloud/interfaces/IDeviceService.js +0 -2
- package/dist/device/cloud/interfaces/IDevicesService.d.ts +0 -9
- package/dist/device/cloud/interfaces/IDevicesService.js +0 -2
- package/dist/device/cloud/interfaces/IHubService.d.ts +0 -5
- package/dist/device/cloud/interfaces/IHubService.js +0 -2
- package/dist/device/cloud/interfaces/IRawDataTransformer.d.ts +0 -4
- package/dist/device/cloud/interfaces/IRawDataTransformer.js +0 -2
- package/dist/device/cloud/interfaces/IRawDevice.d.ts +0 -17
- package/dist/device/cloud/interfaces/IRawDevice.js +0 -11
- package/dist/device/cloud/interfaces/index.d.ts +0 -5
- package/dist/device/cloud/interfaces/index.js +0 -21
- package/dist/device/cloud/services/CloudDevice.service.d.ts +0 -5
- package/dist/device/cloud/services/CloudDevice.service.js +0 -9
- package/dist/device/cloud/services/Connection.service.d.ts +0 -8
- package/dist/device/cloud/services/Connection.service.js +0 -6
- package/dist/device/cloud/services/Device.service.d.ts +0 -39
- package/dist/device/cloud/services/Device.service.js +0 -9
- package/dist/device/cloud/services/DeviceCloudService.d.ts +0 -42
- package/dist/device/cloud/services/DeviceCloudService.js +0 -59
- package/dist/device/cloud/services/DeviceHub.service.d.ts +0 -3
- package/dist/device/cloud/services/DeviceHub.service.js +0 -6
- package/dist/device/cloud/services/Hub.service.d.ts +0 -25
- package/dist/device/cloud/services/Hub.service.js +0 -9
- package/dist/device/cloud/services/SmartThingsDeviceService.d.ts +0 -38
- package/dist/device/cloud/services/SmartThingsDeviceService.js +0 -52
- package/dist/device/cloud/services/index.d.ts +0 -2
- package/dist/device/cloud/services/index.js +0 -18
- package/dist/device/cloud/types.d.ts +0 -52
- package/dist/device/cloud/types.js +0 -15
- package/dist/device/index.d.ts +0 -4
- package/dist/device/index.js +0 -20
- package/dist/device/local/entities/AlertBuilder.d.ts +0 -87
- package/dist/device/local/entities/AlertBuilder.example.d.ts +0 -11
- package/dist/device/local/entities/AlertBuilder.example.js +0 -117
- package/dist/device/local/entities/AlertBuilder.js +0 -179
- package/dist/device/local/entities/IssueBuilder.d.ts +0 -109
- package/dist/device/local/entities/IssueBuilder.example.d.ts +0 -16
- package/dist/device/local/entities/IssueBuilder.example.js +0 -196
- package/dist/device/local/entities/IssueBuilder.js +0 -237
- package/dist/device/local/entities/index.d.ts +0 -2
- package/dist/device/local/entities/index.js +0 -7
- package/dist/device/local/events/EventHandler.d.ts +0 -11
- package/dist/device/local/events/EventHandler.js +0 -86
- package/dist/device/local/events/Events.d.ts +0 -54
- package/dist/device/local/events/Events.js +0 -57
- package/dist/device/local/events/index.d.ts +0 -2
- package/dist/device/local/events/index.js +0 -7
- package/dist/device/local/handler/EventHandler.d.ts +0 -7
- package/dist/device/local/handler/EventHandler.js +0 -44
- package/dist/device/local/interface.d.ts +0 -0
- package/dist/device/local/interface.js +0 -1
- package/dist/device/local/interfaces/IConnection.d.ts +0 -26
- package/dist/device/local/interfaces/IConnection.js +0 -14
- package/dist/device/local/interfaces/IDevice.d.ts +0 -68
- package/dist/device/local/interfaces/IDevice.js +0 -10
- package/dist/device/local/interfaces/IDtDevice.d.ts +0 -16
- package/dist/device/local/interfaces/IDtDevice.js +0 -2
- package/dist/device/local/interfaces/IHub.d.ts +0 -46
- package/dist/device/local/interfaces/IHub.js +0 -2
- package/dist/device/local/interfaces/IProperty.d.ts +0 -29
- package/dist/device/local/interfaces/IProperty.js +0 -2
- package/dist/device/local/interfaces/ISchedule.d.ts +0 -25
- package/dist/device/local/interfaces/ISchedule.js +0 -2
- package/dist/device/local/interfaces/index.d.ts +0 -3
- package/dist/device/local/interfaces/index.js +0 -19
- package/dist/device/local/models/Alert.model.d.ts +0 -28
- package/dist/device/local/models/Alert.model.js +0 -222
- package/dist/device/local/models/Issue.model.d.ts +0 -28
- package/dist/device/local/models/Issue.model.js +0 -260
- package/dist/device/local/repository/Alert.repository.d.ts +0 -106
- package/dist/device/local/repository/Alert.repository.js +0 -374
- package/dist/device/local/repository/Connection.repository.d.ts +0 -8
- package/dist/device/local/repository/Connection.repository.js +0 -92
- package/dist/device/local/repository/Device.repository.d.ts +0 -30
- package/dist/device/local/repository/Device.repository.js +0 -325
- package/dist/device/local/repository/Hub.repository.d.ts +0 -13
- package/dist/device/local/repository/Hub.repository.js +0 -139
- package/dist/device/local/repository/Issue.repository.d.ts +0 -113
- package/dist/device/local/repository/Issue.repository.js +0 -401
- package/dist/device/local/repository/Property.repository.d.ts +0 -8
- package/dist/device/local/repository/Property.repository.js +0 -95
- package/dist/device/local/repository/Schedule.repository.d.ts +0 -9
- package/dist/device/local/repository/Schedule.repository.js +0 -109
- package/dist/device/local/services/Alert.service.d.ts +0 -137
- package/dist/device/local/services/Alert.service.js +0 -475
- package/dist/device/local/services/AlertService.example.d.ts +0 -55
- package/dist/device/local/services/AlertService.example.js +0 -148
- package/dist/device/local/services/Connection.service.d.ts +0 -8
- package/dist/device/local/services/Connection.service.js +0 -32
- package/dist/device/local/services/Device.service.d.ts +0 -40
- package/dist/device/local/services/Device.service.js +0 -391
- package/dist/device/local/services/DeviceHub.service.d.ts +0 -11
- package/dist/device/local/services/DeviceHub.service.js +0 -40
- package/dist/device/local/services/Hub.service.d.ts +0 -12
- package/dist/device/local/services/Hub.service.js +0 -107
- package/dist/device/local/services/Issue.service.d.ts +0 -168
- package/dist/device/local/services/Issue.service.js +0 -642
- package/dist/device/local/services/IssueService.example.d.ts +0 -68
- package/dist/device/local/services/IssueService.example.js +0 -177
- package/dist/device/local/services/Property.service.d.ts +0 -8
- package/dist/device/local/services/Property.service.js +0 -36
- package/dist/device/local/services/Schedule.service.d.ts +0 -9
- package/dist/device/local/services/Schedule.service.js +0 -26
- package/dist/device/local/services/index.d.ts +0 -3
- package/dist/device/local/services/index.js +0 -19
- package/dist/pms/IPms.d.ts +0 -6
- package/dist/pms/IPms.js +0 -10
- package/dist/pms/index.d.ts +0 -1
- package/dist/pms/index.js +0 -17
- package/dist/property/IProperty.d.ts +0 -29
- package/dist/property/IProperty.js +0 -2
- package/dist/property/Property.repository.d.ts +0 -8
- package/dist/property/Property.repository.js +0 -109
- package/dist/property/Property.service.d.ts +0 -8
- package/dist/property/Property.service.js +0 -124
- package/dist/property/index.d.ts +0 -2
- package/dist/property/index.js +0 -18
- package/dist/queue/interfaces/IHttpRequestJob.d.ts +0 -9
- package/dist/queue/interfaces/IHttpRequestJob.js +0 -2
- package/dist/types/alert.types.d.ts +0 -57
- package/dist/types/alert.types.js +0 -22
- package/dist/types/config.types.d.ts +0 -19
- package/dist/types/config.types.js +0 -2
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.js +0 -19
- package/dist/types/issue.types.d.ts +0 -90
- package/dist/types/issue.types.js +0 -40
- package/dist/utils/http-utils.d.ts +0 -13
- package/dist/utils/http-utils.js +0 -117
|
@@ -13,7 +13,7 @@ interface IAlertModel extends Model<IAlertDocument, {}, IAlertMethods> {
|
|
|
13
13
|
findSnoozed(includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
14
14
|
findExpiredSnooze(includeDeleted?: boolean): Promise<IAlertDocument[]>;
|
|
15
15
|
}
|
|
16
|
-
declare const AlertSchema: mongoose.Schema<IAlertDocument, IAlertModel, IAlertMethods, {}, {}, {}, mongoose.DefaultSchemaOptions, IAlertDocument, mongoose.Document<unknown, {}, mongoose.FlatRecord<IAlertDocument>, {}
|
|
16
|
+
declare const AlertSchema: mongoose.Schema<IAlertDocument, IAlertModel, IAlertMethods, {}, {}, {}, mongoose.DefaultSchemaOptions, IAlertDocument, mongoose.Document<unknown, {}, mongoose.FlatRecord<IAlertDocument>, {}, mongoose.ResolveSchemaOptions<mongoose.DefaultSchemaOptions>> & Omit<mongoose.FlatRecord<IAlertDocument> & Required<{
|
|
17
17
|
_id: string;
|
|
18
18
|
}> & {
|
|
19
19
|
__v: number;
|
|
@@ -22,12 +22,9 @@ export declare class AlertService {
|
|
|
22
22
|
raiseDoorLeftOpenAlert(device: IDevice, zone: any, openThreshold: number, source: Source): Promise<IAlertDocument | null>;
|
|
23
23
|
raiseNewDeviceAlert(device: {
|
|
24
24
|
deviceId: string;
|
|
25
|
-
deviceType:
|
|
26
|
-
type: any;
|
|
27
|
-
};
|
|
28
|
-
propertyId: string;
|
|
25
|
+
deviceType: string;
|
|
29
26
|
name: string;
|
|
30
|
-
},
|
|
27
|
+
}, propertyId: string, source: Source): Promise<IAlertDocument | null>;
|
|
31
28
|
raiseDoorOpenFrequentAlert(device: IDevice, zone: any, accessTimes: number, openThreshold: number, source: Source): Promise<IAlertDocument | null>;
|
|
32
29
|
raiseDoorOpenOutsideBusinessHoursAlert(device: IDevice, zone: any, source: Source): Promise<IAlertDocument | null>;
|
|
33
30
|
/**
|
|
@@ -176,14 +176,14 @@ let AlertService = (() => {
|
|
|
176
176
|
type: alert_types_1.AlertType.DOOR_LEFT_OPEN,
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
async raiseNewDeviceAlert(device,
|
|
179
|
+
async raiseNewDeviceAlert(device, propertyId, source) {
|
|
180
180
|
return await this.createAlert({
|
|
181
181
|
entityId: device.deviceId,
|
|
182
182
|
entityType: alert_types_1.EntityType.DEVICE,
|
|
183
|
-
entitySubType: device?.deviceType
|
|
184
|
-
propertyId:
|
|
183
|
+
entitySubType: device?.deviceType,
|
|
184
|
+
propertyId: propertyId,
|
|
185
185
|
title: "New Device Detected",
|
|
186
|
-
description:
|
|
186
|
+
description: `New device ${device.name} has been detected.`,
|
|
187
187
|
createdBy: source,
|
|
188
188
|
category: alert_types_1.AlertCategory.OPERATIONS,
|
|
189
189
|
severity: alert_types_1.AlertSeverity.INFO,
|
|
@@ -46,14 +46,7 @@ export declare const DT_EVENT_TYPES: {
|
|
|
46
46
|
};
|
|
47
47
|
BATTERY: {
|
|
48
48
|
REPLACED: string;
|
|
49
|
-
STATE: {
|
|
50
|
-
REPLACE: string;
|
|
51
|
-
};
|
|
52
49
|
LEVEL: {
|
|
53
|
-
ATTEMPT: {
|
|
54
|
-
SUCCESS: string;
|
|
55
|
-
FAILED: string;
|
|
56
|
-
};
|
|
57
50
|
UNKNOWN: string;
|
|
58
51
|
NORMAL: string;
|
|
59
52
|
LOW: string;
|
|
@@ -83,13 +76,6 @@ export declare const DT_EVENT_TYPES: {
|
|
|
83
76
|
UNPROCESSED: string;
|
|
84
77
|
UNHANDLED: string;
|
|
85
78
|
};
|
|
86
|
-
ISSUE: {
|
|
87
|
-
CREATED: string;
|
|
88
|
-
CANCELLED: string;
|
|
89
|
-
RESOLVED: string;
|
|
90
|
-
UPDATED: string;
|
|
91
|
-
DELETED: string;
|
|
92
|
-
};
|
|
93
79
|
};
|
|
94
80
|
CONNECTION: {
|
|
95
81
|
CREATE: {
|
|
@@ -189,6 +175,30 @@ export declare const DT_EVENT_TYPES: {
|
|
|
189
175
|
SUCCESS: string;
|
|
190
176
|
FAILED: string;
|
|
191
177
|
};
|
|
178
|
+
CANCEL: {
|
|
179
|
+
SUCCESS: string;
|
|
180
|
+
FAILED: string;
|
|
181
|
+
};
|
|
182
|
+
RESOLVE: {
|
|
183
|
+
SUCCESS: string;
|
|
184
|
+
FAILED: string;
|
|
185
|
+
};
|
|
186
|
+
IGNORE: {
|
|
187
|
+
SUCCESS: string;
|
|
188
|
+
FAILED: string;
|
|
189
|
+
};
|
|
190
|
+
CLOSE: {
|
|
191
|
+
SUCCESS: string;
|
|
192
|
+
FAILED: string;
|
|
193
|
+
};
|
|
194
|
+
IN_PROGRESS: {
|
|
195
|
+
SUCCESS: string;
|
|
196
|
+
FAILED: string;
|
|
197
|
+
};
|
|
198
|
+
ON_HOLD: {
|
|
199
|
+
SUCCESS: string;
|
|
200
|
+
FAILED: string;
|
|
201
|
+
};
|
|
192
202
|
};
|
|
193
203
|
ALERT: {
|
|
194
204
|
CREATE: {
|
|
@@ -204,5 +214,29 @@ export declare const DT_EVENT_TYPES: {
|
|
|
204
214
|
SUCCESS: string;
|
|
205
215
|
FAILED: string;
|
|
206
216
|
};
|
|
217
|
+
ACTIVATE: {
|
|
218
|
+
SUCCESS: string;
|
|
219
|
+
FAILED: string;
|
|
220
|
+
};
|
|
221
|
+
DEACTIVATE: {
|
|
222
|
+
SUCCESS: string;
|
|
223
|
+
FAILED: string;
|
|
224
|
+
};
|
|
225
|
+
SNOOZE: {
|
|
226
|
+
SUCCESS: string;
|
|
227
|
+
FAILED: string;
|
|
228
|
+
};
|
|
229
|
+
UNSNOOZE: {
|
|
230
|
+
SUCCESS: string;
|
|
231
|
+
FAILED: string;
|
|
232
|
+
};
|
|
233
|
+
MARK_AS_READ: {
|
|
234
|
+
SUCCESS: string;
|
|
235
|
+
FAILED: string;
|
|
236
|
+
};
|
|
237
|
+
MARK_AS_UNREAD: {
|
|
238
|
+
SUCCESS: string;
|
|
239
|
+
FAILED: string;
|
|
240
|
+
};
|
|
207
241
|
};
|
|
208
242
|
};
|
package/dist/constants/Event.js
CHANGED
|
@@ -49,14 +49,7 @@ exports.DT_EVENT_TYPES = {
|
|
|
49
49
|
},
|
|
50
50
|
BATTERY: {
|
|
51
51
|
REPLACED: "device.battery.replaced",
|
|
52
|
-
STATE: {
|
|
53
|
-
REPLACE: "device.battery.state.replace",
|
|
54
|
-
},
|
|
55
52
|
LEVEL: {
|
|
56
|
-
ATTEMPT: {
|
|
57
|
-
SUCCESS: "device.battery.level.attempt.success",
|
|
58
|
-
FAILED: "device.battery.level.attempt.failed",
|
|
59
|
-
},
|
|
60
53
|
UNKNOWN: "device.battery.level.unknown",
|
|
61
54
|
NORMAL: "device.battery.level.normal",
|
|
62
55
|
LOW: "device.battery.level.low",
|
|
@@ -86,13 +79,6 @@ exports.DT_EVENT_TYPES = {
|
|
|
86
79
|
UNPROCESSED: "device.webhook.unprocessed",
|
|
87
80
|
UNHANDLED: "device.webhook.unhandled",
|
|
88
81
|
},
|
|
89
|
-
ISSUE: {
|
|
90
|
-
CREATED: "device.issue.created",
|
|
91
|
-
CANCELLED: "device.issue.cancelled",
|
|
92
|
-
RESOLVED: "device.issue.resolved",
|
|
93
|
-
UPDATED: "device.issue.updated",
|
|
94
|
-
DELETED: "device.issue.deleted",
|
|
95
|
-
},
|
|
96
82
|
},
|
|
97
83
|
CONNECTION: {
|
|
98
84
|
CREATE: {
|
|
@@ -192,6 +178,30 @@ exports.DT_EVENT_TYPES = {
|
|
|
192
178
|
SUCCESS: "issue.delete.success",
|
|
193
179
|
FAILED: "issue.delete.failed",
|
|
194
180
|
},
|
|
181
|
+
CANCEL: {
|
|
182
|
+
SUCCESS: "issue.cancel.success",
|
|
183
|
+
FAILED: "issue.cancel.failed",
|
|
184
|
+
},
|
|
185
|
+
RESOLVE: {
|
|
186
|
+
SUCCESS: "issue.resolve.success",
|
|
187
|
+
FAILED: "issue.resolve.failed",
|
|
188
|
+
},
|
|
189
|
+
IGNORE: {
|
|
190
|
+
SUCCESS: "issue.ignore.success",
|
|
191
|
+
FAILED: "issue.ignore.failed",
|
|
192
|
+
},
|
|
193
|
+
CLOSE: {
|
|
194
|
+
SUCCESS: "issue.close.success",
|
|
195
|
+
FAILED: "issue.close.failed",
|
|
196
|
+
},
|
|
197
|
+
IN_PROGRESS: {
|
|
198
|
+
SUCCESS: "issue.in_progress.success",
|
|
199
|
+
FAILED: "issue.in_progress.failed",
|
|
200
|
+
},
|
|
201
|
+
ON_HOLD: {
|
|
202
|
+
SUCCESS: "issue.on_hold.success",
|
|
203
|
+
FAILED: "issue.on_hold.failed",
|
|
204
|
+
},
|
|
195
205
|
},
|
|
196
206
|
ALERT: {
|
|
197
207
|
CREATE: {
|
|
@@ -207,5 +217,29 @@ exports.DT_EVENT_TYPES = {
|
|
|
207
217
|
SUCCESS: "alert.delete.success",
|
|
208
218
|
FAILED: "alert.delete.failed",
|
|
209
219
|
},
|
|
220
|
+
ACTIVATE: {
|
|
221
|
+
SUCCESS: "alert.activate.success",
|
|
222
|
+
FAILED: "alert.activate.failed",
|
|
223
|
+
},
|
|
224
|
+
DEACTIVATE: {
|
|
225
|
+
SUCCESS: "alert.deactivate.success",
|
|
226
|
+
FAILED: "alert.deactivate.failed",
|
|
227
|
+
},
|
|
228
|
+
SNOOZE: {
|
|
229
|
+
SUCCESS: "alert.snooze.success",
|
|
230
|
+
FAILED: "alert.snooze.failed",
|
|
231
|
+
},
|
|
232
|
+
UNSNOOZE: {
|
|
233
|
+
SUCCESS: "alert.unsnooze.success",
|
|
234
|
+
FAILED: "alert.unsnooze.failed",
|
|
235
|
+
},
|
|
236
|
+
MARK_AS_READ: {
|
|
237
|
+
SUCCESS: "alert.mark_as_read.success",
|
|
238
|
+
FAILED: "alert.mark_as_read.failed",
|
|
239
|
+
},
|
|
240
|
+
MARK_AS_UNREAD: {
|
|
241
|
+
SUCCESS: "alert.mark_as_unread.success",
|
|
242
|
+
FAILED: "alert.mark_as_unread.failed",
|
|
243
|
+
},
|
|
210
244
|
},
|
|
211
245
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { IAccessGroup } from "./IAccessGroup";
|
|
1
2
|
export declare class AccessGroupRepository {
|
|
2
3
|
private readonly postgres;
|
|
3
4
|
constructor();
|
|
4
|
-
getAccessGroup(accessGroupId: string): Promise<
|
|
5
|
+
getAccessGroup(accessGroupId: string): Promise<IAccessGroup | null>;
|
|
5
6
|
}
|
|
@@ -56,7 +56,10 @@ let AccessGroupRepository = (() => {
|
|
|
56
56
|
WHERE "id" = $1
|
|
57
57
|
`;
|
|
58
58
|
const result = await this.postgres.query(query, [accessGroupId]);
|
|
59
|
-
|
|
59
|
+
if (result.rows.length > 0) {
|
|
60
|
+
return result.rows[0];
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
60
63
|
}
|
|
61
64
|
};
|
|
62
65
|
__setFunctionName(_classThis, "AccessGroupRepository");
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { IAccessGroup } from "./IAccessGroup";
|
|
1
2
|
export declare class AccessGroupService {
|
|
2
3
|
private readonly accessGroupRepository;
|
|
3
4
|
constructor();
|
|
4
|
-
getAccessGroup(accessGroupId: string): Promise<
|
|
5
|
+
getAccessGroup(accessGroupId: string): Promise<IAccessGroup | null>;
|
|
5
6
|
}
|
|
@@ -87,7 +87,10 @@ let AccessGroupService = (() => {
|
|
|
87
87
|
if (!accessGroupId) {
|
|
88
88
|
throw new Error("Access Group ID is required");
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
const accessGroup = await this.accessGroupRepository.getAccessGroup(accessGroupId);
|
|
91
|
+
if (!accessGroup)
|
|
92
|
+
return null;
|
|
93
|
+
return accessGroup;
|
|
91
94
|
}
|
|
92
95
|
};
|
|
93
96
|
__setFunctionName(_classThis, "AccessGroupService");
|
|
@@ -101,5 +104,3 @@ let AccessGroupService = (() => {
|
|
|
101
104
|
return AccessGroupService = _classThis;
|
|
102
105
|
})();
|
|
103
106
|
exports.AccessGroupService = AccessGroupService;
|
|
104
|
-
// Accessgroup.getAccessGroup(accessGroupId)
|
|
105
|
-
// GetAccessGroup()
|
|
@@ -52,8 +52,11 @@ let GuestRepository = (() => {
|
|
|
52
52
|
}
|
|
53
53
|
async getGuest(guestId) {
|
|
54
54
|
try {
|
|
55
|
-
const guest = await this.pmsPostgres.query(`SELECT * FROM
|
|
56
|
-
|
|
55
|
+
const guest = await this.pmsPostgres.query(`SELECT * FROM dt_guest WHERE "id" = $1`, [guestId]);
|
|
56
|
+
if (guest.rows.length > 0) {
|
|
57
|
+
return guest.rows[0];
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
57
60
|
}
|
|
58
61
|
catch (error) {
|
|
59
62
|
console.error("Error in getGuest:", error);
|
|
@@ -88,7 +88,10 @@ let GuestService = (() => {
|
|
|
88
88
|
if (!guestId) {
|
|
89
89
|
throw new Error("Guest ID is required");
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
const guest = await this.guestRepository.getGuest(guestId);
|
|
92
|
+
if (!guest)
|
|
93
|
+
return null;
|
|
94
|
+
return guest;
|
|
92
95
|
}
|
|
93
96
|
};
|
|
94
97
|
__setFunctionName(_classThis, "GuestService");
|
|
@@ -52,8 +52,11 @@ let ScheduleRepository = (() => {
|
|
|
52
52
|
}
|
|
53
53
|
async getSchedule(scheduleId) {
|
|
54
54
|
try {
|
|
55
|
-
const schedule = await this.pmsPostgres.query(`SELECT * FROM
|
|
56
|
-
|
|
55
|
+
const schedule = await this.pmsPostgres.query(`SELECT * FROM dt_schedule WHERE "id" = $1`, [scheduleId]);
|
|
56
|
+
if (schedule.rows.length > 0) {
|
|
57
|
+
return schedule.rows[0];
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
57
60
|
}
|
|
58
61
|
catch (error) {
|
|
59
62
|
console.error("Error in getSchedule:", error);
|
|
@@ -88,7 +88,10 @@ let ScheduleService = (() => {
|
|
|
88
88
|
if (!scheduleId) {
|
|
89
89
|
throw new Error("Schedule ID is required");
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
const schedule = await this.scheduleRepository.getSchedule(scheduleId);
|
|
92
|
+
if (!schedule)
|
|
93
|
+
return null;
|
|
94
|
+
return schedule;
|
|
92
95
|
}
|
|
93
96
|
};
|
|
94
97
|
__setFunctionName(_classThis, "ScheduleService");
|
|
@@ -52,7 +52,10 @@ let UserRepository = (() => {
|
|
|
52
52
|
}
|
|
53
53
|
async getUser(userId) {
|
|
54
54
|
const user = await this.postgres.query(`SELECT * FROM dt_users WHERE "id" = $1`, [userId]);
|
|
55
|
-
|
|
55
|
+
if (user.rows.length > 0) {
|
|
56
|
+
return user.rows[0];
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
56
59
|
}
|
|
57
60
|
};
|
|
58
61
|
__setFunctionName(_classThis, "UserRepository");
|
|
@@ -87,7 +87,10 @@ let UserService = (() => {
|
|
|
87
87
|
if (!userId) {
|
|
88
88
|
throw new Error("User ID is required");
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
const user = await this.userRepository.getUser(userId);
|
|
91
|
+
if (!user)
|
|
92
|
+
return null;
|
|
93
|
+
return user;
|
|
91
94
|
}
|
|
92
95
|
};
|
|
93
96
|
__setFunctionName(_classThis, "UserService");
|
|
@@ -88,7 +88,10 @@ let ZoneService = (() => {
|
|
|
88
88
|
if (!zoneId) {
|
|
89
89
|
throw new Error("Zone ID is required");
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
const zone = await this.zoneRepository.getZone(zoneId);
|
|
92
|
+
if (!zone)
|
|
93
|
+
return null;
|
|
94
|
+
return zone;
|
|
92
95
|
}
|
|
93
96
|
};
|
|
94
97
|
__setFunctionName(_classThis, "ZoneService");
|
|
@@ -90,7 +90,7 @@ let DeviceEventHandler = (() => {
|
|
|
90
90
|
Event_1.DT_EVENT_TYPES.DEVICE.STATUS.ONLINE,
|
|
91
91
|
Event_1.DT_EVENT_TYPES.DEVICE.STATUS.OFFLINE,
|
|
92
92
|
Event_1.DT_EVENT_TYPES.DEVICE.STATUS.UNKNOWN,
|
|
93
|
-
Event_1.DT_EVENT_TYPES.DEVICE.BATTERY.
|
|
93
|
+
Event_1.DT_EVENT_TYPES.DEVICE.BATTERY.REPLACED,
|
|
94
94
|
Event_1.DT_EVENT_TYPES.DEVICE.BATTERY.LEVEL.UNKNOWN,
|
|
95
95
|
Event_1.DT_EVENT_TYPES.DEVICE.BATTERY.LEVEL.LOW,
|
|
96
96
|
Event_1.DT_EVENT_TYPES.DEVICE.BATTERY.LEVEL.CRITICAL,
|
|
@@ -14,7 +14,7 @@ interface IIssueModel extends Model<IIssueDocument, {}, IIssueMethods> {
|
|
|
14
14
|
findOverdue(includeDeleted?: boolean): Promise<IIssueDocument[]>;
|
|
15
15
|
findUpcoming(days?: number, includeDeleted?: boolean): Promise<IIssueDocument[]>;
|
|
16
16
|
}
|
|
17
|
-
declare const IssueSchema: mongoose.Schema<IIssueDocument, IIssueModel, IIssueMethods, {}, {}, {}, mongoose.DefaultSchemaOptions, IIssueDocument, mongoose.Document<unknown, {}, mongoose.FlatRecord<IIssueDocument>, {}
|
|
17
|
+
declare const IssueSchema: mongoose.Schema<IIssueDocument, IIssueModel, IIssueMethods, {}, {}, {}, mongoose.DefaultSchemaOptions, IIssueDocument, mongoose.Document<unknown, {}, mongoose.FlatRecord<IIssueDocument>, {}, mongoose.ResolveSchemaOptions<mongoose.DefaultSchemaOptions>> & Omit<mongoose.FlatRecord<IIssueDocument> & Required<{
|
|
18
18
|
_id: string;
|
|
19
19
|
}> & {
|
|
20
20
|
__v: number;
|
|
@@ -49,12 +49,9 @@ export declare class IssueService {
|
|
|
49
49
|
createDeviceBatteryIssue(device: IDevice, batteryLevel: number, threshold: number, priority: IssuePriority, source: Source): Promise<IIssueDocument | null>;
|
|
50
50
|
createAccountMissingDeviceIssue(device: {
|
|
51
51
|
deviceId: string;
|
|
52
|
-
deviceType:
|
|
53
|
-
type: any;
|
|
54
|
-
};
|
|
55
|
-
propertyId: string;
|
|
52
|
+
deviceType: string;
|
|
56
53
|
name: string;
|
|
57
|
-
},
|
|
54
|
+
}, propertyId: string, source: Source): Promise<IIssueDocument | null>;
|
|
58
55
|
createAccountUnauthorizedIssue(account: {
|
|
59
56
|
accountId: string;
|
|
60
57
|
accountType: EntitySubType;
|
|
@@ -273,14 +273,14 @@ let IssueService = (() => {
|
|
|
273
273
|
type: issue_types_1.IssueType.BATTERY_LOW,
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
|
-
async createAccountMissingDeviceIssue(device,
|
|
276
|
+
async createAccountMissingDeviceIssue(device, propertyId, source) {
|
|
277
277
|
return await this.createIssue({
|
|
278
278
|
entityId: device.deviceId,
|
|
279
279
|
entityType: issue_types_1.EntityType.DEVICE,
|
|
280
|
-
entitySubType: device.deviceType
|
|
281
|
-
propertyId:
|
|
280
|
+
entitySubType: device.deviceType,
|
|
281
|
+
propertyId: propertyId,
|
|
282
282
|
title: "Device Missing",
|
|
283
|
-
description: `${device.name} is missing from the account.
|
|
283
|
+
description: `${device.name} is missing from the account. Requires Attention.`,
|
|
284
284
|
createdBy: source,
|
|
285
285
|
category: issue_types_1.IssuesCategory.OPERATIONS,
|
|
286
286
|
priority: issue_types_1.IssuePriority.CRITICAL,
|
package/package.json
CHANGED