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.
- package/README.md +12 -0
- package/build/error.d.ts +57 -57
- package/build/error.js +155 -155
- package/build/eufysecurity.d.ts +162 -161
- package/build/eufysecurity.js +2104 -2091
- package/build/eufysecurity.js.map +1 -1
- package/build/http/api.d.ts +90 -90
- package/build/http/api.js +1407 -1407
- package/build/http/api.js.map +1 -1
- package/build/http/cache.d.ts +8 -8
- package/build/http/cache.js +33 -33
- package/build/http/const.d.ts +3 -3
- package/build/http/const.js +8545 -8545
- package/build/http/device.d.ts +360 -360
- package/build/http/device.js +2793 -2793
- package/build/http/device.js.map +1 -1
- package/build/http/error.d.ts +28 -28
- package/build/http/error.js +76 -76
- package/build/http/index.d.ts +10 -10
- package/build/http/index.js +29 -29
- package/build/http/interfaces.d.ts +202 -202
- package/build/http/interfaces.js +2 -2
- package/build/http/models.d.ts +561 -561
- package/build/http/models.js +2 -2
- package/build/http/parameter.d.ts +5 -5
- package/build/http/parameter.js +75 -75
- package/build/http/station.d.ts +292 -292
- package/build/http/station.js +6780 -6780
- package/build/http/station.js.map +1 -1
- package/build/http/types.d.ts +945 -945
- package/build/http/types.js +6070 -6070
- package/build/http/utils.d.ts +37 -37
- package/build/http/utils.js +370 -370
- package/build/index.d.ts +7 -7
- package/build/index.js +25 -25
- package/build/interfaces.d.ts +113 -113
- package/build/interfaces.js +2 -2
- package/build/mqtt/interface.d.ts +6 -6
- package/build/mqtt/interface.js +2 -2
- package/build/mqtt/model.d.ts +24 -24
- package/build/mqtt/model.js +2 -2
- package/build/mqtt/service.d.ts +30 -30
- package/build/mqtt/service.js +168 -168
- package/build/mqtt/service.js.map +1 -1
- package/build/p2p/ble.d.ts +47 -47
- package/build/p2p/ble.js +188 -188
- package/build/p2p/ble.js.map +1 -1
- package/build/p2p/error.d.ts +24 -24
- package/build/p2p/error.js +67 -67
- package/build/p2p/index.d.ts +8 -8
- package/build/p2p/index.js +27 -27
- package/build/p2p/interfaces.d.ts +162 -162
- package/build/p2p/interfaces.js +2 -2
- package/build/p2p/models.d.ts +146 -146
- package/build/p2p/models.js +2 -2
- package/build/p2p/session.d.ts +168 -168
- package/build/p2p/session.js +2087 -2087
- package/build/p2p/session.js.map +1 -1
- package/build/p2p/talkback.d.ts +10 -10
- package/build/p2p/talkback.js +22 -22
- package/build/p2p/types.d.ts +923 -923
- package/build/p2p/types.js +957 -957
- package/build/p2p/utils.d.ts +56 -56
- package/build/p2p/utils.js +653 -653
- package/build/push/client.d.ts +51 -51
- package/build/push/client.js +311 -311
- package/build/push/client.js.map +1 -1
- package/build/push/index.d.ts +5 -5
- package/build/push/index.js +24 -24
- package/build/push/interfaces.d.ts +19 -19
- package/build/push/interfaces.js +2 -2
- package/build/push/models.d.ts +292 -292
- package/build/push/models.js +30 -30
- package/build/push/parser.d.ts +28 -28
- package/build/push/parser.js +215 -215
- package/build/push/parser.js.map +1 -1
- package/build/push/service.d.ts +45 -45
- package/build/push/service.js +643 -643
- package/build/push/service.js.map +1 -1
- package/build/push/types.d.ts +176 -176
- package/build/push/types.js +192 -192
- package/build/push/utils.d.ts +7 -7
- package/build/push/utils.js +102 -102
- package/build/utils.d.ts +16 -13
- package/build/utils.js +207 -191
- package/build/utils.js.map +1 -1
- package/package.json +10 -10
package/build/eufysecurity.d.ts
CHANGED
|
@@ -1,161 +1,162 @@
|
|
|
1
|
-
import { TypedEmitter } from "tiny-typed-emitter";
|
|
2
|
-
import { Logger } from "ts-log";
|
|
3
|
-
import { EufySecurityEvents, EufySecurityConfig } from "./interfaces";
|
|
4
|
-
import { HTTPApi } from "./http/api";
|
|
5
|
-
import { LoginOptions, Schedule } from "./http/interfaces";
|
|
6
|
-
import { Station } from "./http/station";
|
|
7
|
-
import { PushNotificationService } from "./push/service";
|
|
8
|
-
import { Credentials } from "./push/models";
|
|
9
|
-
import { Device } from "./http/device";
|
|
10
|
-
import { P2PConnectionType } from "./p2p/types";
|
|
11
|
-
export declare class EufySecurity extends TypedEmitter<EufySecurityEvents> {
|
|
12
|
-
private config;
|
|
13
|
-
private log;
|
|
14
|
-
private api;
|
|
15
|
-
private houses;
|
|
16
|
-
private stations;
|
|
17
|
-
private devices;
|
|
18
|
-
private readonly P2P_REFRESH_INTERVAL_MIN;
|
|
19
|
-
private cameraMaxLivestreamSeconds;
|
|
20
|
-
private cameraStationLivestreamTimeout;
|
|
21
|
-
private cameraCloudLivestreamTimeout;
|
|
22
|
-
private pushService;
|
|
23
|
-
private mqttService;
|
|
24
|
-
private pushCloudRegistered;
|
|
25
|
-
private pushCloudChecked;
|
|
26
|
-
private persistentFile;
|
|
27
|
-
private persistentData;
|
|
28
|
-
private connected;
|
|
29
|
-
private retries;
|
|
30
|
-
private refreshEufySecurityCloudTimeout?;
|
|
31
|
-
private refreshEufySecurityP2PTimeout;
|
|
32
|
-
private deviceSnoozeTimeout;
|
|
33
|
-
private
|
|
34
|
-
private
|
|
35
|
-
private
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
private
|
|
42
|
-
private
|
|
43
|
-
private
|
|
44
|
-
private
|
|
45
|
-
private
|
|
46
|
-
private
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
private
|
|
58
|
-
private
|
|
59
|
-
private
|
|
60
|
-
private
|
|
61
|
-
private
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
private
|
|
71
|
-
private
|
|
72
|
-
private
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
private
|
|
79
|
-
private
|
|
80
|
-
private
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
private
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
private
|
|
94
|
-
private
|
|
95
|
-
private
|
|
96
|
-
private
|
|
97
|
-
private
|
|
98
|
-
private
|
|
99
|
-
private
|
|
100
|
-
private
|
|
101
|
-
private
|
|
102
|
-
private
|
|
103
|
-
private
|
|
104
|
-
private
|
|
105
|
-
private
|
|
106
|
-
private
|
|
107
|
-
private
|
|
108
|
-
private
|
|
109
|
-
private
|
|
110
|
-
private
|
|
111
|
-
private
|
|
112
|
-
private
|
|
113
|
-
private
|
|
114
|
-
private
|
|
115
|
-
private
|
|
116
|
-
private
|
|
117
|
-
private
|
|
118
|
-
private
|
|
119
|
-
private
|
|
120
|
-
private
|
|
121
|
-
private
|
|
122
|
-
private
|
|
123
|
-
private
|
|
124
|
-
private
|
|
125
|
-
private
|
|
126
|
-
private
|
|
127
|
-
private
|
|
128
|
-
private
|
|
129
|
-
private
|
|
130
|
-
private
|
|
131
|
-
private
|
|
132
|
-
private
|
|
133
|
-
private
|
|
134
|
-
private
|
|
135
|
-
private
|
|
136
|
-
private
|
|
137
|
-
private
|
|
138
|
-
private
|
|
139
|
-
private
|
|
140
|
-
private
|
|
141
|
-
private
|
|
142
|
-
private
|
|
143
|
-
private
|
|
144
|
-
private
|
|
145
|
-
private
|
|
146
|
-
private
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
private
|
|
151
|
-
private
|
|
152
|
-
private
|
|
153
|
-
private
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
private
|
|
161
|
-
|
|
1
|
+
import { TypedEmitter } from "tiny-typed-emitter";
|
|
2
|
+
import { Logger } from "ts-log";
|
|
3
|
+
import { EufySecurityEvents, EufySecurityConfig } from "./interfaces";
|
|
4
|
+
import { HTTPApi } from "./http/api";
|
|
5
|
+
import { LoginOptions, Schedule } from "./http/interfaces";
|
|
6
|
+
import { Station } from "./http/station";
|
|
7
|
+
import { PushNotificationService } from "./push/service";
|
|
8
|
+
import { Credentials } from "./push/models";
|
|
9
|
+
import { Device } from "./http/device";
|
|
10
|
+
import { P2PConnectionType } from "./p2p/types";
|
|
11
|
+
export declare class EufySecurity extends TypedEmitter<EufySecurityEvents> {
|
|
12
|
+
private config;
|
|
13
|
+
private log;
|
|
14
|
+
private api;
|
|
15
|
+
private houses;
|
|
16
|
+
private stations;
|
|
17
|
+
private devices;
|
|
18
|
+
private readonly P2P_REFRESH_INTERVAL_MIN;
|
|
19
|
+
private cameraMaxLivestreamSeconds;
|
|
20
|
+
private cameraStationLivestreamTimeout;
|
|
21
|
+
private cameraCloudLivestreamTimeout;
|
|
22
|
+
private pushService;
|
|
23
|
+
private mqttService;
|
|
24
|
+
private pushCloudRegistered;
|
|
25
|
+
private pushCloudChecked;
|
|
26
|
+
private persistentFile;
|
|
27
|
+
private persistentData;
|
|
28
|
+
private connected;
|
|
29
|
+
private retries;
|
|
30
|
+
private refreshEufySecurityCloudTimeout?;
|
|
31
|
+
private refreshEufySecurityP2PTimeout;
|
|
32
|
+
private deviceSnoozeTimeout;
|
|
33
|
+
private stationsLoaded;
|
|
34
|
+
private devicesLoaded;
|
|
35
|
+
private loadingEmitter;
|
|
36
|
+
private constructor();
|
|
37
|
+
static initialize(config: EufySecurityConfig, log?: Logger): Promise<EufySecurity>;
|
|
38
|
+
protected _initializeInternals(): Promise<void>;
|
|
39
|
+
private initMQTT;
|
|
40
|
+
getPushService(): PushNotificationService;
|
|
41
|
+
private addStation;
|
|
42
|
+
private removeStation;
|
|
43
|
+
private updateStation;
|
|
44
|
+
private getStorageInfo;
|
|
45
|
+
private addDevice;
|
|
46
|
+
private removeDevice;
|
|
47
|
+
private updateDevice;
|
|
48
|
+
getDevices(): Promise<Array<Device>>;
|
|
49
|
+
getDevice(deviceSN: string): Promise<Device>;
|
|
50
|
+
getStationDevice(stationSN: string, channel: number): Promise<Device>;
|
|
51
|
+
getStations(): Promise<Array<Station>>;
|
|
52
|
+
getStation(stationSN: string): Promise<Station>;
|
|
53
|
+
getApi(): HTTPApi;
|
|
54
|
+
connectToStation(stationSN: string, p2pConnectionType?: P2PConnectionType): Promise<void>;
|
|
55
|
+
isStationConnected(stationSN: string): Promise<boolean>;
|
|
56
|
+
isStationEnergySavingDevice(stationSN: string): Promise<boolean>;
|
|
57
|
+
private handleHouses;
|
|
58
|
+
private handleHubs;
|
|
59
|
+
private onStationConnect;
|
|
60
|
+
private onStationConnectionError;
|
|
61
|
+
private onStationClose;
|
|
62
|
+
private handleDevices;
|
|
63
|
+
refreshCloudData(): Promise<void>;
|
|
64
|
+
close(): void;
|
|
65
|
+
setCameraMaxLivestreamDuration(seconds: number): void;
|
|
66
|
+
getCameraMaxLivestreamDuration(): number;
|
|
67
|
+
registerPushNotifications(credentials?: Credentials, persistentIds?: string[]): Promise<void>;
|
|
68
|
+
connect(options?: LoginOptions): Promise<void>;
|
|
69
|
+
getPushPersistentIds(): string[];
|
|
70
|
+
private updateDeviceProperties;
|
|
71
|
+
private onAPIClose;
|
|
72
|
+
private onAPIConnect;
|
|
73
|
+
private onAPIConnectionError;
|
|
74
|
+
startStationLivestream(deviceSN: string): Promise<void>;
|
|
75
|
+
startCloudLivestream(deviceSN: string): Promise<void>;
|
|
76
|
+
stopStationLivestream(deviceSN: string): Promise<void>;
|
|
77
|
+
stopCloudLivestream(deviceSN: string): Promise<void>;
|
|
78
|
+
private writePersistentData;
|
|
79
|
+
private saveCloudToken;
|
|
80
|
+
private savePushCredentials;
|
|
81
|
+
private savePushPersistentIds;
|
|
82
|
+
getVersion(): string;
|
|
83
|
+
isPushConnected(): boolean;
|
|
84
|
+
isMQTTConnected(): boolean;
|
|
85
|
+
isConnected(): boolean;
|
|
86
|
+
private processInvitations;
|
|
87
|
+
private onPushMessage;
|
|
88
|
+
startStationDownload(deviceSN: string, path: string, cipherID: number): Promise<void>;
|
|
89
|
+
cancelStationDownload(deviceSN: string): Promise<void>;
|
|
90
|
+
getConfig(): EufySecurityConfig;
|
|
91
|
+
setDeviceProperty(deviceSN: string, name: string, value: unknown): Promise<void>;
|
|
92
|
+
setStationProperty(stationSN: string, name: string, value: unknown): Promise<void>;
|
|
93
|
+
private onStartStationLivestream;
|
|
94
|
+
private onStopStationLivestream;
|
|
95
|
+
private onErrorStationLivestream;
|
|
96
|
+
private onStartStationRTSPLivestream;
|
|
97
|
+
private onStopStationRTSPLivestream;
|
|
98
|
+
private onStationStartDownload;
|
|
99
|
+
private onStationFinishDownload;
|
|
100
|
+
private onStationCommandResult;
|
|
101
|
+
private onStationSecondaryCommandResult;
|
|
102
|
+
private onStationRtspUrl;
|
|
103
|
+
private onStationGuardMode;
|
|
104
|
+
private onStationCurrentMode;
|
|
105
|
+
private onStationPropertyChanged;
|
|
106
|
+
private onStationRawPropertyChanged;
|
|
107
|
+
private onStationAlarmEvent;
|
|
108
|
+
private onStationAlarmDelayEvent;
|
|
109
|
+
private onStationArmDelayEvent;
|
|
110
|
+
private onStationAlarmArmedEvent;
|
|
111
|
+
private onDevicePropertyChanged;
|
|
112
|
+
private onDeviceRawPropertyChanged;
|
|
113
|
+
private onDeviceCryingDetected;
|
|
114
|
+
private onDeviceSoundDetected;
|
|
115
|
+
private onDevicePetDetected;
|
|
116
|
+
private onDeviceVehicleDetected;
|
|
117
|
+
private onDeviceMotionDetected;
|
|
118
|
+
private onDevicePersonDetected;
|
|
119
|
+
private onDeviceRings;
|
|
120
|
+
private onDeviceLocked;
|
|
121
|
+
private onDeviceOpen;
|
|
122
|
+
private onDevicePackageDelivered;
|
|
123
|
+
private onDevicePackageStranded;
|
|
124
|
+
private onDevicePackageTaken;
|
|
125
|
+
private onDeviceSomeoneLoitering;
|
|
126
|
+
private onDeviceRadarMotionDetected;
|
|
127
|
+
private onDevice911Alarm;
|
|
128
|
+
private onDeviceShakeAlarm;
|
|
129
|
+
private onDeviceWrongTryProtectAlarm;
|
|
130
|
+
private onDeviceLongTimeNotClose;
|
|
131
|
+
private onDeviceLowBattery;
|
|
132
|
+
private onDeviceJammed;
|
|
133
|
+
private onDeviceStrangerPersonDetected;
|
|
134
|
+
private onDeviceDogDetected;
|
|
135
|
+
private onDeviceDogLickDetected;
|
|
136
|
+
private onDeviceDogPoopDetected;
|
|
137
|
+
private onDeviceReady;
|
|
138
|
+
private onStationRuntimeState;
|
|
139
|
+
private onStationChargingState;
|
|
140
|
+
private onStationWifiRssi;
|
|
141
|
+
private onCaptchaRequest;
|
|
142
|
+
private onFloodlightManualSwitch;
|
|
143
|
+
private onAuthTokenInvalidated;
|
|
144
|
+
private onTfaRequest;
|
|
145
|
+
private onStationTalkbackStart;
|
|
146
|
+
private onStationTalkbackStop;
|
|
147
|
+
private onStationTalkbackError;
|
|
148
|
+
startStationTalkback(deviceSN: string): Promise<void>;
|
|
149
|
+
stopStationTalkback(deviceSN: string): Promise<void>;
|
|
150
|
+
private onStationDeviceShakeAlarm;
|
|
151
|
+
private onStationDevice911Alarm;
|
|
152
|
+
private onStationDeviceJammed;
|
|
153
|
+
private onStationDeviceLowBattery;
|
|
154
|
+
private onStationDeviceWrongTryProtectAlarm;
|
|
155
|
+
addUser(deviceSN: string, username: string, passcode: string, schedule?: Schedule): Promise<void>;
|
|
156
|
+
deleteUser(deviceSN: string, username: string): Promise<void>;
|
|
157
|
+
updateUser(deviceSN: string, username: string, newUsername: string): Promise<void>;
|
|
158
|
+
updateUserPasscode(deviceSN: string, username: string, passcode: string): Promise<void>;
|
|
159
|
+
updateUserSchedule(deviceSN: string, username: string, schedule: Schedule): Promise<void>;
|
|
160
|
+
private onStationDevicePinVerified;
|
|
161
|
+
private onStationSdInfoEx;
|
|
162
|
+
}
|