@homebridge-eufy-security/eufy-security-client 3.7.2-dev.0

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 (129) hide show
  1. package/.prettierignore/342/200/216 +8 -0
  2. package/.prettierrc +11 -0
  3. package/LICENSE +21 -0
  4. package/README.md +970 -0
  5. package/build/error.d.ts +138 -0
  6. package/build/error.js +190 -0
  7. package/build/error.js.map +1 -0
  8. package/build/eufysecurity.d.ts +180 -0
  9. package/build/eufysecurity.js +3148 -0
  10. package/build/eufysecurity.js.map +1 -0
  11. package/build/http/api.d.ts +119 -0
  12. package/build/http/api.js +1877 -0
  13. package/build/http/api.js.map +1 -0
  14. package/build/http/cache.d.ts +8 -0
  15. package/build/http/cache.js +34 -0
  16. package/build/http/cache.js.map +1 -0
  17. package/build/http/const.d.ts +8 -0
  18. package/build/http/const.js +3054 -0
  19. package/build/http/const.js.map +1 -0
  20. package/build/http/device.d.ts +490 -0
  21. package/build/http/device.js +5256 -0
  22. package/build/http/device.js.map +1 -0
  23. package/build/http/error.d.ts +73 -0
  24. package/build/http/error.js +101 -0
  25. package/build/http/error.js.map +1 -0
  26. package/build/http/index.d.ts +10 -0
  27. package/build/http/index.js +30 -0
  28. package/build/http/index.js.map +1 -0
  29. package/build/http/interfaces.d.ts +248 -0
  30. package/build/http/interfaces.js +3 -0
  31. package/build/http/interfaces.js.map +1 -0
  32. package/build/http/models.d.ts +608 -0
  33. package/build/http/models.js +3 -0
  34. package/build/http/models.js.map +1 -0
  35. package/build/http/parameter.d.ts +7 -0
  36. package/build/http/parameter.js +119 -0
  37. package/build/http/parameter.js.map +1 -0
  38. package/build/http/station.d.ts +382 -0
  39. package/build/http/station.js +15735 -0
  40. package/build/http/station.js.map +1 -0
  41. package/build/http/types.d.ts +1358 -0
  42. package/build/http/types.js +10333 -0
  43. package/build/http/types.js.map +1 -0
  44. package/build/http/utils.d.ts +89 -0
  45. package/build/http/utils.js +916 -0
  46. package/build/http/utils.js.map +1 -0
  47. package/build/index.d.ts +8 -0
  48. package/build/index.js +29 -0
  49. package/build/index.js.map +1 -0
  50. package/build/interfaces.d.ts +147 -0
  51. package/build/interfaces.js +7 -0
  52. package/build/interfaces.js.map +1 -0
  53. package/build/logging.d.ts +36 -0
  54. package/build/logging.js +119 -0
  55. package/build/logging.js.map +1 -0
  56. package/build/mqtt/interface.d.ts +6 -0
  57. package/build/mqtt/interface.js +3 -0
  58. package/build/mqtt/interface.js.map +1 -0
  59. package/build/mqtt/model.d.ts +24 -0
  60. package/build/mqtt/model.js +3 -0
  61. package/build/mqtt/model.js.map +1 -0
  62. package/build/mqtt/mqtt-eufy.crt +79 -0
  63. package/build/mqtt/proto/lock.proto +33 -0
  64. package/build/mqtt/service.d.ts +28 -0
  65. package/build/mqtt/service.js +196 -0
  66. package/build/mqtt/service.js.map +1 -0
  67. package/build/p2p/ble.d.ts +59 -0
  68. package/build/p2p/ble.js +281 -0
  69. package/build/p2p/ble.js.map +1 -0
  70. package/build/p2p/error.d.ts +49 -0
  71. package/build/p2p/error.js +69 -0
  72. package/build/p2p/error.js.map +1 -0
  73. package/build/p2p/index.d.ts +8 -0
  74. package/build/p2p/index.js +28 -0
  75. package/build/p2p/index.js.map +1 -0
  76. package/build/p2p/interfaces.d.ts +423 -0
  77. package/build/p2p/interfaces.js +3 -0
  78. package/build/p2p/interfaces.js.map +1 -0
  79. package/build/p2p/models.d.ts +295 -0
  80. package/build/p2p/models.js +3 -0
  81. package/build/p2p/models.js.map +1 -0
  82. package/build/p2p/session.d.ts +186 -0
  83. package/build/p2p/session.js +3737 -0
  84. package/build/p2p/session.js.map +1 -0
  85. package/build/p2p/talkback.d.ts +8 -0
  86. package/build/p2p/talkback.js +23 -0
  87. package/build/p2p/talkback.js.map +1 -0
  88. package/build/p2p/types.d.ts +1164 -0
  89. package/build/p2p/types.js +1219 -0
  90. package/build/p2p/types.js.map +1 -0
  91. package/build/p2p/utils.d.ts +72 -0
  92. package/build/p2p/utils.js +865 -0
  93. package/build/p2p/utils.js.map +1 -0
  94. package/build/push/client.d.ts +49 -0
  95. package/build/push/client.js +344 -0
  96. package/build/push/client.js.map +1 -0
  97. package/build/push/error.d.ts +73 -0
  98. package/build/push/error.js +101 -0
  99. package/build/push/error.js.map +1 -0
  100. package/build/push/index.d.ts +6 -0
  101. package/build/push/index.js +26 -0
  102. package/build/push/index.js.map +1 -0
  103. package/build/push/interfaces.d.ts +19 -0
  104. package/build/push/interfaces.js +3 -0
  105. package/build/push/interfaces.js.map +1 -0
  106. package/build/push/models.d.ts +328 -0
  107. package/build/push/models.js +38 -0
  108. package/build/push/models.js.map +1 -0
  109. package/build/push/parser.d.ts +25 -0
  110. package/build/push/parser.js +231 -0
  111. package/build/push/parser.js.map +1 -0
  112. package/build/push/proto/checkin.proto +266 -0
  113. package/build/push/proto/mcs.proto +328 -0
  114. package/build/push/service.d.ts +46 -0
  115. package/build/push/service.js +965 -0
  116. package/build/push/service.js.map +1 -0
  117. package/build/push/types.d.ts +220 -0
  118. package/build/push/types.js +244 -0
  119. package/build/push/types.js.map +1 -0
  120. package/build/push/utils.d.ts +7 -0
  121. package/build/push/utils.js +116 -0
  122. package/build/push/utils.js.map +1 -0
  123. package/build/utils.d.ts +115 -0
  124. package/build/utils.js +438 -0
  125. package/build/utils.js.map +1 -0
  126. package/eslint.config.mts +68 -0
  127. package/jest.config.js +14 -0
  128. package/package.json +85 -0
  129. package/scripts/cut_release.sh +31 -0
@@ -0,0 +1,89 @@
1
+ import { Device } from "./device";
2
+ import { Picture, Schedule } from "./interfaces";
3
+ import { FloodlightT8425NotificationTypes, HB3DetectionTypes, IndoorS350DetectionTypes, IndoorS350NotificationTypes, NotificationSwitchMode, SignalLevel, SmartLockNotification, SourceType, T8170DetectionTypes, EufyCamC35DetectionTypes } from "./types";
4
+ import { HTTPApi } from "./api";
5
+ import { LockPushEvent } from "./../push/types";
6
+ import { Station } from "./station";
7
+ import { PushMessage } from "../push/models";
8
+ export declare const normalizeVersionString: (version: string) => number[] | null;
9
+ export declare const isGreaterEqualMinVersion: (minimal_version: string, current_version: string) => boolean;
10
+ export declare const pad: (num: number) => string;
11
+ export declare const getTimezoneGMTString: () => string;
12
+ export declare const getAbsoluteFilePath: (device_type: number, channel: number, filename: string) => string;
13
+ export declare const getImageFilePath: (device_type: number, channel: number, filename: string) => string;
14
+ export declare const isNotificationSwitchMode: (value: number, mode: NotificationSwitchMode) => boolean;
15
+ export declare const switchNotificationMode: (currentValue: number, mode: NotificationSwitchMode, enable: boolean) => number;
16
+ export declare const calculateWifiSignalLevel: (device: Device, rssi: number) => SignalLevel;
17
+ export declare const calculateCellularSignalLevel: (rssi: number) => SignalLevel;
18
+ export declare const encryptAPIData: (data: string, key: Buffer) => string;
19
+ export declare const decryptAPIData: (data: string, key: Buffer) => Buffer;
20
+ export declare const getBlocklist: (distanceArray: Array<number>) => Array<number>;
21
+ export declare const getDistances: (rawDistanceData: Array<number>) => Array<number>;
22
+ export declare const isDeliveryPackageType: (value: number) => boolean;
23
+ export declare const isHB3DetectionModeEnabled: (value: number, type: HB3DetectionTypes) => boolean;
24
+ export declare const getHB3DetectionMode: (value: number, type: HB3DetectionTypes, enable: boolean) => number;
25
+ export interface EufyTimezone {
26
+ timeZoneName: string;
27
+ timeId: string;
28
+ timeSn: string;
29
+ timeZoneGMT: string;
30
+ }
31
+ export declare const getEufyTimezone: () => EufyTimezone | undefined;
32
+ export declare const getAdvancedLockTimezone: (stationSN: string) => string;
33
+ export declare class WritePayload {
34
+ private split_byte;
35
+ private data;
36
+ write(bytes: Buffer): void;
37
+ getData(): Buffer;
38
+ }
39
+ export declare class ParsePayload {
40
+ /**
41
+ * extract specific pieces of data from a binary buffer
42
+ *
43
+ * @private
44
+ */
45
+ private readonly data;
46
+ constructor(data: Buffer);
47
+ readUint32BE(indexValue: number): number;
48
+ readUint32LE(indexValue: number): number;
49
+ readUint16BE(indexValue: number): number;
50
+ readUint16LE(indexValue: number): number;
51
+ readString(indexValue: number): string;
52
+ readStringHex(indexValue: number): string;
53
+ readInt8(indexValue: number): number;
54
+ readData(indexValue: number): Buffer;
55
+ private getDataPosition;
56
+ private getNextStep;
57
+ }
58
+ export declare const encodePasscode: (pass: string) => string;
59
+ export declare const hexDate: (date: Date) => string;
60
+ export declare const hexTime: (date: Date) => string;
61
+ export declare const hexWeek: (schedule: Schedule) => string;
62
+ export declare const hexStringScheduleToSchedule: (startDay: string, startTime: string, endDay: string, endTime: string, week: string) => Schedule;
63
+ export declare const randomNumber: (min: number, max: number) => number;
64
+ export declare const getIdSuffix: (p2pDid: string) => number;
65
+ export declare const getImageBaseCode: (serialNumber: string, p2pDid: string) => string;
66
+ export declare const getImageSeed: (p2pDid: string, code: string) => string;
67
+ export declare const getImageKey: (serialNumber: string, p2pDid: string, code: string) => string;
68
+ export declare const decodeImage: (p2pDid: string, data: Buffer) => Buffer;
69
+ export declare const getImagePath: (path: string) => string;
70
+ export declare const getImage: (api: HTTPApi, serial: string, url: string) => Promise<Picture>;
71
+ export declare const isPrioritySourceType: (current: SourceType | undefined, update: SourceType) => boolean;
72
+ export declare const decryptTrackerData: (data: Buffer, key: Buffer) => Buffer;
73
+ export declare const isT8170DetectionModeEnabled: (value: number, type: T8170DetectionTypes) => boolean;
74
+ export declare const getT8170DetectionMode: (value: number, type: T8170DetectionTypes, enable: boolean) => number;
75
+ export declare const isT8110DetectionModeEnabled: (value: number, type: EufyCamC35DetectionTypes) => boolean;
76
+ export declare const getT8110DetectionMode: (value: number, type: EufyCamC35DetectionTypes, enable: boolean) => number;
77
+ export declare const isIndoorS350DetectionModeEnabled: (value: number, type: IndoorS350DetectionTypes) => boolean;
78
+ export declare const getIndoorS350DetectionMode: (value: number, type: IndoorS350DetectionTypes, enable: boolean) => number;
79
+ export declare const isIndoorNotificationEnabled: (value: number, type: IndoorS350NotificationTypes) => boolean;
80
+ export declare const getIndoorNotification: (value: number, type: IndoorS350NotificationTypes, enable: boolean) => number;
81
+ export declare const isFloodlightT8425NotificationEnabled: (value: number, type: FloodlightT8425NotificationTypes) => boolean;
82
+ export declare const getFloodLightT8425Notification: (value: number, type: FloodlightT8425NotificationTypes, enable: boolean) => number;
83
+ export declare const getLockEventType: (event: LockPushEvent) => number;
84
+ export declare const switchSmartLockNotification: (currentValue: number, mode: SmartLockNotification, enable: boolean) => number;
85
+ export declare const isSmartLockNotification: (value: number, mode: SmartLockNotification) => boolean;
86
+ export declare const getWaitSeconds: (device: Device) => number;
87
+ export declare const loadImageOverP2P: (station: Station, device: Device, id: string, p2pTimeouts: Map<string, NodeJS.Timeout>) => void;
88
+ export declare const loadEventImage: (station: Station, api: HTTPApi, device: Device, message: PushMessage, p2pTimeouts: Map<string, NodeJS.Timeout>) => void;
89
+ export declare const getRandomPhoneModel: () => string;