@ray-js/api 1.4.34 → 1.4.36
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/lib/cloud/doorlock.d.ts +36 -0
- package/lib/cloud/doorlock.js +101 -0
- package/lib/cloud/index.d.ts +1 -0
- package/lib/cloud/index.js +4 -1
- package/package.json +5 -5
@@ -0,0 +1,36 @@
|
|
1
|
+
export declare const getUiConfig: (productId: any, productConfigTimestamp?: string, productPanelPowerTimestamp?: string) => void;
|
2
|
+
export declare const getUserRegion: () => void;
|
3
|
+
/**
|
4
|
+
* 获取门锁最新日志
|
5
|
+
* @param params {devId: string}
|
6
|
+
* @returns
|
7
|
+
*/
|
8
|
+
export declare const getLockLatestLog: (params: {
|
9
|
+
devId: string;
|
10
|
+
}) => void;
|
11
|
+
/**
|
12
|
+
* 获取门锁安全天数
|
13
|
+
* @param param {devId: string}
|
14
|
+
* @returns
|
15
|
+
*/
|
16
|
+
export declare const getLockActivePeriod: ({ devId }: {
|
17
|
+
devId: string;
|
18
|
+
}) => void;
|
19
|
+
/**
|
20
|
+
* 获取门锁成员信息
|
21
|
+
* @param param {devId: string, userId?: string}
|
22
|
+
* @returns
|
23
|
+
*/
|
24
|
+
export declare const getLockMemberInfo: ({ devId, userId }: {
|
25
|
+
devId: string;
|
26
|
+
userId?: string | undefined;
|
27
|
+
}) => void;
|
28
|
+
/**
|
29
|
+
* 远程开门
|
30
|
+
* @param param { devId: string, open: boolean }
|
31
|
+
* @returns
|
32
|
+
*/
|
33
|
+
export declare const remoteLockExecute: ({ devId, open }: {
|
34
|
+
devId: string;
|
35
|
+
open: boolean;
|
36
|
+
}) => void;
|
@@ -0,0 +1,101 @@
|
|
1
|
+
// 门锁模版中涉及到的atop接口,暂时封装,后续会根据实际情况进行封装。
|
2
|
+
import { THING } from '../constants';
|
3
|
+
import requestCloud from '../requestCloud';
|
4
|
+
|
5
|
+
// 获取云能力
|
6
|
+
export const getUiConfig = function (productId) {
|
7
|
+
let productConfigTimestamp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '0';
|
8
|
+
let productPanelPowerTimestamp = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '0';
|
9
|
+
return requestCloud({
|
10
|
+
api: `${THING}.m.app.panel.info.get`,
|
11
|
+
version: '2.0',
|
12
|
+
data: {
|
13
|
+
productId,
|
14
|
+
productConfigTimestamp,
|
15
|
+
productPanelPowerTimestamp,
|
16
|
+
options: 'uiContent,cloudDp,powerCode'
|
17
|
+
}
|
18
|
+
});
|
19
|
+
};
|
20
|
+
|
21
|
+
// 获取当前帐号所属地区
|
22
|
+
export const getUserRegion = () => {
|
23
|
+
return requestCloud({
|
24
|
+
api: `${THING}.m.user.region.get`,
|
25
|
+
version: '1.0',
|
26
|
+
data: {}
|
27
|
+
});
|
28
|
+
};
|
29
|
+
|
30
|
+
/**
|
31
|
+
* 获取门锁最新日志
|
32
|
+
* @param params {devId: string}
|
33
|
+
* @returns
|
34
|
+
*/
|
35
|
+
export const getLockLatestLog = params => {
|
36
|
+
return requestCloud({
|
37
|
+
api: `${THING}.m.device.lock.log.latest`,
|
38
|
+
version: '1.0',
|
39
|
+
data: {
|
40
|
+
devId: params.devId
|
41
|
+
}
|
42
|
+
});
|
43
|
+
};
|
44
|
+
|
45
|
+
/**
|
46
|
+
* 获取门锁安全天数
|
47
|
+
* @param param {devId: string}
|
48
|
+
* @returns
|
49
|
+
*/
|
50
|
+
export const getLockActivePeriod = _ref => {
|
51
|
+
let {
|
52
|
+
devId
|
53
|
+
} = _ref;
|
54
|
+
return requestCloud({
|
55
|
+
api: `${THING}.m.device.lock.active.period`,
|
56
|
+
version: '1.0',
|
57
|
+
data: {
|
58
|
+
devId
|
59
|
+
}
|
60
|
+
});
|
61
|
+
};
|
62
|
+
|
63
|
+
/**
|
64
|
+
* 获取门锁成员信息
|
65
|
+
* @param param {devId: string, userId?: string}
|
66
|
+
* @returns
|
67
|
+
*/
|
68
|
+
export const getLockMemberInfo = _ref2 => {
|
69
|
+
let {
|
70
|
+
devId,
|
71
|
+
userId
|
72
|
+
} = _ref2;
|
73
|
+
return requestCloud({
|
74
|
+
api: `${THING}.m.device.member.panel.get`,
|
75
|
+
version: '1.0',
|
76
|
+
data: {
|
77
|
+
devId: devId,
|
78
|
+
userId: userId || ''
|
79
|
+
}
|
80
|
+
});
|
81
|
+
};
|
82
|
+
|
83
|
+
/**
|
84
|
+
* 远程开门
|
85
|
+
* @param param { devId: string, open: boolean }
|
86
|
+
* @returns
|
87
|
+
*/
|
88
|
+
export const remoteLockExecute = _ref3 => {
|
89
|
+
let {
|
90
|
+
devId,
|
91
|
+
open
|
92
|
+
} = _ref3;
|
93
|
+
return requestCloud({
|
94
|
+
api: `${THING}.m.zigbee.lock.remotepwd.execute`,
|
95
|
+
version: '1.0',
|
96
|
+
data: {
|
97
|
+
devId: devId,
|
98
|
+
open
|
99
|
+
}
|
100
|
+
});
|
101
|
+
};
|
package/lib/cloud/index.d.ts
CHANGED
package/lib/cloud/index.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/api",
|
3
|
-
"version": "1.4.
|
3
|
+
"version": "1.4.36",
|
4
4
|
"description": "Ray universal api",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -29,14 +29,14 @@
|
|
29
29
|
"watch": "ray start --type=component"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@ray-js/framework": "1.4.
|
33
|
-
"@ray-js/router": "1.4.
|
32
|
+
"@ray-js/framework": "1.4.36",
|
33
|
+
"@ray-js/router": "1.4.36",
|
34
34
|
"@ray-js/wechat": "^0.0.33",
|
35
35
|
"base64-browser": "^1.0.1",
|
36
36
|
"query-string": "^7.1.3"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
|
-
"@ray-js/cli": "1.4.
|
39
|
+
"@ray-js/cli": "1.4.36",
|
40
40
|
"art-template": "^4.13.2",
|
41
41
|
"fs-extra": "^10.1.0",
|
42
42
|
"miniprogram-api-typings": "^3.12.2",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"access": "public",
|
47
47
|
"registry": "https://registry.npmjs.org"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "9037ef50343f4364daff62e5d2beee13117dc8b3"
|
50
50
|
}
|