dt-common-device 7.6.1 → 7.6.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.
|
@@ -3,7 +3,6 @@ import { CreateAlertData, UpdateAlertData, AlertCategory, AlertSeverity, IAlertQ
|
|
|
3
3
|
import { AlertBuilder } from "./AlertBuilder";
|
|
4
4
|
import { IDevice } from "../entities/device/local/interfaces";
|
|
5
5
|
import { Source } from "../constants";
|
|
6
|
-
import { IUser } from "../entities/admin";
|
|
7
6
|
export declare class AlertService {
|
|
8
7
|
private readonly alertRepository;
|
|
9
8
|
constructor();
|
|
@@ -37,8 +36,8 @@ export declare class AlertService {
|
|
|
37
36
|
raiseDeviceOnlineAlert(device: IDevice, source: Source): Promise<IAlertDocument | null>;
|
|
38
37
|
raiseLockAccessEmergencyCodeAlert(device: IDevice, zone: any, source: Source): Promise<IAlertDocument | null>;
|
|
39
38
|
raiseLockAccessMasterCodeAlert(device: IDevice, zone: any, source: Source): Promise<IAlertDocument | null>;
|
|
40
|
-
raiseSpecificDoorAccessAlert(
|
|
41
|
-
raiseGuestLockFirstAccessAlert(
|
|
39
|
+
raiseSpecificDoorAccessAlert(userName: string, device: IDevice, zone: any, source: Source): Promise<IAlertDocument | null>;
|
|
40
|
+
raiseGuestLockFirstAccessAlert(userName: string, device: IDevice, zone: any, source: Source): Promise<IAlertDocument | null>;
|
|
42
41
|
/**
|
|
43
42
|
* Create a new alert with business logic validation
|
|
44
43
|
* Accepts either a CreateAlertData object or an AlertBuilder instance
|
|
@@ -268,7 +268,7 @@ let AlertService = (() => {
|
|
|
268
268
|
type: alert_types_1.AlertType.LOCK_ACCESS_MASTER_CODE,
|
|
269
269
|
});
|
|
270
270
|
}
|
|
271
|
-
async raiseSpecificDoorAccessAlert(
|
|
271
|
+
async raiseSpecificDoorAccessAlert(userName, device, zone, source) {
|
|
272
272
|
return await this.createAlert({
|
|
273
273
|
entityId: device.deviceId,
|
|
274
274
|
entityType: alert_types_1.EntityType.DEVICE,
|
|
@@ -276,14 +276,14 @@ let AlertService = (() => {
|
|
|
276
276
|
propertyId: device.propertyId,
|
|
277
277
|
zoneId: device.zoneId,
|
|
278
278
|
title: "Specific Door Access",
|
|
279
|
-
description: `${
|
|
279
|
+
description: `${userName} has accessed ${zone?.name}.`,
|
|
280
280
|
createdBy: source,
|
|
281
281
|
category: alert_types_1.AlertCategory.OTHER,
|
|
282
282
|
severity: alert_types_1.AlertSeverity.INFO,
|
|
283
283
|
type: alert_types_1.AlertType.SPECIFIC_DOOR_ACCESS,
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
|
-
async raiseGuestLockFirstAccessAlert(
|
|
286
|
+
async raiseGuestLockFirstAccessAlert(userName, device, zone, source) {
|
|
287
287
|
return await this.createAlert({
|
|
288
288
|
entityId: device.deviceId,
|
|
289
289
|
entityType: alert_types_1.EntityType.DEVICE,
|
|
@@ -291,7 +291,7 @@ let AlertService = (() => {
|
|
|
291
291
|
propertyId: device.propertyId,
|
|
292
292
|
zoneId: device.zoneId,
|
|
293
293
|
title: "Guest Used Code for First Time",
|
|
294
|
-
description: `${
|
|
294
|
+
description: `${userName} has used the code for the first time to access ${zone?.name}.`,
|
|
295
295
|
createdBy: source,
|
|
296
296
|
category: alert_types_1.AlertCategory.OTHER,
|
|
297
297
|
severity: alert_types_1.AlertSeverity.INFO,
|