eufy-security-client 3.6.0 → 3.7.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 (74) hide show
  1. package/.prettierignore/342/200/216 +8 -0
  2. package/.prettierrc +11 -0
  3. package/README.md +18 -0
  4. package/a.ts +61 -0
  5. package/build/error.js.map +1 -1
  6. package/build/eufysecurity.d.ts +1 -0
  7. package/build/eufysecurity.js +721 -224
  8. package/build/eufysecurity.js.map +1 -1
  9. package/build/http/api.d.ts +29 -0
  10. package/build/http/api.js +991 -701
  11. package/build/http/api.js.map +1 -1
  12. package/build/http/cache.js.map +1 -1
  13. package/build/http/const.d.ts +6 -1
  14. package/build/http/const.js +2044 -7536
  15. package/build/http/const.js.map +1 -1
  16. package/build/http/device.d.ts +4 -0
  17. package/build/http/device.js +1325 -440
  18. package/build/http/device.js.map +1 -1
  19. package/build/http/error.js.map +1 -1
  20. package/build/http/index.js.map +1 -1
  21. package/build/http/interfaces.d.ts +22 -15
  22. package/build/http/models.d.ts +2 -1
  23. package/build/http/parameter.js +74 -63
  24. package/build/http/parameter.js.map +1 -1
  25. package/build/http/station.d.ts +20 -2
  26. package/build/http/station.js +8639 -3566
  27. package/build/http/station.js.map +1 -1
  28. package/build/http/types.d.ts +12 -0
  29. package/build/http/types.js +297 -155
  30. package/build/http/types.js.map +1 -1
  31. package/build/http/utils.d.ts +16 -6
  32. package/build/http/utils.js +335 -208
  33. package/build/http/utils.js.map +1 -1
  34. package/build/index.js.map +1 -1
  35. package/build/interfaces.d.ts +4 -3
  36. package/build/logging.js +8 -13
  37. package/build/logging.js.map +1 -1
  38. package/build/mqtt/interface.d.ts +2 -2
  39. package/build/mqtt/service.js +12 -3
  40. package/build/mqtt/service.js.map +1 -1
  41. package/build/p2p/ble.js +7 -6
  42. package/build/p2p/ble.js.map +1 -1
  43. package/build/p2p/error.js.map +1 -1
  44. package/build/p2p/interfaces.d.ts +41 -6
  45. package/build/p2p/session.js +1484 -383
  46. package/build/p2p/session.js.map +1 -1
  47. package/build/p2p/talkback.js.map +1 -1
  48. package/build/p2p/types.js +36 -36
  49. package/build/p2p/types.js.map +1 -1
  50. package/build/p2p/utils.d.ts +10 -0
  51. package/build/p2p/utils.js +183 -90
  52. package/build/p2p/utils.js.map +1 -1
  53. package/build/push/client.js +15 -4
  54. package/build/push/client.js.map +1 -1
  55. package/build/push/error.js.map +1 -1
  56. package/build/push/interfaces.d.ts +8 -8
  57. package/build/push/models.js.map +1 -1
  58. package/build/push/parser.js +6 -2
  59. package/build/push/parser.js.map +1 -1
  60. package/build/push/service.js +214 -85
  61. package/build/push/service.js.map +1 -1
  62. package/build/push/types.js.map +1 -1
  63. package/build/push/utils.js.map +1 -1
  64. package/build/utils.js +7 -15
  65. package/build/utils.js.map +1 -1
  66. package/coverage/clover.xml +11133 -13648
  67. package/coverage/coverage-final.json +20 -30
  68. package/coverage/lcov-report/error.ts.html +3 -3
  69. package/coverage/lcov-report/index.html +50 -65
  70. package/coverage/lcov-report/logging.ts.html +598 -0
  71. package/coverage/lcov.info +21072 -25751
  72. package/dont-care.js +101 -0
  73. package/package.json +9 -5
  74. package/build/package.json +0 -81
@@ -1,10 +1,11 @@
1
1
  import { Device } from "./device";
2
2
  import { Picture, Schedule } from "./interfaces";
3
- import { NotificationSwitchMode, SignalLevel, HB3DetectionTypes, SourceType, T8170DetectionTypes, IndoorS350NotificationTypes, FloodlightT8425NotificationTypes, SmartLockNotification, IndoorS350DetectionTypes } from "./types";
3
+ import { FloodlightT8425NotificationTypes, HB3DetectionTypes, IndoorS350DetectionTypes, IndoorS350NotificationTypes, NotificationSwitchMode, SignalLevel, SmartLockNotification, SourceType, T8170DetectionTypes, EufyCamC35DetectionTypes } from "./types";
4
4
  import { HTTPApi } from "./api";
5
5
  import { LockPushEvent } from "./../push/types";
6
6
  import { Station } from "./station";
7
7
  import { PushMessage } from "../push/models";
8
+ export declare const normalizeVersionString: (version: string) => number[] | null;
8
9
  export declare const isGreaterEqualMinVersion: (minimal_version: string, current_version: string) => boolean;
9
10
  export declare const pad: (num: number) => string;
10
11
  export declare const getTimezoneGMTString: () => string;
@@ -16,8 +17,9 @@ export declare const calculateWifiSignalLevel: (device: Device, rssi: number) =>
16
17
  export declare const calculateCellularSignalLevel: (rssi: number) => SignalLevel;
17
18
  export declare const encryptAPIData: (data: string, key: Buffer) => string;
18
19
  export declare const decryptAPIData: (data: string, key: Buffer) => Buffer;
19
- export declare const getBlocklist: (directions: Array<number>) => Array<number>;
20
- export declare const getDistances: (blocklist: Array<number>) => Array<number>;
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;
21
23
  export declare const isHB3DetectionModeEnabled: (value: number, type: HB3DetectionTypes) => boolean;
22
24
  export declare const getHB3DetectionMode: (value: number, type: HB3DetectionTypes, enable: boolean) => number;
23
25
  export interface EufyTimezone {
@@ -35,7 +37,12 @@ export declare class WritePayload {
35
37
  getData(): Buffer;
36
38
  }
37
39
  export declare class ParsePayload {
38
- private data;
40
+ /**
41
+ * extract specific pieces of data from a binary buffer
42
+ *
43
+ * @private
44
+ */
45
+ private readonly data;
39
46
  constructor(data: Buffer);
40
47
  readUint32BE(indexValue: number): number;
41
48
  readUint32LE(indexValue: number): number;
@@ -55,9 +62,9 @@ export declare const hexWeek: (schedule: Schedule) => string;
55
62
  export declare const hexStringScheduleToSchedule: (startDay: string, startTime: string, endDay: string, endTime: string, week: string) => Schedule;
56
63
  export declare const randomNumber: (min: number, max: number) => number;
57
64
  export declare const getIdSuffix: (p2pDid: string) => number;
58
- export declare const getImageBaseCode: (serialnumber: string, p2pDid: string) => string;
65
+ export declare const getImageBaseCode: (serialNumber: string, p2pDid: string) => string;
59
66
  export declare const getImageSeed: (p2pDid: string, code: string) => string;
60
- export declare const getImageKey: (serialnumber: string, p2pDid: string, code: string) => string;
67
+ export declare const getImageKey: (serialNumber: string, p2pDid: string, code: string) => string;
61
68
  export declare const decodeImage: (p2pDid: string, data: Buffer) => Buffer;
62
69
  export declare const getImagePath: (path: string) => string;
63
70
  export declare const getImage: (api: HTTPApi, serial: string, url: string) => Promise<Picture>;
@@ -65,6 +72,8 @@ export declare const isPrioritySourceType: (current: SourceType | undefined, upd
65
72
  export declare const decryptTrackerData: (data: Buffer, key: Buffer) => Buffer;
66
73
  export declare const isT8170DetectionModeEnabled: (value: number, type: T8170DetectionTypes) => boolean;
67
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;
68
77
  export declare const isIndoorS350DetectionModeEnabled: (value: number, type: IndoorS350DetectionTypes) => boolean;
69
78
  export declare const getIndoorS350DetectionMode: (value: number, type: IndoorS350DetectionTypes, enable: boolean) => number;
70
79
  export declare const isIndoorNotitficationEnabled: (value: number, type: IndoorS350NotificationTypes) => boolean;
@@ -77,3 +86,4 @@ export declare const isSmartLockNotification: (value: number, mode: SmartLockNot
77
86
  export declare const getWaitSeconds: (device: Device) => number;
78
87
  export declare const loadImageOverP2P: (station: Station, device: Device, id: string, p2pTimeouts: Map<string, NodeJS.Timeout>) => void;
79
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;