eufy-security-client 2.4.2 → 2.4.4

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 (87) hide show
  1. package/README.md +12 -0
  2. package/build/error.d.ts +57 -57
  3. package/build/error.js +155 -155
  4. package/build/eufysecurity.d.ts +162 -161
  5. package/build/eufysecurity.js +2104 -2091
  6. package/build/eufysecurity.js.map +1 -1
  7. package/build/http/api.d.ts +90 -90
  8. package/build/http/api.js +1407 -1407
  9. package/build/http/api.js.map +1 -1
  10. package/build/http/cache.d.ts +8 -8
  11. package/build/http/cache.js +33 -33
  12. package/build/http/const.d.ts +3 -3
  13. package/build/http/const.js +8545 -8545
  14. package/build/http/device.d.ts +360 -360
  15. package/build/http/device.js +2793 -2793
  16. package/build/http/device.js.map +1 -1
  17. package/build/http/error.d.ts +28 -28
  18. package/build/http/error.js +76 -76
  19. package/build/http/index.d.ts +10 -10
  20. package/build/http/index.js +29 -29
  21. package/build/http/interfaces.d.ts +202 -202
  22. package/build/http/interfaces.js +2 -2
  23. package/build/http/models.d.ts +561 -561
  24. package/build/http/models.js +2 -2
  25. package/build/http/parameter.d.ts +5 -5
  26. package/build/http/parameter.js +75 -75
  27. package/build/http/station.d.ts +292 -292
  28. package/build/http/station.js +6780 -6780
  29. package/build/http/station.js.map +1 -1
  30. package/build/http/types.d.ts +945 -945
  31. package/build/http/types.js +6070 -6070
  32. package/build/http/utils.d.ts +37 -37
  33. package/build/http/utils.js +370 -370
  34. package/build/index.d.ts +7 -7
  35. package/build/index.js +25 -25
  36. package/build/interfaces.d.ts +113 -113
  37. package/build/interfaces.js +2 -2
  38. package/build/mqtt/interface.d.ts +6 -6
  39. package/build/mqtt/interface.js +2 -2
  40. package/build/mqtt/model.d.ts +24 -24
  41. package/build/mqtt/model.js +2 -2
  42. package/build/mqtt/service.d.ts +30 -30
  43. package/build/mqtt/service.js +168 -168
  44. package/build/mqtt/service.js.map +1 -1
  45. package/build/p2p/ble.d.ts +47 -47
  46. package/build/p2p/ble.js +188 -188
  47. package/build/p2p/ble.js.map +1 -1
  48. package/build/p2p/error.d.ts +24 -24
  49. package/build/p2p/error.js +67 -67
  50. package/build/p2p/index.d.ts +8 -8
  51. package/build/p2p/index.js +27 -27
  52. package/build/p2p/interfaces.d.ts +162 -162
  53. package/build/p2p/interfaces.js +2 -2
  54. package/build/p2p/models.d.ts +146 -146
  55. package/build/p2p/models.js +2 -2
  56. package/build/p2p/session.d.ts +168 -168
  57. package/build/p2p/session.js +2087 -2087
  58. package/build/p2p/session.js.map +1 -1
  59. package/build/p2p/talkback.d.ts +10 -10
  60. package/build/p2p/talkback.js +22 -22
  61. package/build/p2p/types.d.ts +923 -923
  62. package/build/p2p/types.js +957 -957
  63. package/build/p2p/utils.d.ts +56 -56
  64. package/build/p2p/utils.js +653 -653
  65. package/build/push/client.d.ts +51 -51
  66. package/build/push/client.js +311 -311
  67. package/build/push/client.js.map +1 -1
  68. package/build/push/index.d.ts +5 -5
  69. package/build/push/index.js +24 -24
  70. package/build/push/interfaces.d.ts +19 -19
  71. package/build/push/interfaces.js +2 -2
  72. package/build/push/models.d.ts +292 -292
  73. package/build/push/models.js +30 -30
  74. package/build/push/parser.d.ts +28 -28
  75. package/build/push/parser.js +215 -215
  76. package/build/push/parser.js.map +1 -1
  77. package/build/push/service.d.ts +45 -45
  78. package/build/push/service.js +643 -643
  79. package/build/push/service.js.map +1 -1
  80. package/build/push/types.d.ts +176 -176
  81. package/build/push/types.js +192 -192
  82. package/build/push/utils.d.ts +7 -7
  83. package/build/push/utils.js +102 -102
  84. package/build/utils.d.ts +16 -13
  85. package/build/utils.js +207 -191
  86. package/build/utils.js.map +1 -1
  87. package/package.json +10 -10
package/build/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export * from "./http";
2
- export * from "./p2p";
3
- export * from "./push";
4
- export * from "./interfaces";
5
- export * from "./eufysecurity";
6
- export * from "./error";
7
- export declare const libVersion: string;
1
+ export * from "./http";
2
+ export * from "./p2p";
3
+ export * from "./push";
4
+ export * from "./interfaces";
5
+ export * from "./eufysecurity";
6
+ export * from "./error";
7
+ export declare const libVersion: string;
package/build/index.js CHANGED
@@ -1,26 +1,26 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.libVersion = void 0;
18
- __exportStar(require("./http"), exports);
19
- __exportStar(require("./p2p"), exports);
20
- __exportStar(require("./push"), exports);
21
- __exportStar(require("./interfaces"), exports);
22
- __exportStar(require("./eufysecurity"), exports);
23
- __exportStar(require("./error"), exports);
24
- // eslint-disable-next-line @typescript-eslint/no-var-requires
25
- exports.libVersion = require("../package.json").version;
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.libVersion = void 0;
18
+ __exportStar(require("./http"), exports);
19
+ __exportStar(require("./p2p"), exports);
20
+ __exportStar(require("./push"), exports);
21
+ __exportStar(require("./interfaces"), exports);
22
+ __exportStar(require("./eufysecurity"), exports);
23
+ __exportStar(require("./error"), exports);
24
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
25
+ exports.libVersion = require("../package.json").version;
26
26
  //# sourceMappingURL=index.js.map
@@ -1,113 +1,113 @@
1
- /// <reference types="node" />
2
- import { Readable } from "stream";
3
- import { Device } from "./http/device";
4
- import { HTTPApiPersistentData, PropertyValue, Schedule } from "./http/interfaces";
5
- import { Station } from "./http/station";
6
- import { DeviceSmartLockMessage } from "./mqtt/model";
7
- import { StreamMetadata } from "./p2p/interfaces";
8
- import { CommandResult } from "./p2p/models";
9
- import { TalkbackStream } from "./p2p/talkback";
10
- import { AlarmEvent, SmartSafeAlarm911Event, SmartSafeShakeAlarmEvent } from "./p2p/types";
11
- import { Credentials, PushMessage } from "./push/models";
12
- export interface StationIPAddresses {
13
- [index: string]: string;
14
- }
15
- export interface EufySecurityConfig {
16
- username: string;
17
- password: string;
18
- country?: string;
19
- language?: string;
20
- trustedDeviceName?: string;
21
- persistentDir?: string;
22
- p2pConnectionSetup: number;
23
- pollingIntervalMinutes: number;
24
- eventDurationSeconds: number;
25
- acceptInvitations?: boolean;
26
- stationIPAddresses?: StationIPAddresses;
27
- }
28
- export interface EufySecurityPersistentData {
29
- country: string;
30
- login_hash: string;
31
- openudid: string;
32
- serial_number: string;
33
- cloud_token?: string;
34
- cloud_token_expiration?: number;
35
- push_credentials: Credentials | undefined;
36
- push_persistentIds: string[];
37
- version: string;
38
- httpApi?: HTTPApiPersistentData;
39
- fallbackTrustedDeviceName?: string;
40
- }
41
- export interface EufySecurityEvents {
42
- "device added": (device: Device) => void;
43
- "device removed": (device: Device) => void;
44
- "device property changed": (device: Device, name: string, value: PropertyValue) => void;
45
- "device raw property changed": (device: Device, type: number, value: string) => void;
46
- "device crying detected": (device: Device, state: boolean) => void;
47
- "device sound detected": (device: Device, state: boolean) => void;
48
- "device pet detected": (device: Device, state: boolean) => void;
49
- "device vehicle detected": (device: Device, state: boolean) => void;
50
- "device motion detected": (device: Device, state: boolean) => void;
51
- "device person detected": (device: Device, state: boolean, person: string) => void;
52
- "device stranger person detected": (device: Device, state: boolean) => void;
53
- "device dog detected": (device: Device, state: boolean) => void;
54
- "device dog lick detected": (device: Device, state: boolean) => void;
55
- "device dog poop detected": (device: Device, state: boolean) => void;
56
- "device rings": (device: Device, state: boolean) => void;
57
- "device locked": (device: Device, state: boolean) => void;
58
- "device open": (device: Device, state: boolean) => void;
59
- "device package delivered": (device: Device, state: boolean) => void;
60
- "device package stranded": (device: Device, state: boolean) => void;
61
- "device package taken": (device: Device, state: boolean) => void;
62
- "device someone loitering": (device: Device, state: boolean) => void;
63
- "device radar motion detected": (device: Device, state: boolean) => void;
64
- "device 911 alarm": (device: Device, state: boolean, detail: SmartSafeAlarm911Event) => void;
65
- "device shake alarm": (device: Device, state: boolean, detail: SmartSafeShakeAlarmEvent) => void;
66
- "device wrong try-protect alarm": (device: Device, state: boolean) => void;
67
- "device long time not close": (device: Device, state: boolean) => void;
68
- "device low battery": (device: Device, state: boolean) => void;
69
- "device jammed": (device: Device, state: boolean) => void;
70
- "device pin verified": (device: Device, successfull: boolean) => void;
71
- "station added": (station: Station) => void;
72
- "station removed": (station: Station) => void;
73
- "station livestream start": (station: Station, device: Device, metadata: StreamMetadata, videostream: Readable, audiostream: Readable) => void;
74
- "station livestream stop": (station: Station, device: Device) => void;
75
- "station download start": (station: Station, device: Device, metadata: StreamMetadata, videoStream: Readable, audioStream: Readable) => void;
76
- "station download finish": (station: Station, device: Device) => void;
77
- "station command result": (station: Station, result: CommandResult) => void;
78
- "station rtsp livestream start": (station: Station, device: Device) => void;
79
- "station rtsp livestream stop": (station: Station, device: Device) => void;
80
- "station rtsp url": (station: Station, device: Device, value: string) => void;
81
- "station guard mode": (station: Station, guardMode: number) => void;
82
- "station current mode": (station: Station, currentMode: number) => void;
83
- "station property changed": (station: Station, name: string, value: PropertyValue) => void;
84
- "station raw property changed": (station: Station, type: number, value: string) => void;
85
- "station alarm event": (station: Station, alarmEvent: AlarmEvent) => void;
86
- "station alarm delay event": (station: Station, alarmDelayEvent: AlarmEvent, alarmDelay: number) => void;
87
- "station alarm armed": (station: Station) => void;
88
- "station alarm arm delay event": (station: Station, armDelay: number) => void;
89
- "station connect": (station: Station) => void;
90
- "station connection error": (station: Station, error: Error) => void;
91
- "station close": (station: Station) => void;
92
- "station talkback start": (station: Station, device: Device, talkbackStream: TalkbackStream) => void;
93
- "station talkback stop": (station: Station, device: Device) => void;
94
- "push connect": () => void;
95
- "push close": () => void;
96
- "push message": (message: PushMessage) => void;
97
- "connect": () => void;
98
- "close": () => void;
99
- "connection error": (error: Error) => void;
100
- "tfa request": () => void;
101
- "captcha request": (id: string, captcha: string) => void;
102
- "cloud livestream start": (station: Station, device: Device, url: string) => void;
103
- "cloud livestream stop": (station: Station, device: Device) => void;
104
- "mqtt connect": () => void;
105
- "mqtt close": () => void;
106
- "mqtt lock message": (message: DeviceSmartLockMessage) => void;
107
- "user added": (device: Device, username: string, schedule?: Schedule) => void;
108
- "user deleted": (device: Device, username: string) => void;
109
- "user error": (device: Device, username: string, error: Error) => void;
110
- "user username updated": (device: Device, username: string) => void;
111
- "user schedule updated": (device: Device, username: string, schedule: Schedule) => void;
112
- "user passcode updated": (device: Device, username: string) => void;
113
- }
1
+ /// <reference types="node" />
2
+ import { Readable } from "stream";
3
+ import { Device } from "./http/device";
4
+ import { HTTPApiPersistentData, PropertyValue, Schedule } from "./http/interfaces";
5
+ import { Station } from "./http/station";
6
+ import { DeviceSmartLockMessage } from "./mqtt/model";
7
+ import { StreamMetadata } from "./p2p/interfaces";
8
+ import { CommandResult } from "./p2p/models";
9
+ import { TalkbackStream } from "./p2p/talkback";
10
+ import { AlarmEvent, SmartSafeAlarm911Event, SmartSafeShakeAlarmEvent } from "./p2p/types";
11
+ import { Credentials, PushMessage } from "./push/models";
12
+ export interface StationIPAddresses {
13
+ [index: string]: string;
14
+ }
15
+ export interface EufySecurityConfig {
16
+ username: string;
17
+ password: string;
18
+ country?: string;
19
+ language?: string;
20
+ trustedDeviceName?: string;
21
+ persistentDir?: string;
22
+ p2pConnectionSetup: number;
23
+ pollingIntervalMinutes: number;
24
+ eventDurationSeconds: number;
25
+ acceptInvitations?: boolean;
26
+ stationIPAddresses?: StationIPAddresses;
27
+ }
28
+ export interface EufySecurityPersistentData {
29
+ country: string;
30
+ login_hash: string;
31
+ openudid: string;
32
+ serial_number: string;
33
+ cloud_token?: string;
34
+ cloud_token_expiration?: number;
35
+ push_credentials: Credentials | undefined;
36
+ push_persistentIds: string[];
37
+ version: string;
38
+ httpApi?: HTTPApiPersistentData;
39
+ fallbackTrustedDeviceName?: string;
40
+ }
41
+ export interface EufySecurityEvents {
42
+ "device added": (device: Device) => void;
43
+ "device removed": (device: Device) => void;
44
+ "device property changed": (device: Device, name: string, value: PropertyValue) => void;
45
+ "device raw property changed": (device: Device, type: number, value: string) => void;
46
+ "device crying detected": (device: Device, state: boolean) => void;
47
+ "device sound detected": (device: Device, state: boolean) => void;
48
+ "device pet detected": (device: Device, state: boolean) => void;
49
+ "device vehicle detected": (device: Device, state: boolean) => void;
50
+ "device motion detected": (device: Device, state: boolean) => void;
51
+ "device person detected": (device: Device, state: boolean, person: string) => void;
52
+ "device stranger person detected": (device: Device, state: boolean) => void;
53
+ "device dog detected": (device: Device, state: boolean) => void;
54
+ "device dog lick detected": (device: Device, state: boolean) => void;
55
+ "device dog poop detected": (device: Device, state: boolean) => void;
56
+ "device rings": (device: Device, state: boolean) => void;
57
+ "device locked": (device: Device, state: boolean) => void;
58
+ "device open": (device: Device, state: boolean) => void;
59
+ "device package delivered": (device: Device, state: boolean) => void;
60
+ "device package stranded": (device: Device, state: boolean) => void;
61
+ "device package taken": (device: Device, state: boolean) => void;
62
+ "device someone loitering": (device: Device, state: boolean) => void;
63
+ "device radar motion detected": (device: Device, state: boolean) => void;
64
+ "device 911 alarm": (device: Device, state: boolean, detail: SmartSafeAlarm911Event) => void;
65
+ "device shake alarm": (device: Device, state: boolean, detail: SmartSafeShakeAlarmEvent) => void;
66
+ "device wrong try-protect alarm": (device: Device, state: boolean) => void;
67
+ "device long time not close": (device: Device, state: boolean) => void;
68
+ "device low battery": (device: Device, state: boolean) => void;
69
+ "device jammed": (device: Device, state: boolean) => void;
70
+ "device pin verified": (device: Device, successfull: boolean) => void;
71
+ "station added": (station: Station) => void;
72
+ "station removed": (station: Station) => void;
73
+ "station livestream start": (station: Station, device: Device, metadata: StreamMetadata, videostream: Readable, audiostream: Readable) => void;
74
+ "station livestream stop": (station: Station, device: Device) => void;
75
+ "station download start": (station: Station, device: Device, metadata: StreamMetadata, videoStream: Readable, audioStream: Readable) => void;
76
+ "station download finish": (station: Station, device: Device) => void;
77
+ "station command result": (station: Station, result: CommandResult) => void;
78
+ "station rtsp livestream start": (station: Station, device: Device) => void;
79
+ "station rtsp livestream stop": (station: Station, device: Device) => void;
80
+ "station rtsp url": (station: Station, device: Device, value: string) => void;
81
+ "station guard mode": (station: Station, guardMode: number) => void;
82
+ "station current mode": (station: Station, currentMode: number) => void;
83
+ "station property changed": (station: Station, name: string, value: PropertyValue) => void;
84
+ "station raw property changed": (station: Station, type: number, value: string) => void;
85
+ "station alarm event": (station: Station, alarmEvent: AlarmEvent) => void;
86
+ "station alarm delay event": (station: Station, alarmDelayEvent: AlarmEvent, alarmDelay: number) => void;
87
+ "station alarm armed": (station: Station) => void;
88
+ "station alarm arm delay event": (station: Station, armDelay: number) => void;
89
+ "station connect": (station: Station) => void;
90
+ "station connection error": (station: Station, error: Error) => void;
91
+ "station close": (station: Station) => void;
92
+ "station talkback start": (station: Station, device: Device, talkbackStream: TalkbackStream) => void;
93
+ "station talkback stop": (station: Station, device: Device) => void;
94
+ "push connect": () => void;
95
+ "push close": () => void;
96
+ "push message": (message: PushMessage) => void;
97
+ "connect": () => void;
98
+ "close": () => void;
99
+ "connection error": (error: Error) => void;
100
+ "tfa request": () => void;
101
+ "captcha request": (id: string, captcha: string) => void;
102
+ "cloud livestream start": (station: Station, device: Device, url: string) => void;
103
+ "cloud livestream stop": (station: Station, device: Device) => void;
104
+ "mqtt connect": () => void;
105
+ "mqtt close": () => void;
106
+ "mqtt lock message": (message: DeviceSmartLockMessage) => void;
107
+ "user added": (device: Device, username: string, schedule?: Schedule) => void;
108
+ "user deleted": (device: Device, username: string) => void;
109
+ "user error": (device: Device, username: string, error: Error) => void;
110
+ "user username updated": (device: Device, username: string) => void;
111
+ "user schedule updated": (device: Device, username: string, schedule: Schedule) => void;
112
+ "user passcode updated": (device: Device, username: string) => void;
113
+ }
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=interfaces.js.map
@@ -1,6 +1,6 @@
1
- import { DeviceSmartLockMessage } from "./model";
2
- export interface MQTTServiceEvents {
3
- "connect": () => void;
4
- "close": () => void;
5
- "lock message": (message: DeviceSmartLockMessage) => void;
6
- }
1
+ import { DeviceSmartLockMessage } from "./model";
2
+ export interface MQTTServiceEvents {
3
+ "connect": () => void;
4
+ "close": () => void;
5
+ "lock message": (message: DeviceSmartLockMessage) => void;
6
+ }
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=interface.js.map
@@ -1,24 +1,24 @@
1
- export interface DeviceSmartLockNotifyData {
2
- stationSn: string;
3
- deviceSn: string;
4
- eventType: number;
5
- eventTime: number;
6
- shortUserId: string;
7
- unknown1: string;
8
- nickName: string;
9
- userId: string;
10
- unknown2: string;
11
- deviceName: string;
12
- unknown3: string;
13
- lockState: string;
14
- }
15
- export interface DeviceSmartLockNotify {
16
- timestamp: number;
17
- uuid: string;
18
- data: DeviceSmartLockNotifyData;
19
- }
20
- export interface DeviceSmartLockMessage {
21
- eventType: number;
22
- userId: string;
23
- data: DeviceSmartLockNotify;
24
- }
1
+ export interface DeviceSmartLockNotifyData {
2
+ stationSn: string;
3
+ deviceSn: string;
4
+ eventType: number;
5
+ eventTime: number;
6
+ shortUserId: string;
7
+ unknown1: string;
8
+ nickName: string;
9
+ userId: string;
10
+ unknown2: string;
11
+ deviceName: string;
12
+ unknown3: string;
13
+ lockState: string;
14
+ }
15
+ export interface DeviceSmartLockNotify {
16
+ timestamp: number;
17
+ uuid: string;
18
+ data: DeviceSmartLockNotifyData;
19
+ }
20
+ export interface DeviceSmartLockMessage {
21
+ eventType: number;
22
+ userId: string;
23
+ data: DeviceSmartLockNotify;
24
+ }
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=model.js.map
@@ -1,30 +1,30 @@
1
- import { TypedEmitter } from "tiny-typed-emitter";
2
- import { Logger } from "ts-log";
3
- import { MQTTServiceEvents } from "./interface";
4
- export declare class MQTTService extends TypedEmitter<MQTTServiceEvents> {
5
- private readonly CLIENT_ID_FORMAT;
6
- private readonly USERNAME_FORMAT;
7
- private readonly SUBSCRIBE_NOTICE_FORMAT;
8
- private readonly SUBSCRIBE_LOCK_FORMAT;
9
- private readonly SUBSCRIBE_DOORBELL_FORMAT;
10
- private static proto;
11
- private log;
12
- private connected;
13
- private client;
14
- private connecting;
15
- private clientID?;
16
- private androidID?;
17
- private apiBase?;
18
- private email?;
19
- private subscribeLocks;
20
- private deviceSmartLockMessageModel;
21
- private constructor();
22
- static init(log?: Logger): Promise<MQTTService>;
23
- private parseSmartLockMessage;
24
- private getMQTTBrokerUrl;
25
- connect(clientID: string, androidID: string, apiBase: string, email: string): void;
26
- private _subscribeLock;
27
- subscribeLock(deviceSN: string): void;
28
- isConnected(): boolean;
29
- close(): void;
30
- }
1
+ import { TypedEmitter } from "tiny-typed-emitter";
2
+ import { Logger } from "ts-log";
3
+ import { MQTTServiceEvents } from "./interface";
4
+ export declare class MQTTService extends TypedEmitter<MQTTServiceEvents> {
5
+ private readonly CLIENT_ID_FORMAT;
6
+ private readonly USERNAME_FORMAT;
7
+ private readonly SUBSCRIBE_NOTICE_FORMAT;
8
+ private readonly SUBSCRIBE_LOCK_FORMAT;
9
+ private readonly SUBSCRIBE_DOORBELL_FORMAT;
10
+ private static proto;
11
+ private log;
12
+ private connected;
13
+ private client;
14
+ private connecting;
15
+ private clientID?;
16
+ private androidID?;
17
+ private apiBase?;
18
+ private email?;
19
+ private subscribeLocks;
20
+ private deviceSmartLockMessageModel;
21
+ private constructor();
22
+ static init(log?: Logger): Promise<MQTTService>;
23
+ private parseSmartLockMessage;
24
+ private getMQTTBrokerUrl;
25
+ connect(clientID: string, androidID: string, apiBase: string, email: string): void;
26
+ private _subscribeLock;
27
+ subscribeLock(deviceSN: string): void;
28
+ isConnected(): boolean;
29
+ close(): void;
30
+ }