dt-common-device 7.10.8 → 7.10.9

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.
@@ -1,5 +1,5 @@
1
1
  export declare class DeviceProfileRepository {
2
2
  private readonly axiosInstance;
3
3
  constructor();
4
- getDeviceBaseLine(deviceId: string): Promise<void>;
4
+ getDeviceBaseLine(deviceId: string): Promise<any>;
5
5
  }
@@ -41,6 +41,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
41
41
  exports.DeviceProfileRepository = void 0;
42
42
  const typedi_1 = require("typedi");
43
43
  const utils_1 = require("../../../../utils");
44
+ const config_1 = require("../../../../config/config");
44
45
  let DeviceProfileRepository = (() => {
45
46
  let _classDecorators = [(0, typedi_1.Service)()];
46
47
  let _classDescriptor;
@@ -50,7 +51,16 @@ let DeviceProfileRepository = (() => {
50
51
  constructor() {
51
52
  this.axiosInstance = (0, utils_1.getDeviceServiceAxiosInstance)();
52
53
  }
53
- async getDeviceBaseLine(deviceId) { }
54
+ async getDeviceBaseLine(deviceId) {
55
+ try {
56
+ const response = await this.axiosInstance.get(`/baseline/${deviceId}`);
57
+ return response.data;
58
+ }
59
+ catch (error) {
60
+ (0, config_1.getConfig)().LOGGER.error(`Failed to get device baseline for ${deviceId}:`, error);
61
+ throw new Error(`Failed to get device baseline: ${error.message || "Unknown error"}`);
62
+ }
63
+ }
54
64
  };
55
65
  __setFunctionName(_classThis, "DeviceProfileRepository");
56
66
  (() => {
@@ -27,9 +27,8 @@ class InternalEventSubscription {
27
27
  try {
28
28
  const eventType = message["detail-type"];
29
29
  const eventData = message.detail;
30
- //TODO: To be sent with event data, to delete the message if processing is failed!
31
- const eventToken = message.receiptHandle;
32
- console.log('eventToken', eventToken);
30
+ const MessageId = message.id;
31
+ eventData.MessageId = MessageId;
33
32
  this.logger.info(`Received internal event: ${eventType} ${eventData}`);
34
33
  switch (eventType) {
35
34
  case InternalEventType.HEARTBEAT:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dt-common-device",
3
- "version": "7.10.8",
3
+ "version": "7.10.9",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [