dt-common-device 7.10.3 → 7.10.5

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.
@@ -21,6 +21,10 @@ export declare class AlertService {
21
21
  raiseHubAlert(data: CreateAlertData): Promise<IAlertDocument | null>;
22
22
  raiseDeviceTamperAttemptAlert(device: IDevice, zone: any, source: Source): Promise<IAlertDocument | null>;
23
23
  raiseDoorLeftOpenAlert(device: IDevice, zone: any, openThreshold: number, source: Source): Promise<IAlertDocument | null>;
24
+ raiseIncorrectCodeAlert(device: IDevice, zone: any, source: Source, accessCount: number, timeWindow: {
25
+ startDate: string;
26
+ endDate: string;
27
+ }): Promise<IAlertDocument | null>;
24
28
  raiseNewDeviceAlert(device: {
25
29
  deviceId: string;
26
30
  deviceType: string;
@@ -192,6 +192,21 @@ let AlertService = (() => {
192
192
  type: alert_types_1.AlertType.DOOR_LEFT_OPEN,
193
193
  });
194
194
  }
195
+ async raiseIncorrectCodeAlert(device, zone, source, accessCount, timeWindow) {
196
+ return await this.createAlert({
197
+ entityId: device.deviceId,
198
+ entityType: alert_types_1.EntityType.DEVICE,
199
+ entitySubType: device.deviceType.type,
200
+ propertyId: device.propertyId,
201
+ zoneId: device.zoneId,
202
+ title: "Incorrect Code Used Too Many Times",
203
+ description: `Incorrect code used ${accessCount} times on ${zone?.name}. Between ${timeWindow.startDate} and ${timeWindow.endDate}.`,
204
+ createdBy: source,
205
+ category: alert_types_1.AlertCategory.SECURITY,
206
+ severity: alert_types_1.AlertSeverity.CRITICAL,
207
+ type: alert_types_1.AlertType.INCORRECT_CODE_USED,
208
+ });
209
+ }
195
210
  async raiseNewDeviceAlert(device, connection, propertyId, source) {
196
211
  return await this.createAlert({
197
212
  entityId: connection.id,
@@ -24,7 +24,8 @@ export declare enum AlertType {
24
24
  SPECIFIC_DOOR_ACCESS = "SPECIFIC_DOOR_ACCESS",
25
25
  GUEST_LOCK_FIRST_ACCESS = "GUEST_LOCK_FIRST_ACCESS",
26
26
  DEVICE_ONLINE = "DEVICE_ONLINE",
27
- ZONE_NOT_MAPPED_TO_ACCESS_GROUP = "ZONE_NOT_MAPPED_TO_ACCESS_GROUP"
27
+ ZONE_NOT_MAPPED_TO_ACCESS_GROUP = "ZONE_NOT_MAPPED_TO_ACCESS_GROUP",
28
+ INCORRECT_CODE_USED = "INCORRECT_CODE_USED"
28
29
  }
29
30
  export interface AlertDocument {
30
31
  _id: string;
@@ -30,6 +30,7 @@ var AlertType;
30
30
  AlertType["GUEST_LOCK_FIRST_ACCESS"] = "GUEST_LOCK_FIRST_ACCESS";
31
31
  AlertType["DEVICE_ONLINE"] = "DEVICE_ONLINE";
32
32
  AlertType["ZONE_NOT_MAPPED_TO_ACCESS_GROUP"] = "ZONE_NOT_MAPPED_TO_ACCESS_GROUP";
33
+ AlertType["INCORRECT_CODE_USED"] = "INCORRECT_CODE_USED";
33
34
  })(AlertType || (exports.AlertType = AlertType = {}));
34
35
  // Re-export EntityType from issue.types.ts to avoid duplication
35
36
  var issue_types_1 = require("../issues/issue.types");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dt-common-device",
3
- "version": "7.10.3",
3
+ "version": "7.10.5",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [