dt-common-device 7.8.13 → 7.8.15

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.
@@ -137,6 +137,9 @@ let AuditUtils = (() => {
137
137
  if (propertyId === "triggered_externally") {
138
138
  audit.propertyName = "Triggered Externally";
139
139
  }
140
+ else if (propertyId === "property_not_found") {
141
+ audit.propertyName = "Property Not Found";
142
+ }
140
143
  else {
141
144
  audit.propertyName = await this.getPropertyName(propertyId);
142
145
  }
@@ -23,6 +23,8 @@ exports.CONFIG_KEYS = {
23
23
  "AWS_SQS_URL",
24
24
  "RESERVATION_SQS_URL",
25
25
  "ADMIN_SERVICE",
26
+ "CRONICLE_ENDPOINT",
27
+ "CRONICLE_API_KEY",
26
28
  ],
27
29
  INTERNAL_EVENT_HANDLER: true,
28
30
  db_keys: {
@@ -137,7 +137,7 @@ let LocalDeviceService = (() => {
137
137
  await this.handleOnlineStatus(device, device.status, body.status, auditBody?.source || Service_1.Source.SYSTEM, auditBody);
138
138
  }
139
139
  else {
140
- await this.handleOfflineStatus(device, device.status, body.status, auditBody?.source || Service_1.Source.SYSTEM, auditBody);
140
+ await this.handleOfflineStatus(device, device.status, body.status, auditBody?.source || Service_1.Source.SYSTEM, auditBody, body.status.error?.message);
141
141
  }
142
142
  if (body.state?.batteryPercentage?.value) {
143
143
  await this.setBatteryLevel(deviceId, body.state?.batteryPercentage?.value, auditBody?.source || Service_1.Source.SYSTEM, auditBody);
@@ -278,8 +278,8 @@ let LocalDeviceService = (() => {
278
278
  await this.eventHandler.onStatusChangeMany(query, newStatus, auditBody, eventType);
279
279
  }
280
280
  async handleOfflineStatus(device, oldStatus, newStatus, source, auditBody, reason, currentTime) {
281
- const isExistingStatusOnline = oldStatus?.online === true;
282
- const isExistingStatusOffline = oldStatus?.online === false;
281
+ const isExistingStatusOnline = oldStatus?.liveStatus === "ONLINE";
282
+ const isExistingStatusOffline = oldStatus?.liveStatus === "OFFLINE";
283
283
  if (isExistingStatusOnline) {
284
284
  // Existing status is Online
285
285
  newStatus.online = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dt-common-device",
3
- "version": "7.8.13",
3
+ "version": "7.8.15",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [