@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.
Files changed (95) hide show
  1. package/lib/api/index.d.ts +5 -0
  2. package/lib/api/index.js +18 -0
  3. package/lib/api/linkage.d.ts +161 -0
  4. package/lib/api/linkage.js +74 -0
  5. package/lib/api/lock.d.ts +195 -0
  6. package/lib/api/lock.js +129 -0
  7. package/lib/api/log.d.ts +166 -0
  8. package/lib/api/log.js +44 -0
  9. package/lib/api/setting.d.ts +14 -0
  10. package/lib/api/setting.js +36 -0
  11. package/lib/api/temp.d.ts +211 -0
  12. package/lib/api/temp.js +130 -0
  13. package/lib/api/user.d.ts +154 -0
  14. package/lib/api/user.js +59 -0
  15. package/lib/api/video.d.ts +9 -0
  16. package/lib/api/video.js +17 -0
  17. package/lib/config/dp-code/index.d.ts +175 -0
  18. package/lib/config/dp-code/index.js +224 -0
  19. package/lib/config/dp-map/common.d.ts +102 -0
  20. package/lib/config/dp-map/common.js +120 -0
  21. package/lib/config/dp-map/normal.d.ts +6 -0
  22. package/lib/config/dp-map/normal.js +51 -0
  23. package/lib/config/dp-map/open.d.ts +21 -0
  24. package/lib/config/dp-map/open.js +62 -0
  25. package/lib/config/dp-map/unlock-method-big.d.ts +559 -0
  26. package/lib/config/dp-map/unlock-method-big.js +237 -0
  27. package/lib/config/dp-map/unlock-method.d.ts +551 -0
  28. package/lib/config/dp-map/unlock-method.js +231 -0
  29. package/lib/config/index.d.ts +46 -0
  30. package/lib/config/index.js +56 -0
  31. package/lib/constant.d.ts +101 -0
  32. package/lib/constant.js +136 -0
  33. package/lib/dp-interface.d.ts +7 -0
  34. package/lib/dp-interface.js +1 -0
  35. package/lib/event.d.ts +8 -0
  36. package/lib/event.js +9 -0
  37. package/lib/index.d.ts +25 -0
  38. package/lib/index.js +92 -0
  39. package/lib/interface.d.ts +807 -0
  40. package/lib/interface.js +1 -0
  41. package/lib/linkage.d.ts +26 -0
  42. package/lib/linkage.js +175 -0
  43. package/lib/log.d.ts +91 -0
  44. package/lib/log.js +314 -0
  45. package/lib/media.d.ts +43 -0
  46. package/lib/media.js +80 -0
  47. package/lib/open.d.ts +48 -0
  48. package/lib/open.js +247 -0
  49. package/lib/other.d.ts +36 -0
  50. package/lib/other.js +178 -0
  51. package/lib/parse/index.d.ts +6 -0
  52. package/lib/parse/index.js +22 -0
  53. package/lib/signal.d.ts +26 -0
  54. package/lib/signal.js +38 -0
  55. package/lib/sleep.d.ts +61 -0
  56. package/lib/sleep.js +121 -0
  57. package/lib/state.d.ts +54 -0
  58. package/lib/state.js +429 -0
  59. package/lib/sync/remote-serect-key.d.ts +5 -0
  60. package/lib/sync/remote-serect-key.js +60 -0
  61. package/lib/sync/t0.d.ts +5 -0
  62. package/lib/sync/t0.js +33 -0
  63. package/lib/sync/temp.d.ts +7 -0
  64. package/lib/sync/temp.js +88 -0
  65. package/lib/sync/unlock-mothod.d.ts +5 -0
  66. package/lib/sync/unlock-mothod.js +54 -0
  67. package/lib/temporary.d.ts +226 -0
  68. package/lib/temporary.js +637 -0
  69. package/lib/unlock-method.d.ts +269 -0
  70. package/lib/unlock-method.js +723 -0
  71. package/lib/user.d.ts +108 -0
  72. package/lib/user.js +361 -0
  73. package/lib/utils/base64-to-hex.d.ts +1 -0
  74. package/lib/utils/base64-to-hex.js +12 -0
  75. package/lib/utils/byte.d.ts +19 -0
  76. package/lib/utils/byte.js +74 -0
  77. package/lib/utils/constant.d.ts +11 -0
  78. package/lib/utils/constant.js +17 -0
  79. package/lib/utils/device.d.ts +207 -0
  80. package/lib/utils/device.js +353 -0
  81. package/lib/utils/errors.d.ts +2 -0
  82. package/lib/utils/errors.js +125 -0
  83. package/lib/utils/event.d.ts +23 -0
  84. package/lib/utils/event.js +144 -0
  85. package/lib/utils/hex-to-base64.d.ts +1 -0
  86. package/lib/utils/hex-to-base64.js +8 -0
  87. package/lib/utils/hex-to-bytes.d.ts +6 -0
  88. package/lib/utils/hex-to-bytes.js +16 -0
  89. package/lib/utils/index.d.ts +169 -0
  90. package/lib/utils/index.js +419 -0
  91. package/lib/utils/log.d.ts +5 -0
  92. package/lib/utils/log.js +78 -0
  93. package/lib/utils/publishDps.d.ts +11 -0
  94. package/lib/utils/publishDps.js +91 -0
  95. package/package.json +37 -0
@@ -0,0 +1,559 @@
1
+ /**
2
+ * 小容量开门方式配置
3
+ * 下发配置
4
+ */
5
+ declare const add: ({
6
+ readonly name: "validConfig";
7
+ readonly type: "child";
8
+ readonly bytes: 17;
9
+ readonly childMap: readonly [{
10
+ readonly name: "startTime";
11
+ readonly bytes: 4;
12
+ }, {
13
+ readonly name: "endTime";
14
+ readonly bytes: 4;
15
+ }, {
16
+ readonly name: "loop";
17
+ }, {
18
+ readonly name: "loopConfig";
19
+ readonly condition: {
20
+ readonly type: "and";
21
+ readonly conditions: readonly [{
22
+ readonly prop: "validConfig.loop";
23
+ readonly value: 2;
24
+ readonly operation: "neq";
25
+ }, {
26
+ readonly prop: "loop";
27
+ readonly value: 3;
28
+ readonly operation: "neq";
29
+ }];
30
+ };
31
+ readonly bytes: 4;
32
+ readonly defaultValue: 0;
33
+ }, {
34
+ readonly name: "weeks";
35
+ readonly condition: {
36
+ readonly prop: "validConfig.loop";
37
+ readonly value: 2;
38
+ };
39
+ readonly type: "custom";
40
+ readonly bytes: 4;
41
+ readonly parse: (value: number) => number[];
42
+ readonly format: (value: number[]) => string;
43
+ readonly defaultValue: readonly [0, 0, 0, 0, 0, 0, 0];
44
+ }, {
45
+ readonly name: "days";
46
+ readonly condition: {
47
+ readonly prop: "validConfig.loop";
48
+ readonly value: 3;
49
+ };
50
+ readonly type: "bits";
51
+ readonly bytes: 4;
52
+ readonly defaultValue: 0;
53
+ }, {
54
+ readonly name: "startHour";
55
+ readonly type: "number";
56
+ readonly bytes: 1;
57
+ readonly defaultValue: 0;
58
+ }, {
59
+ readonly name: "startMinute";
60
+ readonly type: "number";
61
+ readonly bytes: 1;
62
+ readonly defaultValue: 0;
63
+ }, {
64
+ readonly name: "endHour";
65
+ readonly type: "number";
66
+ readonly bytes: 1;
67
+ readonly defaultValue: 0;
68
+ }, {
69
+ readonly name: "endMinute";
70
+ readonly type: "number";
71
+ readonly bytes: 1;
72
+ readonly defaultValue: 0;
73
+ }];
74
+ } | {
75
+ readonly name: "pwdLength";
76
+ } | {
77
+ readonly name: "pwd";
78
+ readonly type: "number";
79
+ readonly limit: "pwdLength";
80
+ readonly loop: true;
81
+ readonly defaultValue: readonly [];
82
+ } | {
83
+ name: string;
84
+ type?: undefined;
85
+ defaultValue?: undefined;
86
+ bytes?: undefined;
87
+ } | {
88
+ name: string;
89
+ type: string;
90
+ defaultValue: boolean;
91
+ bytes?: undefined;
92
+ } | {
93
+ name: string;
94
+ bytes: number;
95
+ type?: undefined;
96
+ defaultValue?: undefined;
97
+ })[];
98
+ /**
99
+ * 小容量开门方式配置
100
+ * 上报配置
101
+ */
102
+ declare const reportAdd: ({
103
+ name: string;
104
+ type?: undefined;
105
+ defaultValue?: undefined;
106
+ bytes?: undefined;
107
+ } | {
108
+ name: string;
109
+ type: string;
110
+ defaultValue: boolean;
111
+ bytes?: undefined;
112
+ } | {
113
+ name: string;
114
+ bytes: number;
115
+ type?: undefined;
116
+ defaultValue?: undefined;
117
+ } | {
118
+ name: string;
119
+ condition: {
120
+ prop: string;
121
+ value: number;
122
+ type?: undefined;
123
+ conditions?: undefined;
124
+ };
125
+ } | {
126
+ name: string;
127
+ condition: {
128
+ type: string;
129
+ conditions: {
130
+ prop: string;
131
+ value: number;
132
+ operation: string;
133
+ }[];
134
+ prop?: undefined;
135
+ value?: undefined;
136
+ };
137
+ })[];
138
+ /**
139
+ * 小容量删除开门方式配置
140
+ * 上报配置
141
+ */
142
+ declare const remove: ({
143
+ name: string;
144
+ type?: undefined;
145
+ defaultValue?: undefined;
146
+ bytes?: undefined;
147
+ } | {
148
+ name: string;
149
+ type: string;
150
+ defaultValue: boolean;
151
+ bytes?: undefined;
152
+ } | {
153
+ name: string;
154
+ bytes: number;
155
+ type?: undefined;
156
+ defaultValue?: undefined;
157
+ })[];
158
+ /**
159
+ * 小容量删除开门方式配置
160
+ * 下报配置
161
+ */
162
+ declare const reportRemove: ({
163
+ name: string;
164
+ type?: undefined;
165
+ defaultValue?: undefined;
166
+ bytes?: undefined;
167
+ } | {
168
+ name: string;
169
+ type: string;
170
+ defaultValue: boolean;
171
+ bytes?: undefined;
172
+ } | {
173
+ name: string;
174
+ bytes: number;
175
+ type?: undefined;
176
+ defaultValue?: undefined;
177
+ })[];
178
+ /**
179
+ * 小容量修改开门方式配置
180
+ * 下报配置
181
+ */
182
+ declare const update: ({
183
+ readonly name: "validConfig";
184
+ readonly type: "child";
185
+ readonly bytes: 17;
186
+ readonly childMap: readonly [{
187
+ readonly name: "startTime";
188
+ readonly bytes: 4;
189
+ }, {
190
+ readonly name: "endTime";
191
+ readonly bytes: 4;
192
+ }, {
193
+ readonly name: "loop";
194
+ }, {
195
+ readonly name: "loopConfig";
196
+ readonly condition: {
197
+ readonly type: "and";
198
+ readonly conditions: readonly [{
199
+ readonly prop: "validConfig.loop";
200
+ readonly value: 2;
201
+ readonly operation: "neq";
202
+ }, {
203
+ readonly prop: "loop";
204
+ readonly value: 3;
205
+ readonly operation: "neq";
206
+ }];
207
+ };
208
+ readonly bytes: 4;
209
+ readonly defaultValue: 0;
210
+ }, {
211
+ readonly name: "weeks";
212
+ readonly condition: {
213
+ readonly prop: "validConfig.loop";
214
+ readonly value: 2;
215
+ };
216
+ readonly type: "custom";
217
+ readonly bytes: 4;
218
+ readonly parse: (value: number) => number[];
219
+ readonly format: (value: number[]) => string;
220
+ readonly defaultValue: readonly [0, 0, 0, 0, 0, 0, 0];
221
+ }, {
222
+ readonly name: "days";
223
+ readonly condition: {
224
+ readonly prop: "validConfig.loop";
225
+ readonly value: 3;
226
+ };
227
+ readonly type: "bits";
228
+ readonly bytes: 4;
229
+ readonly defaultValue: 0;
230
+ }, {
231
+ readonly name: "startHour";
232
+ readonly type: "number";
233
+ readonly bytes: 1;
234
+ readonly defaultValue: 0;
235
+ }, {
236
+ readonly name: "startMinute";
237
+ readonly type: "number";
238
+ readonly bytes: 1;
239
+ readonly defaultValue: 0;
240
+ }, {
241
+ readonly name: "endHour";
242
+ readonly type: "number";
243
+ readonly bytes: 1;
244
+ readonly defaultValue: 0;
245
+ }, {
246
+ readonly name: "endMinute";
247
+ readonly type: "number";
248
+ readonly bytes: 1;
249
+ readonly defaultValue: 0;
250
+ }];
251
+ } | {
252
+ readonly name: "pwdLength";
253
+ } | {
254
+ readonly name: "pwd";
255
+ readonly type: "number";
256
+ readonly limit: "pwdLength";
257
+ readonly loop: true;
258
+ readonly defaultValue: readonly [];
259
+ } | {
260
+ name: string;
261
+ type?: undefined;
262
+ defaultValue?: undefined;
263
+ bytes?: undefined;
264
+ } | {
265
+ name: string;
266
+ type: string;
267
+ defaultValue: boolean;
268
+ bytes?: undefined;
269
+ } | {
270
+ name: string;
271
+ bytes: number;
272
+ type?: undefined;
273
+ defaultValue?: undefined;
274
+ })[];
275
+ /**
276
+ * 小容量修改开门方式配置,只修改成员角色
277
+ * 下发配置
278
+ */
279
+ declare const updateMemberRole: ({
280
+ name: string;
281
+ type?: undefined;
282
+ defaultValue?: undefined;
283
+ bytes?: undefined;
284
+ } | {
285
+ name: string;
286
+ type: string;
287
+ defaultValue: boolean;
288
+ bytes?: undefined;
289
+ } | {
290
+ name: string;
291
+ bytes: number;
292
+ type?: undefined;
293
+ defaultValue?: undefined;
294
+ })[];
295
+ /**
296
+ * 小容量删除开门方式配置
297
+ * 上报配置
298
+ */
299
+ declare const reportUpdate: ({
300
+ name: string;
301
+ type?: undefined;
302
+ defaultValue?: undefined;
303
+ bytes?: undefined;
304
+ } | {
305
+ name: string;
306
+ type: string;
307
+ defaultValue: boolean;
308
+ bytes?: undefined;
309
+ } | {
310
+ name: string;
311
+ bytes: number;
312
+ type?: undefined;
313
+ defaultValue?: undefined;
314
+ })[];
315
+ /**
316
+ * 添加临时密码
317
+ * 下发配置
318
+ */
319
+ declare const addTempPwd: ({
320
+ readonly name: "validConfig";
321
+ readonly type: "child";
322
+ readonly bytes: 17;
323
+ readonly childMap: readonly [{
324
+ readonly name: "startTime";
325
+ readonly bytes: 4;
326
+ }, {
327
+ readonly name: "endTime";
328
+ readonly bytes: 4;
329
+ }, {
330
+ readonly name: "loop";
331
+ }, {
332
+ readonly name: "loopConfig";
333
+ readonly condition: {
334
+ readonly type: "and";
335
+ readonly conditions: readonly [{
336
+ readonly prop: "validConfig.loop";
337
+ readonly value: 2;
338
+ readonly operation: "neq";
339
+ }, {
340
+ readonly prop: "loop";
341
+ readonly value: 3;
342
+ readonly operation: "neq";
343
+ }];
344
+ };
345
+ readonly bytes: 4;
346
+ readonly defaultValue: 0;
347
+ }, {
348
+ readonly name: "weeks";
349
+ readonly condition: {
350
+ readonly prop: "validConfig.loop";
351
+ readonly value: 2;
352
+ };
353
+ readonly type: "custom";
354
+ readonly bytes: 4;
355
+ readonly parse: (value: number) => number[];
356
+ readonly format: (value: number[]) => string;
357
+ readonly defaultValue: readonly [0, 0, 0, 0, 0, 0, 0];
358
+ }, {
359
+ readonly name: "days";
360
+ readonly condition: {
361
+ readonly prop: "validConfig.loop";
362
+ readonly value: 3;
363
+ };
364
+ readonly type: "bits";
365
+ readonly bytes: 4;
366
+ readonly defaultValue: 0;
367
+ }, {
368
+ readonly name: "startHour";
369
+ readonly type: "number";
370
+ readonly bytes: 1;
371
+ readonly defaultValue: 0;
372
+ }, {
373
+ readonly name: "startMinute";
374
+ readonly type: "number";
375
+ readonly bytes: 1;
376
+ readonly defaultValue: 0;
377
+ }, {
378
+ readonly name: "endHour";
379
+ readonly type: "number";
380
+ readonly bytes: 1;
381
+ readonly defaultValue: 0;
382
+ }, {
383
+ readonly name: "endMinute";
384
+ readonly type: "number";
385
+ readonly bytes: 1;
386
+ readonly defaultValue: 0;
387
+ }];
388
+ } | {
389
+ readonly name: "pwdLength";
390
+ } | {
391
+ readonly name: "pwd";
392
+ readonly type: "number";
393
+ readonly limit: "pwdLength";
394
+ readonly loop: true;
395
+ readonly defaultValue: readonly [];
396
+ } | {
397
+ name: string;
398
+ bytes: number;
399
+ type?: undefined;
400
+ } | {
401
+ name: string;
402
+ type: string;
403
+ bytes?: undefined;
404
+ } | {
405
+ name: string;
406
+ bytes?: undefined;
407
+ type?: undefined;
408
+ })[];
409
+ /**
410
+ * 添加临时密码
411
+ * 上报配置
412
+ */
413
+ declare const reportAddTempPwd: ({
414
+ name: string;
415
+ bytes: number;
416
+ } | {
417
+ name: string;
418
+ bytes?: undefined;
419
+ })[];
420
+ /**
421
+ * 删除临时密码
422
+ * 下发配置
423
+ */
424
+ declare const removeTempPwd: {
425
+ name: string;
426
+ bytes: number;
427
+ }[];
428
+ /**
429
+ * 删除临时密码
430
+ * 上报配置
431
+ */
432
+ declare const reportRemoveTempPwd: ({
433
+ name: string;
434
+ bytes: number;
435
+ } | {
436
+ name: string;
437
+ bytes?: undefined;
438
+ })[];
439
+ /**
440
+ * 修改临时密码
441
+ * 下发配置
442
+ */
443
+ declare const updateTempPwd: ({
444
+ readonly name: "validConfig";
445
+ readonly type: "child";
446
+ readonly bytes: 17;
447
+ readonly childMap: readonly [{
448
+ readonly name: "startTime";
449
+ readonly bytes: 4;
450
+ }, {
451
+ readonly name: "endTime";
452
+ readonly bytes: 4;
453
+ }, {
454
+ readonly name: "loop";
455
+ }, {
456
+ readonly name: "loopConfig";
457
+ readonly condition: {
458
+ readonly type: "and";
459
+ readonly conditions: readonly [{
460
+ readonly prop: "validConfig.loop";
461
+ readonly value: 2;
462
+ readonly operation: "neq";
463
+ }, {
464
+ readonly prop: "loop";
465
+ readonly value: 3;
466
+ readonly operation: "neq";
467
+ }];
468
+ };
469
+ readonly bytes: 4;
470
+ readonly defaultValue: 0;
471
+ }, {
472
+ readonly name: "weeks";
473
+ readonly condition: {
474
+ readonly prop: "validConfig.loop";
475
+ readonly value: 2;
476
+ };
477
+ readonly type: "custom";
478
+ readonly bytes: 4;
479
+ readonly parse: (value: number) => number[];
480
+ readonly format: (value: number[]) => string;
481
+ readonly defaultValue: readonly [0, 0, 0, 0, 0, 0, 0];
482
+ }, {
483
+ readonly name: "days";
484
+ readonly condition: {
485
+ readonly prop: "validConfig.loop";
486
+ readonly value: 3;
487
+ };
488
+ readonly type: "bits";
489
+ readonly bytes: 4;
490
+ readonly defaultValue: 0;
491
+ }, {
492
+ readonly name: "startHour";
493
+ readonly type: "number";
494
+ readonly bytes: 1;
495
+ readonly defaultValue: 0;
496
+ }, {
497
+ readonly name: "startMinute";
498
+ readonly type: "number";
499
+ readonly bytes: 1;
500
+ readonly defaultValue: 0;
501
+ }, {
502
+ readonly name: "endHour";
503
+ readonly type: "number";
504
+ readonly bytes: 1;
505
+ readonly defaultValue: 0;
506
+ }, {
507
+ readonly name: "endMinute";
508
+ readonly type: "number";
509
+ readonly bytes: 1;
510
+ readonly defaultValue: 0;
511
+ }];
512
+ } | {
513
+ readonly name: "pwdLength";
514
+ } | {
515
+ readonly name: "pwd";
516
+ readonly type: "number";
517
+ readonly limit: "pwdLength";
518
+ readonly loop: true;
519
+ readonly defaultValue: readonly [];
520
+ } | {
521
+ name: string;
522
+ bytes: number;
523
+ type?: undefined;
524
+ } | {
525
+ name: string;
526
+ type: string;
527
+ bytes?: undefined;
528
+ } | {
529
+ name: string;
530
+ bytes?: undefined;
531
+ type?: undefined;
532
+ })[];
533
+ /**
534
+ * 修改临时密码
535
+ * 上报配置
536
+ */
537
+ declare const reportUpdateTempPwd: ({
538
+ name: string;
539
+ bytes: number;
540
+ } | {
541
+ name: string;
542
+ bytes?: undefined;
543
+ })[];
544
+ /**
545
+ * 同步解锁方式
546
+ * 下发配置
547
+ */
548
+ declare const sync: {
549
+ name: string;
550
+ loop: boolean;
551
+ }[];
552
+ /**
553
+ * 同步解锁方式
554
+ * 上报配置
555
+ */
556
+ declare const reportSync: {
557
+ name: string;
558
+ }[];
559
+ export { add, reportAdd, remove, reportRemove, update, updateMemberRole, reportUpdate, addTempPwd, reportAddTempPwd, removeTempPwd, reportRemoveTempPwd, updateTempPwd, reportUpdateTempPwd, sync, reportSync, };