dt-common-device 1.0.7 → 1.0.8

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.
@@ -22,6 +22,12 @@ export declare abstract class DeviceService implements IDeviceService {
22
22
  zone?: {
23
23
  id: string;
24
24
  name: string;
25
+ zoneType: string;
26
+ parentZone?: {
27
+ id: string;
28
+ name: string;
29
+ zoneType: string;
30
+ };
25
31
  };
26
32
  connection: IConnection;
27
33
  constructor(device: IDevice);
@@ -1,5 +1,24 @@
1
1
  import { IHubService } from "../interfaces";
2
+ import { IConnection, IDevice } from "../types";
2
3
  export declare abstract class HubService implements IHubService {
4
+ deviceId: string;
5
+ propertyId: string;
6
+ name: string;
7
+ deviceType: {
8
+ id: string;
9
+ type: string;
10
+ };
11
+ status: {
12
+ online: boolean;
13
+ error?: {
14
+ type?: string;
15
+ message?: string;
16
+ };
17
+ lastUpdated?: string;
18
+ };
19
+ metaData?: Record<string, any>;
20
+ connection: IConnection;
21
+ constructor(hub: IDevice);
3
22
  abstract getHubs(connectionId: string): Promise<any[] | null>;
4
23
  abstract getHub(connectionId: string, hubId: string): Promise<Record<string, any>>;
5
24
  abstract getStatus(connectionId: string, hubId: string): Promise<string>;
@@ -2,5 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HubService = void 0;
4
4
  class HubService {
5
+ constructor(hub) {
6
+ Object.assign(this, hub);
7
+ }
5
8
  }
6
9
  exports.HubService = HubService;
@@ -15,6 +15,7 @@ export interface IConnection {
15
15
  clientId?: string;
16
16
  clientSecret?: string;
17
17
  isActive?: boolean;
18
+ metaData?: any;
18
19
  }
19
20
  export interface IConnectionPagination {
20
21
  page: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dt-common-device",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -21,7 +21,12 @@ export abstract class DeviceService implements IDeviceService {
21
21
  };
22
22
  state?: Record<string, any>;
23
23
  metaData?: Record<string, any>;
24
- zone?: { id: string; name: string };
24
+ zone?: {
25
+ id: string;
26
+ name: string;
27
+ zoneType: string;
28
+ parentZone?: { id: string; name: string; zoneType: string };
29
+ };
25
30
  connection!: IConnection;
26
31
 
27
32
  constructor(device: IDevice) {
@@ -1,6 +1,30 @@
1
1
  import { IHubService } from "../interfaces";
2
+ import { IConnection, IDevice } from "../types";
2
3
 
3
4
  export abstract class HubService implements IHubService {
5
+ // IDevice properties
6
+ deviceId!: string;
7
+ propertyId!: string;
8
+ name!: string;
9
+ deviceType!: {
10
+ id: string;
11
+ type: string;
12
+ };
13
+ status!: {
14
+ online: boolean;
15
+ error?: {
16
+ type?: string;
17
+ message?: string;
18
+ };
19
+ lastUpdated?: string;
20
+ };
21
+ metaData?: Record<string, any>;
22
+ connection!: IConnection;
23
+
24
+ constructor(hub: IDevice) {
25
+ Object.assign(this, hub);
26
+ }
27
+
4
28
  abstract getHubs(connectionId: string): Promise<any[] | null>;
5
29
  abstract getHub(
6
30
  connectionId: string,
@@ -17,6 +17,7 @@ export interface IConnection {
17
17
  clientId?: string;
18
18
  clientSecret?: string;
19
19
  isActive?: boolean;
20
+ metaData?: any;
20
21
  }
21
22
 
22
23
  export interface IConnectionPagination {