@ray-js/lock-sdk 1.0.0-beta-1
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/api/index.d.ts +5 -0
- package/lib/api/index.js +18 -0
- package/lib/api/linkage.d.ts +161 -0
- package/lib/api/linkage.js +74 -0
- package/lib/api/lock.d.ts +195 -0
- package/lib/api/lock.js +129 -0
- package/lib/api/log.d.ts +166 -0
- package/lib/api/log.js +44 -0
- package/lib/api/setting.d.ts +14 -0
- package/lib/api/setting.js +36 -0
- package/lib/api/temp.d.ts +211 -0
- package/lib/api/temp.js +130 -0
- package/lib/api/user.d.ts +154 -0
- package/lib/api/user.js +59 -0
- package/lib/api/video.d.ts +9 -0
- package/lib/api/video.js +17 -0
- package/lib/config/dp-code/index.d.ts +175 -0
- package/lib/config/dp-code/index.js +224 -0
- package/lib/config/dp-map/common.d.ts +102 -0
- package/lib/config/dp-map/common.js +120 -0
- package/lib/config/dp-map/normal.d.ts +6 -0
- package/lib/config/dp-map/normal.js +51 -0
- package/lib/config/dp-map/open.d.ts +21 -0
- package/lib/config/dp-map/open.js +62 -0
- package/lib/config/dp-map/unlock-method-big.d.ts +559 -0
- package/lib/config/dp-map/unlock-method-big.js +237 -0
- package/lib/config/dp-map/unlock-method.d.ts +551 -0
- package/lib/config/dp-map/unlock-method.js +231 -0
- package/lib/config/index.d.ts +46 -0
- package/lib/config/index.js +56 -0
- package/lib/constant.d.ts +101 -0
- package/lib/constant.js +136 -0
- package/lib/dp-interface.d.ts +7 -0
- package/lib/dp-interface.js +1 -0
- package/lib/event.d.ts +8 -0
- package/lib/event.js +9 -0
- package/lib/index.d.ts +25 -0
- package/lib/index.js +92 -0
- package/lib/interface.d.ts +807 -0
- package/lib/interface.js +1 -0
- package/lib/linkage.d.ts +26 -0
- package/lib/linkage.js +175 -0
- package/lib/log.d.ts +91 -0
- package/lib/log.js +314 -0
- package/lib/media.d.ts +43 -0
- package/lib/media.js +80 -0
- package/lib/open.d.ts +48 -0
- package/lib/open.js +247 -0
- package/lib/other.d.ts +36 -0
- package/lib/other.js +178 -0
- package/lib/parse/index.d.ts +6 -0
- package/lib/parse/index.js +22 -0
- package/lib/signal.d.ts +26 -0
- package/lib/signal.js +38 -0
- package/lib/sleep.d.ts +61 -0
- package/lib/sleep.js +121 -0
- package/lib/state.d.ts +54 -0
- package/lib/state.js +429 -0
- package/lib/sync/remote-serect-key.d.ts +5 -0
- package/lib/sync/remote-serect-key.js +60 -0
- package/lib/sync/t0.d.ts +5 -0
- package/lib/sync/t0.js +33 -0
- package/lib/sync/temp.d.ts +7 -0
- package/lib/sync/temp.js +88 -0
- package/lib/sync/unlock-mothod.d.ts +5 -0
- package/lib/sync/unlock-mothod.js +54 -0
- package/lib/temporary.d.ts +226 -0
- package/lib/temporary.js +637 -0
- package/lib/unlock-method.d.ts +269 -0
- package/lib/unlock-method.js +723 -0
- package/lib/user.d.ts +108 -0
- package/lib/user.js +361 -0
- package/lib/utils/base64-to-hex.d.ts +1 -0
- package/lib/utils/base64-to-hex.js +12 -0
- package/lib/utils/byte.d.ts +19 -0
- package/lib/utils/byte.js +74 -0
- package/lib/utils/constant.d.ts +11 -0
- package/lib/utils/constant.js +17 -0
- package/lib/utils/device.d.ts +207 -0
- package/lib/utils/device.js +353 -0
- package/lib/utils/errors.d.ts +2 -0
- package/lib/utils/errors.js +125 -0
- package/lib/utils/event.d.ts +23 -0
- package/lib/utils/event.js +144 -0
- package/lib/utils/hex-to-base64.d.ts +1 -0
- package/lib/utils/hex-to-base64.js +8 -0
- package/lib/utils/hex-to-bytes.d.ts +6 -0
- package/lib/utils/hex-to-bytes.js +16 -0
- package/lib/utils/index.d.ts +169 -0
- package/lib/utils/index.js +419 -0
- package/lib/utils/log.d.ts +5 -0
- package/lib/utils/log.js +78 -0
- package/lib/utils/publishDps.d.ts +11 -0
- package/lib/utils/publishDps.js +91 -0
- package/package.json +37 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 开门方式配置
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { pwdConfigDpMap, validConfigDpMap } from "./common";
|
|
6
|
+
const common = [
|
|
7
|
+
// 开门方式
|
|
8
|
+
{
|
|
9
|
+
name: "type"
|
|
10
|
+
},
|
|
11
|
+
// 阶段(步骤)
|
|
12
|
+
{
|
|
13
|
+
name: "stage"
|
|
14
|
+
},
|
|
15
|
+
// 管理员标记
|
|
16
|
+
{
|
|
17
|
+
name: "admin",
|
|
18
|
+
type: "boolean",
|
|
19
|
+
defaultValue: false
|
|
20
|
+
},
|
|
21
|
+
// 成员 id
|
|
22
|
+
{
|
|
23
|
+
name: "memberId"
|
|
24
|
+
},
|
|
25
|
+
// 硬件id(开锁id)
|
|
26
|
+
{
|
|
27
|
+
name: "unlockId"
|
|
28
|
+
}];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 小容量开门方式配置
|
|
32
|
+
* 下发配置
|
|
33
|
+
*/
|
|
34
|
+
const add = [...common,
|
|
35
|
+
// 时效性,当为
|
|
36
|
+
validConfigDpMap,
|
|
37
|
+
// 有效次数
|
|
38
|
+
{
|
|
39
|
+
name: "validNum"
|
|
40
|
+
}, ...pwdConfigDpMap, {
|
|
41
|
+
name: "sn",
|
|
42
|
+
bytes: 2
|
|
43
|
+
}];
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 小容量开门方式配置
|
|
47
|
+
* 上报配置
|
|
48
|
+
*/
|
|
49
|
+
const reportAdd = [...common,
|
|
50
|
+
// 需录入的总次数
|
|
51
|
+
{
|
|
52
|
+
name: "total",
|
|
53
|
+
condition: {
|
|
54
|
+
prop: "stage",
|
|
55
|
+
value: 0
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
// 录入次数
|
|
59
|
+
{
|
|
60
|
+
name: "step",
|
|
61
|
+
condition: {
|
|
62
|
+
prop: "stage",
|
|
63
|
+
value: 0xfc
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
// 录入失败时,失败的阶段
|
|
67
|
+
{
|
|
68
|
+
name: "stageFail",
|
|
69
|
+
condition: {
|
|
70
|
+
prop: "stage",
|
|
71
|
+
value: 0xfd
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
// 无意义
|
|
75
|
+
{
|
|
76
|
+
name: "none",
|
|
77
|
+
condition: {
|
|
78
|
+
type: "and",
|
|
79
|
+
conditions: [{
|
|
80
|
+
prop: "stage",
|
|
81
|
+
value: 0,
|
|
82
|
+
operation: "neq"
|
|
83
|
+
}, {
|
|
84
|
+
prop: "stage",
|
|
85
|
+
value: 0xfc,
|
|
86
|
+
operation: "neq"
|
|
87
|
+
}, {
|
|
88
|
+
prop: "stage",
|
|
89
|
+
value: 0xfd,
|
|
90
|
+
operation: "neq"
|
|
91
|
+
}]
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
// 返回状态
|
|
95
|
+
{
|
|
96
|
+
name: "status"
|
|
97
|
+
}, {
|
|
98
|
+
name: "sn",
|
|
99
|
+
bytes: 2
|
|
100
|
+
}];
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* 小容量删除开门方式配置
|
|
104
|
+
* 上报配置
|
|
105
|
+
*/
|
|
106
|
+
const remove = [...common,
|
|
107
|
+
// 删除方式,0 表示删除全部开门方式,1 表示删除指定开门方式
|
|
108
|
+
{
|
|
109
|
+
name: "target"
|
|
110
|
+
}];
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* 小容量删除开门方式配置
|
|
114
|
+
* 下报配置
|
|
115
|
+
*/
|
|
116
|
+
const reportRemove = [...remove, {
|
|
117
|
+
name: "status"
|
|
118
|
+
}];
|
|
119
|
+
/**
|
|
120
|
+
* 小容量修改开门方式配置
|
|
121
|
+
* 下报配置
|
|
122
|
+
*/
|
|
123
|
+
const update = [...common, validConfigDpMap, {
|
|
124
|
+
name: "validNum"
|
|
125
|
+
}, ...pwdConfigDpMap];
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* 小容量修改开门方式配置,只修改成员角色
|
|
129
|
+
* 下发配置
|
|
130
|
+
*/
|
|
131
|
+
const updateMemberRole = common;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* 小容量删除开门方式配置
|
|
135
|
+
* 上报配置
|
|
136
|
+
*/
|
|
137
|
+
const reportUpdate = [...common, {
|
|
138
|
+
name: "validNum"
|
|
139
|
+
}, {
|
|
140
|
+
name: "status"
|
|
141
|
+
}];
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* 添加临时密码
|
|
145
|
+
* 下发配置
|
|
146
|
+
*/
|
|
147
|
+
const addTempPwd = [{
|
|
148
|
+
name: "cloudNo",
|
|
149
|
+
bytes: 2
|
|
150
|
+
}, {
|
|
151
|
+
name: "valid",
|
|
152
|
+
type: "boolean"
|
|
153
|
+
}, validConfigDpMap, {
|
|
154
|
+
name: "validNum"
|
|
155
|
+
}, ...pwdConfigDpMap];
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* 添加临时密码
|
|
159
|
+
* 上报配置
|
|
160
|
+
*/
|
|
161
|
+
const reportAddTempPwd = [{
|
|
162
|
+
name: "cloudNo",
|
|
163
|
+
bytes: 2
|
|
164
|
+
}, {
|
|
165
|
+
name: "unlockId"
|
|
166
|
+
}, {
|
|
167
|
+
name: "status"
|
|
168
|
+
}];
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* 删除临时密码
|
|
172
|
+
* 下发配置
|
|
173
|
+
*/
|
|
174
|
+
const removeTempPwd = [{
|
|
175
|
+
name: "unlockId"
|
|
176
|
+
}];
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* 删除临时密码
|
|
180
|
+
* 上报配置
|
|
181
|
+
*/
|
|
182
|
+
const reportRemoveTempPwd = [{
|
|
183
|
+
name: "unlockId"
|
|
184
|
+
}, {
|
|
185
|
+
name: "status"
|
|
186
|
+
}];
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* 修改临时密码
|
|
190
|
+
* 下发配置
|
|
191
|
+
*/
|
|
192
|
+
const updateTempPwd = [{
|
|
193
|
+
name: "unlockId"
|
|
194
|
+
}, {
|
|
195
|
+
name: "valid",
|
|
196
|
+
type: "boolean"
|
|
197
|
+
}, validConfigDpMap, {
|
|
198
|
+
name: "validNum"
|
|
199
|
+
}, ...pwdConfigDpMap];
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* 修改临时密码
|
|
203
|
+
* 上报配置
|
|
204
|
+
*/
|
|
205
|
+
const reportUpdateTempPwd = [{
|
|
206
|
+
name: "unlockId"
|
|
207
|
+
}, {
|
|
208
|
+
name: "status"
|
|
209
|
+
}];
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* 同步解锁方式
|
|
213
|
+
* 下发配置
|
|
214
|
+
*/
|
|
215
|
+
const sync = [{
|
|
216
|
+
name: "type",
|
|
217
|
+
loop: true
|
|
218
|
+
}];
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* 同步解锁方式
|
|
222
|
+
* 上报配置
|
|
223
|
+
*/
|
|
224
|
+
const reportSync = [{
|
|
225
|
+
name: "stage"
|
|
226
|
+
}, {
|
|
227
|
+
name: "package"
|
|
228
|
+
}
|
|
229
|
+
// 同步的数据,面板不关注,固这里不解析
|
|
230
|
+
];
|
|
231
|
+
export { add, reportAdd, remove, reportRemove, update, updateMemberRole, reportUpdate, addTempPwd, reportAddTempPwd, removeTempPwd, reportRemoveTempPwd, updateTempPwd, reportUpdateTempPwd, sync, reportSync };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ProductCommunicationType } from "../constant";
|
|
2
|
+
import { CapabilityInfo, DeviceInfo, DpSchema, RemotePermission, DeviceStatus } from "../interface";
|
|
3
|
+
declare const config: {
|
|
4
|
+
devInfo: DeviceInfo;
|
|
5
|
+
dpSchema: Record<string, DpSchema>;
|
|
6
|
+
codesById: Record<string, string>;
|
|
7
|
+
idsByCode: Record<string, number>;
|
|
8
|
+
remoteOpenEnabled: boolean;
|
|
9
|
+
remoteOpenPermission: RemotePermission;
|
|
10
|
+
capabilities: CapabilityInfo | null;
|
|
11
|
+
onlineType: number;
|
|
12
|
+
/**
|
|
13
|
+
* 产品的通讯能力
|
|
14
|
+
*/
|
|
15
|
+
communication: ProductCommunicationType[];
|
|
16
|
+
/**
|
|
17
|
+
* 是否为支持大容量的产品
|
|
18
|
+
*/
|
|
19
|
+
supportBigData: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 密码进行的进制
|
|
22
|
+
*/
|
|
23
|
+
passwordDigitalBase: number;
|
|
24
|
+
/**
|
|
25
|
+
* 密码是否支持0
|
|
26
|
+
*/
|
|
27
|
+
passwordSupportZero: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 是否严格模式
|
|
30
|
+
* 严格模式下,sdk 会对一些操作进行严格校验,比如 dp 协议校验
|
|
31
|
+
*/
|
|
32
|
+
strictMode: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 图片旋转角度
|
|
35
|
+
*/
|
|
36
|
+
imageAngle: number;
|
|
37
|
+
/**
|
|
38
|
+
* 视频旋转角度
|
|
39
|
+
*/
|
|
40
|
+
videoAngle: number;
|
|
41
|
+
/**
|
|
42
|
+
* 设备的状态信息
|
|
43
|
+
*/
|
|
44
|
+
deviceStatus: DeviceStatus;
|
|
45
|
+
};
|
|
46
|
+
export default config;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const config = {
|
|
2
|
+
// 设备信息
|
|
3
|
+
devInfo: {},
|
|
4
|
+
// 设备 dp 定义
|
|
5
|
+
dpSchema: {},
|
|
6
|
+
// 设备 dp 映射关系, id => code
|
|
7
|
+
codesById: {},
|
|
8
|
+
// 设备 dp 映射关系, code => id
|
|
9
|
+
idsByCode: {},
|
|
10
|
+
// 是否支持远程开锁
|
|
11
|
+
remoteOpenEnabled: false,
|
|
12
|
+
// 远程开锁权限, 0: '仅管理员可以使用', 1: '所有用户可以使用', 2: '所有用户都不可以',
|
|
13
|
+
remoteOpenPermission: "everyOne",
|
|
14
|
+
// 设备能力
|
|
15
|
+
capabilities: null,
|
|
16
|
+
// 设备在线情况,默认为离线
|
|
17
|
+
onlineType: 0,
|
|
18
|
+
/**
|
|
19
|
+
* 产品的通讯能力
|
|
20
|
+
*/
|
|
21
|
+
communication: [0],
|
|
22
|
+
/**
|
|
23
|
+
* 是否为支持大容量的产品
|
|
24
|
+
*/
|
|
25
|
+
supportBigData: false,
|
|
26
|
+
/**
|
|
27
|
+
* 密码进行的进制
|
|
28
|
+
*/
|
|
29
|
+
passwordDigitalBase: 10,
|
|
30
|
+
/**
|
|
31
|
+
* 密码是否支持0
|
|
32
|
+
*/
|
|
33
|
+
passwordSupportZero: true,
|
|
34
|
+
/**
|
|
35
|
+
* 是否严格模式
|
|
36
|
+
* 严格模式下,sdk 会对一些操作进行严格校验,比如 dp 协议校验
|
|
37
|
+
*/
|
|
38
|
+
strictMode: true,
|
|
39
|
+
/**
|
|
40
|
+
* 图片旋转角度
|
|
41
|
+
*/
|
|
42
|
+
imageAngle: 0,
|
|
43
|
+
/**
|
|
44
|
+
* 视频旋转角度
|
|
45
|
+
*/
|
|
46
|
+
videoAngle: 0,
|
|
47
|
+
/**
|
|
48
|
+
* 设备的状态信息
|
|
49
|
+
*/
|
|
50
|
+
deviceStatus: {
|
|
51
|
+
type: "offline",
|
|
52
|
+
connectEanble: false,
|
|
53
|
+
onlineType: "none"
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
export default config;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 用户类型
|
|
3
|
+
* 10 - 管理员
|
|
4
|
+
* 20 - 普通成员
|
|
5
|
+
* 30 - 匿名用户
|
|
6
|
+
* 40 - 分享成员
|
|
7
|
+
* 50 - 家庭拥有者
|
|
8
|
+
*/
|
|
9
|
+
export declare enum UserType {
|
|
10
|
+
ADMIN = 10,// 管理员
|
|
11
|
+
MEMBER = 20,// 普通成员
|
|
12
|
+
UNKNOW = 30,// 匿名用户
|
|
13
|
+
SHARE = 40,// 分享成员
|
|
14
|
+
OWNER = 50
|
|
15
|
+
}
|
|
16
|
+
export declare enum ModuleType {
|
|
17
|
+
T31 = 0,
|
|
18
|
+
WBRL = 1,
|
|
19
|
+
M9116 = 2,
|
|
20
|
+
M7258 = 3,
|
|
21
|
+
T3 = 4
|
|
22
|
+
}
|
|
23
|
+
export declare enum VedioType {
|
|
24
|
+
NONE = 0,// 不支持视频相关能力
|
|
25
|
+
VEDIO_OR_SNAPSHOT = 1
|
|
26
|
+
}
|
|
27
|
+
export declare enum VoiceType {
|
|
28
|
+
ONE_WAY = 0,// 单向
|
|
29
|
+
TWO_WAY = 1
|
|
30
|
+
}
|
|
31
|
+
export declare enum VedioStreamType {
|
|
32
|
+
STREAMER = 0,// 推流方式
|
|
33
|
+
P2P = 1
|
|
34
|
+
}
|
|
35
|
+
export declare enum CommunicationType {
|
|
36
|
+
WIFI = 0,// WIFI
|
|
37
|
+
WIFI_BLE = 1,// 蓝牙 + wifi
|
|
38
|
+
THREAD = 2,// 蓝牙 + Thread
|
|
39
|
+
THREAD_BLE = 3,// 蓝牙 + thread
|
|
40
|
+
NONE = 255
|
|
41
|
+
}
|
|
42
|
+
export declare enum RotateType {
|
|
43
|
+
PID = 0,// pid旋转
|
|
44
|
+
SEI = 1
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 涂鸦支持的通讯能力
|
|
48
|
+
*/
|
|
49
|
+
export declare enum ProductCommunicationType {
|
|
50
|
+
WIFI = 0,
|
|
51
|
+
CABLE = 1,
|
|
52
|
+
GPRS = 2,
|
|
53
|
+
NB_IOT = 3,
|
|
54
|
+
BLUETOOTH = 10,
|
|
55
|
+
BLE_MESH = 11,
|
|
56
|
+
ZIGBEE = 12,
|
|
57
|
+
INFRARED = 13,
|
|
58
|
+
SUBPIECES = 14,
|
|
59
|
+
SIGMESH = 15,
|
|
60
|
+
MCU = 16,
|
|
61
|
+
TY_SMESH = 17,
|
|
62
|
+
ZWAVE = 18,
|
|
63
|
+
PL_MESH = 19,
|
|
64
|
+
CAT1 = 20,
|
|
65
|
+
BEACON = 21,
|
|
66
|
+
CAT4 = 22,
|
|
67
|
+
CAT10 = 23,
|
|
68
|
+
LTE_CATM = 24,
|
|
69
|
+
THREAD = 25
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* 本地管理用户类型
|
|
73
|
+
*/
|
|
74
|
+
export declare enum LocalOperateUserType {
|
|
75
|
+
SUPER_ADMIN = 0,
|
|
76
|
+
ADMIN = 1,
|
|
77
|
+
SPECIAL_USER = 2,
|
|
78
|
+
NORMAL_USER = 3
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* 本地管理操作类型
|
|
82
|
+
* 开锁方式类:
|
|
83
|
+
* 0 表示 添加开锁方式
|
|
84
|
+
* 1 表示删除开锁方式
|
|
85
|
+
* 2 表示修改开锁方式
|
|
86
|
+
*
|
|
87
|
+
* 操作用户类:
|
|
88
|
+
* 16:添加用户
|
|
89
|
+
* 17:删除用户
|
|
90
|
+
*
|
|
91
|
+
* 本地设置类:
|
|
92
|
+
* 32 表示本地设备设置
|
|
93
|
+
*/
|
|
94
|
+
export declare enum LocalOperateCategory {
|
|
95
|
+
ADD_UNLOCK_METHOD = 0,
|
|
96
|
+
DELETE_UNLOCK_METHOD = 1,
|
|
97
|
+
MODIFY_UNLOCK_METHOD = 2,
|
|
98
|
+
ADD_USER = 16,
|
|
99
|
+
DELETE_USER = 17,
|
|
100
|
+
SETTING = 32
|
|
101
|
+
}
|
package/lib/constant.js
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 用户类型
|
|
3
|
+
* 10 - 管理员
|
|
4
|
+
* 20 - 普通成员
|
|
5
|
+
* 30 - 匿名用户
|
|
6
|
+
* 40 - 分享成员
|
|
7
|
+
* 50 - 家庭拥有者
|
|
8
|
+
*/
|
|
9
|
+
export let UserType = /*#__PURE__*/function (UserType) {
|
|
10
|
+
UserType[UserType["ADMIN"] = 10] = "ADMIN";
|
|
11
|
+
// 管理员
|
|
12
|
+
UserType[UserType["MEMBER"] = 20] = "MEMBER";
|
|
13
|
+
// 普通成员
|
|
14
|
+
UserType[UserType["UNKNOW"] = 30] = "UNKNOW";
|
|
15
|
+
// 匿名用户
|
|
16
|
+
UserType[UserType["SHARE"] = 40] = "SHARE";
|
|
17
|
+
// 分享成员
|
|
18
|
+
UserType[UserType["OWNER"] = 50] = "OWNER"; // 家庭拥有者
|
|
19
|
+
return UserType;
|
|
20
|
+
}({});
|
|
21
|
+
|
|
22
|
+
// 模组类型
|
|
23
|
+
export let ModuleType = /*#__PURE__*/function (ModuleType) {
|
|
24
|
+
ModuleType[ModuleType["T31"] = 0] = "T31";
|
|
25
|
+
ModuleType[ModuleType["WBRL"] = 1] = "WBRL";
|
|
26
|
+
ModuleType[ModuleType["M9116"] = 2] = "M9116";
|
|
27
|
+
ModuleType[ModuleType["M7258"] = 3] = "M7258";
|
|
28
|
+
ModuleType[ModuleType["T3"] = 4] = "T3";
|
|
29
|
+
return ModuleType;
|
|
30
|
+
}({});
|
|
31
|
+
|
|
32
|
+
// 支持视频类型
|
|
33
|
+
export let VedioType = /*#__PURE__*/function (VedioType) {
|
|
34
|
+
VedioType[VedioType["NONE"] = 0] = "NONE";
|
|
35
|
+
// 不支持视频相关能力
|
|
36
|
+
VedioType[VedioType["VEDIO_OR_SNAPSHOT"] = 1] = "VEDIO_OR_SNAPSHOT"; // 支持视频或者抓拍
|
|
37
|
+
return VedioType;
|
|
38
|
+
}({});
|
|
39
|
+
|
|
40
|
+
// 语音类型
|
|
41
|
+
export let VoiceType = /*#__PURE__*/function (VoiceType) {
|
|
42
|
+
VoiceType[VoiceType["ONE_WAY"] = 0] = "ONE_WAY";
|
|
43
|
+
// 单向
|
|
44
|
+
VoiceType[VoiceType["TWO_WAY"] = 1] = "TWO_WAY"; // 双向
|
|
45
|
+
return VoiceType;
|
|
46
|
+
}({});
|
|
47
|
+
|
|
48
|
+
// 视频流方案
|
|
49
|
+
export let VedioStreamType = /*#__PURE__*/function (VedioStreamType) {
|
|
50
|
+
VedioStreamType[VedioStreamType["STREAMER"] = 0] = "STREAMER";
|
|
51
|
+
// 推流方式
|
|
52
|
+
VedioStreamType[VedioStreamType["P2P"] = 1] = "P2P"; // P2P 方式
|
|
53
|
+
return VedioStreamType;
|
|
54
|
+
}({});
|
|
55
|
+
|
|
56
|
+
// 通讯能力
|
|
57
|
+
export let CommunicationType = /*#__PURE__*/function (CommunicationType) {
|
|
58
|
+
CommunicationType[CommunicationType["WIFI"] = 0] = "WIFI";
|
|
59
|
+
// WIFI
|
|
60
|
+
CommunicationType[CommunicationType["WIFI_BLE"] = 1] = "WIFI_BLE";
|
|
61
|
+
// 蓝牙 + wifi
|
|
62
|
+
CommunicationType[CommunicationType["THREAD"] = 2] = "THREAD";
|
|
63
|
+
// 蓝牙 + Thread
|
|
64
|
+
CommunicationType[CommunicationType["THREAD_BLE"] = 3] = "THREAD_BLE";
|
|
65
|
+
// 蓝牙 + thread
|
|
66
|
+
CommunicationType[CommunicationType["NONE"] = 255] = "NONE"; // 未知
|
|
67
|
+
return CommunicationType;
|
|
68
|
+
}({});
|
|
69
|
+
export let RotateType = /*#__PURE__*/function (RotateType) {
|
|
70
|
+
RotateType[RotateType["PID"] = 0] = "PID";
|
|
71
|
+
// pid旋转
|
|
72
|
+
RotateType[RotateType["SEI"] = 1] = "SEI"; // sei旋转
|
|
73
|
+
return RotateType;
|
|
74
|
+
}({});
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 涂鸦支持的通讯能力
|
|
78
|
+
*/
|
|
79
|
+
export let ProductCommunicationType = /*#__PURE__*/function (ProductCommunicationType) {
|
|
80
|
+
ProductCommunicationType[ProductCommunicationType["WIFI"] = 0] = "WIFI";
|
|
81
|
+
ProductCommunicationType[ProductCommunicationType["CABLE"] = 1] = "CABLE";
|
|
82
|
+
ProductCommunicationType[ProductCommunicationType["GPRS"] = 2] = "GPRS";
|
|
83
|
+
ProductCommunicationType[ProductCommunicationType["NB_IOT"] = 3] = "NB_IOT";
|
|
84
|
+
ProductCommunicationType[ProductCommunicationType["BLUETOOTH"] = 10] = "BLUETOOTH";
|
|
85
|
+
ProductCommunicationType[ProductCommunicationType["BLE_MESH"] = 11] = "BLE_MESH";
|
|
86
|
+
ProductCommunicationType[ProductCommunicationType["ZIGBEE"] = 12] = "ZIGBEE";
|
|
87
|
+
ProductCommunicationType[ProductCommunicationType["INFRARED"] = 13] = "INFRARED";
|
|
88
|
+
ProductCommunicationType[ProductCommunicationType["SUBPIECES"] = 14] = "SUBPIECES";
|
|
89
|
+
ProductCommunicationType[ProductCommunicationType["SIGMESH"] = 15] = "SIGMESH";
|
|
90
|
+
ProductCommunicationType[ProductCommunicationType["MCU"] = 16] = "MCU";
|
|
91
|
+
ProductCommunicationType[ProductCommunicationType["TY_SMESH"] = 17] = "TY_SMESH";
|
|
92
|
+
ProductCommunicationType[ProductCommunicationType["ZWAVE"] = 18] = "ZWAVE";
|
|
93
|
+
ProductCommunicationType[ProductCommunicationType["PL_MESH"] = 19] = "PL_MESH";
|
|
94
|
+
ProductCommunicationType[ProductCommunicationType["CAT1"] = 20] = "CAT1";
|
|
95
|
+
ProductCommunicationType[ProductCommunicationType["BEACON"] = 21] = "BEACON";
|
|
96
|
+
ProductCommunicationType[ProductCommunicationType["CAT4"] = 22] = "CAT4";
|
|
97
|
+
ProductCommunicationType[ProductCommunicationType["CAT10"] = 23] = "CAT10";
|
|
98
|
+
ProductCommunicationType[ProductCommunicationType["LTE_CATM"] = 24] = "LTE_CATM";
|
|
99
|
+
ProductCommunicationType[ProductCommunicationType["THREAD"] = 25] = "THREAD";
|
|
100
|
+
return ProductCommunicationType;
|
|
101
|
+
}({});
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* 本地管理用户类型
|
|
105
|
+
*/
|
|
106
|
+
export let LocalOperateUserType = /*#__PURE__*/function (LocalOperateUserType) {
|
|
107
|
+
LocalOperateUserType[LocalOperateUserType["SUPER_ADMIN"] = 0] = "SUPER_ADMIN";
|
|
108
|
+
LocalOperateUserType[LocalOperateUserType["ADMIN"] = 1] = "ADMIN";
|
|
109
|
+
LocalOperateUserType[LocalOperateUserType["SPECIAL_USER"] = 2] = "SPECIAL_USER";
|
|
110
|
+
LocalOperateUserType[LocalOperateUserType["NORMAL_USER"] = 3] = "NORMAL_USER";
|
|
111
|
+
return LocalOperateUserType;
|
|
112
|
+
}({});
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* 本地管理操作类型
|
|
116
|
+
* 开锁方式类:
|
|
117
|
+
* 0 表示 添加开锁方式
|
|
118
|
+
* 1 表示删除开锁方式
|
|
119
|
+
* 2 表示修改开锁方式
|
|
120
|
+
*
|
|
121
|
+
* 操作用户类:
|
|
122
|
+
* 16:添加用户
|
|
123
|
+
* 17:删除用户
|
|
124
|
+
*
|
|
125
|
+
* 本地设置类:
|
|
126
|
+
* 32 表示本地设备设置
|
|
127
|
+
*/
|
|
128
|
+
export let LocalOperateCategory = /*#__PURE__*/function (LocalOperateCategory) {
|
|
129
|
+
LocalOperateCategory[LocalOperateCategory["ADD_UNLOCK_METHOD"] = 0] = "ADD_UNLOCK_METHOD";
|
|
130
|
+
LocalOperateCategory[LocalOperateCategory["DELETE_UNLOCK_METHOD"] = 1] = "DELETE_UNLOCK_METHOD";
|
|
131
|
+
LocalOperateCategory[LocalOperateCategory["MODIFY_UNLOCK_METHOD"] = 2] = "MODIFY_UNLOCK_METHOD";
|
|
132
|
+
LocalOperateCategory[LocalOperateCategory["ADD_USER"] = 16] = "ADD_USER";
|
|
133
|
+
LocalOperateCategory[LocalOperateCategory["DELETE_USER"] = 17] = "DELETE_USER";
|
|
134
|
+
LocalOperateCategory[LocalOperateCategory["SETTING"] = 32] = "SETTING";
|
|
135
|
+
return LocalOperateCategory;
|
|
136
|
+
}({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/event.d.ts
ADDED
package/lib/event.js
ADDED
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LockSDKOption } from "./interface";
|
|
2
|
+
import { getCurrentUser, getDeviceStatus, onDeviceStatusChange, offDeviceStatusChange, getCurrentUserSync, getMediaRotate } from "./state";
|
|
3
|
+
import { syncUnlockMethod } from "./sync/unlock-mothod";
|
|
4
|
+
export * from "./user";
|
|
5
|
+
export * from "./unlock-method";
|
|
6
|
+
export * from "./temporary";
|
|
7
|
+
export * from "./open";
|
|
8
|
+
export * from "./log";
|
|
9
|
+
export * from "./signal";
|
|
10
|
+
export * from "./sleep";
|
|
11
|
+
export * from "./interface";
|
|
12
|
+
export * from "./constant";
|
|
13
|
+
export * from "./other";
|
|
14
|
+
export * from "./media";
|
|
15
|
+
export * from "./linkage";
|
|
16
|
+
/**
|
|
17
|
+
* 初始化sdk
|
|
18
|
+
* @param options 初始化参数
|
|
19
|
+
*/
|
|
20
|
+
export declare const init: (options?: LockSDKOption) => Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* 销毁 sdk
|
|
23
|
+
*/
|
|
24
|
+
export declare const destroy: () => void;
|
|
25
|
+
export { getCurrentUser, getMediaRotate, getCurrentUserSync, syncUnlockMethod, getDeviceStatus, onDeviceStatusChange, offDeviceStatusChange, };
|