@ray-js/lock-sdk 1.0.3 → 1.1.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 (63) hide show
  1. package/lib/api/index.d.ts +25 -0
  2. package/lib/api/index.js +59 -3
  3. package/lib/api/linkage.js +7 -7
  4. package/lib/api/lock.d.ts +1 -0
  5. package/lib/api/lock.js +26 -15
  6. package/lib/api/log.d.ts +6 -1
  7. package/lib/api/log.js +6 -6
  8. package/lib/api/request.d.ts +6 -0
  9. package/lib/api/request.js +57 -0
  10. package/lib/api/setting.d.ts +1 -1
  11. package/lib/api/setting.js +3 -3
  12. package/lib/api/temp.d.ts +45 -1
  13. package/lib/api/temp.js +52 -15
  14. package/lib/api/user.d.ts +21 -0
  15. package/lib/api/user.js +26 -7
  16. package/lib/api/video.js +2 -2
  17. package/lib/capability.d.ts +4 -0
  18. package/lib/capability.js +95 -0
  19. package/lib/config/dp-code/index.d.ts +10 -1
  20. package/lib/config/dp-code/index.js +12 -3
  21. package/lib/config/dp-map/normal.d.ts +2 -3
  22. package/lib/config/dp-map/normal.js +2 -9
  23. package/lib/config/dp-map/unlock-method-big.d.ts +3 -7
  24. package/lib/config/dp-map/unlock-method-big.js +30 -1
  25. package/lib/config/dp-map/unlock-method.d.ts +489 -0
  26. package/lib/config/dp-map/unlock-method.js +55 -1
  27. package/lib/config/index.d.ts +7 -1
  28. package/lib/config/index.js +18 -1
  29. package/lib/index.d.ts +6 -2
  30. package/lib/index.js +8 -3
  31. package/lib/interface.d.ts +39 -1
  32. package/lib/log.js +3 -0
  33. package/lib/media.d.ts +6 -1
  34. package/lib/media.js +24 -6
  35. package/lib/offline-dps.d.ts +9 -0
  36. package/lib/offline-dps.js +84 -0
  37. package/lib/open.d.ts +9 -0
  38. package/lib/open.js +90 -11
  39. package/lib/other.d.ts +16 -2
  40. package/lib/other.js +188 -31
  41. package/lib/sleep.d.ts +3 -3
  42. package/lib/sleep.js +40 -25
  43. package/lib/state.js +116 -57
  44. package/lib/sync/offline-dps.d.ts +1 -0
  45. package/lib/sync/offline-dps.js +34 -0
  46. package/lib/sync/remote-serect-key.js +19 -23
  47. package/lib/sync/t0.js +2 -2
  48. package/lib/sync/unlock-method.d.ts +2 -0
  49. package/lib/sync/unlock-method.js +42 -0
  50. package/lib/sync/user.d.ts +2 -0
  51. package/lib/sync/user.js +76 -0
  52. package/lib/temporary.d.ts +93 -0
  53. package/lib/temporary.js +171 -1
  54. package/lib/unlock-method.js +43 -13
  55. package/lib/user.d.ts +2 -1
  56. package/lib/user.js +54 -1
  57. package/lib/utils/device.d.ts +7 -0
  58. package/lib/utils/device.js +39 -0
  59. package/lib/utils/errors.js +4 -0
  60. package/lib/utils/index.js +6 -6
  61. package/lib/utils/ipc.d.ts +11 -0
  62. package/lib/utils/ipc.js +26 -0
  63. package/package.json +2 -2
@@ -486,3 +486,492 @@ declare const reportUpdateTempPwd: DpMap;
486
486
  declare const sync: DpMap;
487
487
  declare const reportSync: DpMap;
488
488
  export { add, reportAdd, remove, reportRemove, update, updateMemberRole, reportUpdate, addTempPwd, reportAddTempPwd, removeTempPwd, reportRemoveTempPwd, updateTempPwd, reportUpdateTempPwd, sync, reportSync, };
489
+ declare const _default: {
490
+ add: readonly [{
491
+ readonly name: "type";
492
+ }, {
493
+ readonly name: "stage";
494
+ }, {
495
+ readonly name: "admin";
496
+ readonly type: "boolean";
497
+ readonly defaultValue: false;
498
+ }, {
499
+ readonly name: "memberId";
500
+ }, {
501
+ readonly name: "unlockId";
502
+ }, {
503
+ readonly name: "validConfig";
504
+ readonly type: "child";
505
+ readonly bytes: 17;
506
+ readonly childMap: readonly [{
507
+ readonly name: "startTime";
508
+ readonly bytes: 4;
509
+ }, {
510
+ readonly name: "endTime";
511
+ readonly bytes: 4;
512
+ }, {
513
+ readonly name: "loop";
514
+ }, {
515
+ readonly name: "loopConfig";
516
+ readonly condition: {
517
+ readonly type: "and";
518
+ readonly conditions: readonly [{
519
+ readonly prop: "validConfig.loop";
520
+ readonly value: 2;
521
+ readonly operation: "neq";
522
+ }, {
523
+ readonly prop: "loop";
524
+ readonly value: 3;
525
+ readonly operation: "neq";
526
+ }];
527
+ };
528
+ readonly bytes: 4;
529
+ readonly defaultValue: 0;
530
+ }, {
531
+ readonly name: "weeks";
532
+ readonly condition: {
533
+ readonly prop: "validConfig.loop";
534
+ readonly value: 2;
535
+ };
536
+ readonly type: "custom";
537
+ readonly bytes: 4;
538
+ readonly parse: (value: number) => number[];
539
+ readonly format: (value: number[]) => string;
540
+ readonly defaultValue: readonly [0, 0, 0, 0, 0, 0, 0];
541
+ }, {
542
+ readonly name: "days";
543
+ readonly condition: {
544
+ readonly prop: "validConfig.loop";
545
+ readonly value: 3;
546
+ };
547
+ readonly type: "bits";
548
+ readonly bytes: 4;
549
+ readonly defaultValue: 0;
550
+ }, {
551
+ readonly name: "startHour";
552
+ readonly type: "number";
553
+ readonly bytes: 1;
554
+ readonly defaultValue: 0;
555
+ }, {
556
+ readonly name: "startMinute";
557
+ readonly type: "number";
558
+ readonly bytes: 1;
559
+ readonly defaultValue: 0;
560
+ }, {
561
+ readonly name: "endHour";
562
+ readonly type: "number";
563
+ readonly bytes: 1;
564
+ readonly defaultValue: 0;
565
+ }, {
566
+ readonly name: "endMinute";
567
+ readonly type: "number";
568
+ readonly bytes: 1;
569
+ readonly defaultValue: 0;
570
+ }];
571
+ }, {
572
+ readonly name: "validNum";
573
+ }, {
574
+ readonly name: "pwdLength";
575
+ }, {
576
+ readonly name: "pwd";
577
+ readonly type: "number";
578
+ readonly limit: "pwdLength";
579
+ readonly loop: true;
580
+ readonly defaultValue: readonly [];
581
+ }, {
582
+ readonly name: "sn";
583
+ readonly bytes: 2;
584
+ }];
585
+ reportAdd: readonly [{
586
+ readonly name: "type";
587
+ }, {
588
+ readonly name: "stage";
589
+ }, {
590
+ readonly name: "admin";
591
+ readonly type: "boolean";
592
+ readonly defaultValue: false;
593
+ }, {
594
+ readonly name: "memberId";
595
+ }, {
596
+ readonly name: "unlockId";
597
+ }, {
598
+ readonly name: "total";
599
+ readonly condition: {
600
+ readonly prop: "stage";
601
+ readonly value: 0;
602
+ };
603
+ }, {
604
+ readonly name: "step";
605
+ readonly condition: {
606
+ readonly prop: "stage";
607
+ readonly value: 252;
608
+ };
609
+ }, {
610
+ readonly name: "stageFail";
611
+ readonly condition: {
612
+ readonly prop: "stage";
613
+ readonly value: 253;
614
+ };
615
+ }, {
616
+ readonly name: "none";
617
+ readonly condition: {
618
+ readonly type: "and";
619
+ readonly conditions: readonly [{
620
+ readonly prop: "stage";
621
+ readonly value: 0;
622
+ readonly operation: "neq";
623
+ }, {
624
+ readonly prop: "stage";
625
+ readonly value: 252;
626
+ readonly operation: "neq";
627
+ }, {
628
+ readonly prop: "stage";
629
+ readonly value: 253;
630
+ readonly operation: "neq";
631
+ }];
632
+ };
633
+ }, {
634
+ readonly name: "status";
635
+ }, {
636
+ readonly name: "sn";
637
+ readonly bytes: 2;
638
+ }];
639
+ remove: readonly [{
640
+ readonly name: "type";
641
+ }, {
642
+ readonly name: "stage";
643
+ }, {
644
+ readonly name: "admin";
645
+ readonly type: "boolean";
646
+ readonly defaultValue: false;
647
+ }, {
648
+ readonly name: "memberId";
649
+ }, {
650
+ readonly name: "unlockId";
651
+ }, {
652
+ readonly name: "target";
653
+ }];
654
+ reportRemove: ({
655
+ readonly name: "type";
656
+ } | {
657
+ readonly name: "stage";
658
+ } | {
659
+ readonly name: "admin";
660
+ readonly type: "boolean";
661
+ readonly defaultValue: false;
662
+ } | {
663
+ readonly name: "memberId";
664
+ } | {
665
+ readonly name: "unlockId";
666
+ } | {
667
+ readonly name: "target";
668
+ } | {
669
+ name: string;
670
+ })[];
671
+ update: readonly [{
672
+ readonly name: "type";
673
+ }, {
674
+ readonly name: "stage";
675
+ }, {
676
+ readonly name: "admin";
677
+ readonly type: "boolean";
678
+ readonly defaultValue: false;
679
+ }, {
680
+ readonly name: "memberId";
681
+ }, {
682
+ readonly name: "unlockId";
683
+ }, {
684
+ readonly name: "validConfig";
685
+ readonly type: "child";
686
+ readonly bytes: 17;
687
+ readonly childMap: readonly [{
688
+ readonly name: "startTime";
689
+ readonly bytes: 4;
690
+ }, {
691
+ readonly name: "endTime";
692
+ readonly bytes: 4;
693
+ }, {
694
+ readonly name: "loop";
695
+ }, {
696
+ readonly name: "loopConfig";
697
+ readonly condition: {
698
+ readonly type: "and";
699
+ readonly conditions: readonly [{
700
+ readonly prop: "validConfig.loop";
701
+ readonly value: 2;
702
+ readonly operation: "neq";
703
+ }, {
704
+ readonly prop: "loop";
705
+ readonly value: 3;
706
+ readonly operation: "neq";
707
+ }];
708
+ };
709
+ readonly bytes: 4;
710
+ readonly defaultValue: 0;
711
+ }, {
712
+ readonly name: "weeks";
713
+ readonly condition: {
714
+ readonly prop: "validConfig.loop";
715
+ readonly value: 2;
716
+ };
717
+ readonly type: "custom";
718
+ readonly bytes: 4;
719
+ readonly parse: (value: number) => number[];
720
+ readonly format: (value: number[]) => string;
721
+ readonly defaultValue: readonly [0, 0, 0, 0, 0, 0, 0];
722
+ }, {
723
+ readonly name: "days";
724
+ readonly condition: {
725
+ readonly prop: "validConfig.loop";
726
+ readonly value: 3;
727
+ };
728
+ readonly type: "bits";
729
+ readonly bytes: 4;
730
+ readonly defaultValue: 0;
731
+ }, {
732
+ readonly name: "startHour";
733
+ readonly type: "number";
734
+ readonly bytes: 1;
735
+ readonly defaultValue: 0;
736
+ }, {
737
+ readonly name: "startMinute";
738
+ readonly type: "number";
739
+ readonly bytes: 1;
740
+ readonly defaultValue: 0;
741
+ }, {
742
+ readonly name: "endHour";
743
+ readonly type: "number";
744
+ readonly bytes: 1;
745
+ readonly defaultValue: 0;
746
+ }, {
747
+ readonly name: "endMinute";
748
+ readonly type: "number";
749
+ readonly bytes: 1;
750
+ readonly defaultValue: 0;
751
+ }];
752
+ }, {
753
+ readonly name: "validNum";
754
+ }, {
755
+ readonly name: "pwdLength";
756
+ }, {
757
+ readonly name: "pwd";
758
+ readonly type: "number";
759
+ readonly limit: "pwdLength";
760
+ readonly loop: true;
761
+ readonly defaultValue: readonly [];
762
+ }];
763
+ updateMemberRole: readonly [{
764
+ readonly name: "type";
765
+ }, {
766
+ readonly name: "stage";
767
+ }, {
768
+ readonly name: "admin";
769
+ readonly type: "boolean";
770
+ readonly defaultValue: false;
771
+ }, {
772
+ readonly name: "memberId";
773
+ }, {
774
+ readonly name: "unlockId";
775
+ }];
776
+ reportUpdate: readonly [{
777
+ readonly name: "type";
778
+ }, {
779
+ readonly name: "stage";
780
+ }, {
781
+ readonly name: "admin";
782
+ readonly type: "boolean";
783
+ readonly defaultValue: false;
784
+ }, {
785
+ readonly name: "memberId";
786
+ }, {
787
+ readonly name: "unlockId";
788
+ }, {
789
+ readonly name: "validNum";
790
+ }, {
791
+ readonly name: "status";
792
+ }];
793
+ addTempPwd: readonly [{
794
+ readonly name: "cloudNo";
795
+ readonly bytes: 2;
796
+ }, {
797
+ readonly name: "valid";
798
+ readonly type: "boolean";
799
+ }, {
800
+ readonly name: "validConfig";
801
+ readonly type: "child";
802
+ readonly bytes: 17;
803
+ readonly childMap: readonly [{
804
+ readonly name: "startTime";
805
+ readonly bytes: 4;
806
+ }, {
807
+ readonly name: "endTime";
808
+ readonly bytes: 4;
809
+ }, {
810
+ readonly name: "loop";
811
+ }, {
812
+ readonly name: "loopConfig";
813
+ readonly condition: {
814
+ readonly type: "and";
815
+ readonly conditions: readonly [{
816
+ readonly prop: "validConfig.loop";
817
+ readonly value: 2;
818
+ readonly operation: "neq";
819
+ }, {
820
+ readonly prop: "loop";
821
+ readonly value: 3;
822
+ readonly operation: "neq";
823
+ }];
824
+ };
825
+ readonly bytes: 4;
826
+ readonly defaultValue: 0;
827
+ }, {
828
+ readonly name: "weeks";
829
+ readonly condition: {
830
+ readonly prop: "validConfig.loop";
831
+ readonly value: 2;
832
+ };
833
+ readonly type: "custom";
834
+ readonly bytes: 4;
835
+ readonly parse: (value: number) => number[];
836
+ readonly format: (value: number[]) => string;
837
+ readonly defaultValue: readonly [0, 0, 0, 0, 0, 0, 0];
838
+ }, {
839
+ readonly name: "days";
840
+ readonly condition: {
841
+ readonly prop: "validConfig.loop";
842
+ readonly value: 3;
843
+ };
844
+ readonly type: "bits";
845
+ readonly bytes: 4;
846
+ readonly defaultValue: 0;
847
+ }, {
848
+ readonly name: "startHour";
849
+ readonly type: "number";
850
+ readonly bytes: 1;
851
+ readonly defaultValue: 0;
852
+ }, {
853
+ readonly name: "startMinute";
854
+ readonly type: "number";
855
+ readonly bytes: 1;
856
+ readonly defaultValue: 0;
857
+ }, {
858
+ readonly name: "endHour";
859
+ readonly type: "number";
860
+ readonly bytes: 1;
861
+ readonly defaultValue: 0;
862
+ }, {
863
+ readonly name: "endMinute";
864
+ readonly type: "number";
865
+ readonly bytes: 1;
866
+ readonly defaultValue: 0;
867
+ }];
868
+ }, {
869
+ readonly name: "validNum";
870
+ }, {
871
+ readonly name: "pwdLength";
872
+ }, {
873
+ readonly name: "pwd";
874
+ readonly type: "number";
875
+ readonly limit: "pwdLength";
876
+ readonly loop: true;
877
+ readonly defaultValue: readonly [];
878
+ }];
879
+ reportAddTempPwd: readonly [{
880
+ readonly name: "cloudNo";
881
+ readonly bytes: 2;
882
+ }, {
883
+ readonly name: "unlockId";
884
+ }, {
885
+ readonly name: "status";
886
+ }];
887
+ removeTempPwd: DpMap;
888
+ reportRemoveTempPwd: DpMap;
889
+ updateTempPwd: ({
890
+ readonly name: "validConfig";
891
+ readonly type: "child";
892
+ readonly bytes: 17;
893
+ readonly childMap: readonly [{
894
+ readonly name: "startTime";
895
+ readonly bytes: 4;
896
+ }, {
897
+ readonly name: "endTime";
898
+ readonly bytes: 4;
899
+ }, {
900
+ readonly name: "loop";
901
+ }, {
902
+ readonly name: "loopConfig";
903
+ readonly condition: {
904
+ readonly type: "and";
905
+ readonly conditions: readonly [{
906
+ readonly prop: "validConfig.loop";
907
+ readonly value: 2;
908
+ readonly operation: "neq";
909
+ }, {
910
+ readonly prop: "loop";
911
+ readonly value: 3;
912
+ readonly operation: "neq";
913
+ }];
914
+ };
915
+ readonly bytes: 4;
916
+ readonly defaultValue: 0;
917
+ }, {
918
+ readonly name: "weeks";
919
+ readonly condition: {
920
+ readonly prop: "validConfig.loop";
921
+ readonly value: 2;
922
+ };
923
+ readonly type: "custom";
924
+ readonly bytes: 4;
925
+ readonly parse: (value: number) => number[];
926
+ readonly format: (value: number[]) => string;
927
+ readonly defaultValue: readonly [0, 0, 0, 0, 0, 0, 0];
928
+ }, {
929
+ readonly name: "days";
930
+ readonly condition: {
931
+ readonly prop: "validConfig.loop";
932
+ readonly value: 3;
933
+ };
934
+ readonly type: "bits";
935
+ readonly bytes: 4;
936
+ readonly defaultValue: 0;
937
+ }, {
938
+ readonly name: "startHour";
939
+ readonly type: "number";
940
+ readonly bytes: 1;
941
+ readonly defaultValue: 0;
942
+ }, {
943
+ readonly name: "startMinute";
944
+ readonly type: "number";
945
+ readonly bytes: 1;
946
+ readonly defaultValue: 0;
947
+ }, {
948
+ readonly name: "endHour";
949
+ readonly type: "number";
950
+ readonly bytes: 1;
951
+ readonly defaultValue: 0;
952
+ }, {
953
+ readonly name: "endMinute";
954
+ readonly type: "number";
955
+ readonly bytes: 1;
956
+ readonly defaultValue: 0;
957
+ }];
958
+ } | {
959
+ readonly name: "pwdLength";
960
+ } | {
961
+ readonly name: "pwd";
962
+ readonly type: "number";
963
+ readonly limit: "pwdLength";
964
+ readonly loop: true;
965
+ readonly defaultValue: readonly [];
966
+ } | {
967
+ name: string;
968
+ type?: undefined;
969
+ } | {
970
+ name: string;
971
+ type: string;
972
+ })[];
973
+ reportUpdateTempPwd: DpMap;
974
+ sync: DpMap;
975
+ reportSync: DpMap;
976
+ };
977
+ export default _default;
@@ -187,7 +187,61 @@ const reportSync = [
187
187
  name: "stage",
188
188
  },
189
189
  {
190
- name: "package",
190
+ name: "packageNo",
191
+ },
192
+ {
193
+ condition: {
194
+ prop: "stage",
195
+ value: 0,
196
+ },
197
+ name: "data",
198
+ loop: true,
199
+ type: "child",
200
+ childMap: [
201
+ {
202
+ name: "unlockId",
203
+ },
204
+ {
205
+ name: "unlockType",
206
+ },
207
+ {
208
+ condition: {
209
+ prop: "unlockType",
210
+ operation: "neq",
211
+ value: 0xf0,
212
+ },
213
+ name: "memberId",
214
+ },
215
+ {
216
+ condition: {
217
+ prop: "unlockType",
218
+ operation: "eq",
219
+ value: 0xf0,
220
+ },
221
+ name: "cloundNo",
222
+ bytes: 2,
223
+ },
224
+ {
225
+ name: "status",
226
+ },
227
+ ],
191
228
  },
192
229
  ];
193
230
  export { add, reportAdd, remove, reportRemove, update, updateMemberRole, reportUpdate, addTempPwd, reportAddTempPwd, removeTempPwd, reportRemoveTempPwd, updateTempPwd, reportUpdateTempPwd, sync, reportSync, };
231
+ export default {
232
+ add,
233
+ reportAdd,
234
+ remove,
235
+ reportRemove,
236
+ update,
237
+ updateMemberRole,
238
+ reportUpdate,
239
+ addTempPwd,
240
+ reportAddTempPwd,
241
+ removeTempPwd,
242
+ reportRemoveTempPwd,
243
+ updateTempPwd,
244
+ reportUpdateTempPwd,
245
+ sync,
246
+ reportSync,
247
+ };
@@ -1,5 +1,5 @@
1
1
  import { ProductCommunicationType } from "../constant";
2
- import { CapabilityInfo, DeviceInfo, DpSchema, RemotePermission, DeviceStatus } from "../interface";
2
+ import { CapabilityInfo, DeviceInfo, DpSchema, RemotePermission, DeviceStatus, LockSDKOption } from "../interface";
3
3
  declare const config: {
4
4
  devInfo: DeviceInfo;
5
5
  dpSchema: Record<string, DpSchema>;
@@ -16,6 +16,12 @@ declare const config: {
16
16
  strictMode: boolean;
17
17
  imageAngle: number;
18
18
  videoAngle: number;
19
+ supportMultipleFace: boolean;
20
+ supportOfflineDps: boolean;
19
21
  deviceStatus: DeviceStatus;
20
22
  };
23
+ type UpdateConfigParams = Omit<LockSDKOption, "devInfo" | "deviceId">;
24
+ export declare const updateConfig: (options: UpdateConfigParams) => void;
25
+ export declare const hasCapability: (capability: ProductCommunicationType) => boolean;
26
+ export declare const hasDp: (dpCode: string) => boolean;
21
27
  export default config;
@@ -14,10 +14,27 @@ const config = {
14
14
  strictMode: true,
15
15
  imageAngle: 0,
16
16
  videoAngle: 0,
17
+ supportMultipleFace: false,
18
+ supportOfflineDps: false,
17
19
  deviceStatus: {
18
20
  type: "offline",
19
- connectEanble: false,
21
+ connectEnable: false,
20
22
  onlineType: "none",
23
+ isWifiActive: false,
21
24
  },
22
25
  };
26
+ export const updateConfig = (options) => {
27
+ Object.keys(options).forEach((key) => {
28
+ const value = options[key];
29
+ if (value !== undefined) {
30
+ config[key] = value;
31
+ }
32
+ });
33
+ };
34
+ export const hasCapability = (capability) => {
35
+ return config.communication.includes(capability);
36
+ };
37
+ export const hasDp = (dpCode) => {
38
+ return !!config.dpSchema[dpCode];
39
+ };
23
40
  export default config;
package/lib/index.d.ts CHANGED
@@ -1,6 +1,9 @@
1
+ import { hasCapability, hasDp, updateConfig } from "./config";
1
2
  import { LockSDKOption } from "./interface";
2
3
  import { getCurrentUser, getDeviceStatus, onDeviceStatusChange, offDeviceStatusChange, getCurrentUserSync, getMediaRotate } from "./state";
3
- import { syncUnlockMethod } from "./sync/unlock-mothod";
4
+ import { syncUnlockMethod } from "./sync/unlock-method";
5
+ import { publishDps } from "./utils/publishDps";
6
+ import { publishOfflineDps, getOfflineDps, isOfflineDpSyncing, onOfflineDpsUpdate, offOfflineDpsUpdate, getOfflineDpCache } from "./offline-dps";
4
7
  export * from "./user";
5
8
  export * from "./unlock-method";
6
9
  export * from "./temporary";
@@ -13,6 +16,7 @@ export * from "./constant";
13
16
  export * from "./other";
14
17
  export * from "./media";
15
18
  export * from "./linkage";
19
+ export * from "./capability";
16
20
  export declare const init: (options?: LockSDKOption) => Promise<void>;
17
21
  export declare const destroy: () => void;
18
- export { getCurrentUser, getMediaRotate, getCurrentUserSync, syncUnlockMethod, getDeviceStatus, onDeviceStatusChange, offDeviceStatusChange, };
22
+ export { getCurrentUser, getMediaRotate, getCurrentUserSync, syncUnlockMethod, getDeviceStatus, onDeviceStatusChange, offDeviceStatusChange, updateConfig, hasCapability, hasDp, publishDps, publishOfflineDps, getOfflineDps, isOfflineDpSyncing, onOfflineDpsUpdate, offOfflineDpsUpdate, getOfflineDpCache, };
package/lib/index.js CHANGED
@@ -1,9 +1,11 @@
1
- import config from "./config";
1
+ import config, { hasCapability, hasDp, updateConfig } from "./config";
2
2
  import dpCodes from "./config/dp-code";
3
3
  import { addEvents, clearState, initState, removeEvents, getCurrentUser, getDeviceStatus, onDeviceStatusChange, offDeviceStatusChange, getCurrentUserSync, getMediaRotate, } from "./state";
4
4
  import { getCapabilities } from "./utils";
5
5
  import { getDeviceInfo, getLaunchOptionsSync } from "./utils/device";
6
- import { syncUnlockMethod } from "./sync/unlock-mothod";
6
+ import { syncUnlockMethod } from "./sync/unlock-method";
7
+ import { publishDps } from "./utils/publishDps";
8
+ import { publishOfflineDps, getOfflineDps, isOfflineDpSyncing, onOfflineDpsUpdate, offOfflineDpsUpdate, getOfflineDpCache, } from "./offline-dps";
7
9
  export * from "./user";
8
10
  export * from "./unlock-method";
9
11
  export * from "./temporary";
@@ -16,6 +18,7 @@ export * from "./constant";
16
18
  export * from "./other";
17
19
  export * from "./media";
18
20
  export * from "./linkage";
21
+ export * from "./capability";
19
22
  export const init = async (options) => {
20
23
  let { devInfo, deviceId } = options || {};
21
24
  if (!devInfo && !deviceId) {
@@ -50,6 +53,8 @@ export const init = async (options) => {
50
53
  config.strictMode = options?.strictMode ?? true;
51
54
  config.passwordDigitalBase = options?.passwordDigitalBase ?? 10;
52
55
  config.passwordSupportZero = options?.passwordSupportZero ?? true;
56
+ config.supportMultipleFace = options?.supportMultipleFace ?? false;
57
+ config.supportOfflineDps = options?.supportOfflineDps ?? false;
53
58
  config.devInfo = devInfo;
54
59
  config.dpSchema = dpSchema;
55
60
  config.codesById = codesById;
@@ -63,4 +68,4 @@ export const destroy = () => {
63
68
  clearState();
64
69
  removeEvents();
65
70
  };
66
- export { getCurrentUser, getMediaRotate, getCurrentUserSync, syncUnlockMethod, getDeviceStatus, onDeviceStatusChange, offDeviceStatusChange, };
71
+ export { getCurrentUser, getMediaRotate, getCurrentUserSync, syncUnlockMethod, getDeviceStatus, onDeviceStatusChange, offDeviceStatusChange, updateConfig, hasCapability, hasDp, publishDps, publishOfflineDps, getOfflineDps, isOfflineDpSyncing, onOfflineDpsUpdate, offOfflineDpsUpdate, getOfflineDpCache, };