dt-common-device 1.0.15 → 1.0.16
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.
- package/dist/device/cloud/types.d.ts +9 -9
- package/dist/device/cloud/types.js +12 -0
- package/dist/device/local/services/Connection.service.d.ts +2 -1
- package/dist/device/local/services/Device.service.js +1 -1
- package/package.json +1 -1
- package/src/device/cloud/types.ts +10 -10
- package/src/device/local/services/Connection.service.ts +2 -1
- package/src/device/local/services/Device.service.ts +1 -1
|
@@ -39,13 +39,13 @@ export interface IConnectionConnectParams {
|
|
|
39
39
|
propertyId?: string;
|
|
40
40
|
[key: string]: unknown;
|
|
41
41
|
}
|
|
42
|
-
export
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
export declare enum ConnectionProvider {
|
|
43
|
+
Smartthings = "Smartthings",
|
|
44
|
+
SaltoKS = "SaltoKS",
|
|
45
|
+
TTLock = "TTLock",
|
|
46
|
+
Tuya = "Tuya",
|
|
47
|
+
Schlage = "Schlage",
|
|
48
|
+
YaleWifi = "YaleWifi",
|
|
49
|
+
Sensibo = "Sensibo",
|
|
50
|
+
Devicethread = "Devicethread"
|
|
51
51
|
}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Device Cloud Type Interfaces for DeviceThread Common Library
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ConnectionProvider = void 0;
|
|
5
|
+
var ConnectionProvider;
|
|
6
|
+
(function (ConnectionProvider) {
|
|
7
|
+
ConnectionProvider["Smartthings"] = "Smartthings";
|
|
8
|
+
ConnectionProvider["SaltoKS"] = "SaltoKS";
|
|
9
|
+
ConnectionProvider["TTLock"] = "TTLock";
|
|
10
|
+
ConnectionProvider["Tuya"] = "Tuya";
|
|
11
|
+
ConnectionProvider["Schlage"] = "Schlage";
|
|
12
|
+
ConnectionProvider["YaleWifi"] = "YaleWifi";
|
|
13
|
+
ConnectionProvider["Sensibo"] = "Sensibo";
|
|
14
|
+
ConnectionProvider["Devicethread"] = "Devicethread";
|
|
15
|
+
})(ConnectionProvider || (exports.ConnectionProvider = ConnectionProvider = {}));
|
|
@@ -153,7 +153,7 @@ class LocalDeviceService {
|
|
|
153
153
|
async getDevicesByAccessGroup(accessGroupId) {
|
|
154
154
|
try {
|
|
155
155
|
// Fetch from Postgres if not in cache
|
|
156
|
-
const result = await this.postgres.query("SELECT * FROM
|
|
156
|
+
const result = await this.postgres.query("SELECT * FROM dt_group WHERE id = $1", [accessGroupId]);
|
|
157
157
|
if (result.rows.length > 0) {
|
|
158
158
|
return result.rows[0];
|
|
159
159
|
}
|
package/package.json
CHANGED
|
@@ -45,13 +45,13 @@ export interface IConnectionConnectParams {
|
|
|
45
45
|
[key: string]: unknown;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
48
|
+
export enum ConnectionProvider {
|
|
49
|
+
Smartthings = "Smartthings",
|
|
50
|
+
SaltoKS = "SaltoKS",
|
|
51
|
+
TTLock = "TTLock",
|
|
52
|
+
Tuya = "Tuya",
|
|
53
|
+
Schlage = "Schlage",
|
|
54
|
+
YaleWifi = "YaleWifi",
|
|
55
|
+
Sensibo = "Sensibo",
|
|
56
|
+
Devicethread = "Devicethread",
|
|
57
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { getPostgresClient } from "../../../db";
|
|
2
|
+
import { IConnection } from "../interfaces/IConnection";
|
|
2
3
|
export class LocalConnectionService {
|
|
3
4
|
private readonly pool;
|
|
4
5
|
constructor() {
|
|
5
6
|
this.pool = getPostgresClient();
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
async getConnection(connectionId: string) {
|
|
9
|
+
async getConnection(connectionId: string): Promise<IConnection> {
|
|
9
10
|
const result = await this.pool.query(
|
|
10
11
|
"SELECT * FROM dt_connections WHERE id = $1",
|
|
11
12
|
[connectionId]
|
|
@@ -203,7 +203,7 @@ export class LocalDeviceService {
|
|
|
203
203
|
try {
|
|
204
204
|
// Fetch from Postgres if not in cache
|
|
205
205
|
const result = await this.postgres.query(
|
|
206
|
-
"SELECT * FROM
|
|
206
|
+
"SELECT * FROM dt_group WHERE id = $1",
|
|
207
207
|
[accessGroupId]
|
|
208
208
|
);
|
|
209
209
|
if (result.rows.length > 0) {
|