eufy-security-client 2.4.2 → 2.4.3
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 +6 -0
- package/build/error.d.ts +57 -57
- package/build/error.js +155 -155
- package/build/eufysecurity.d.ts +161 -161
- package/build/eufysecurity.js +2091 -2091
- 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 +13 -13
- package/build/utils.js +191 -191
- package/package.json +9 -9
package/build/http/api.d.ts
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
import { TypedEmitter } from "tiny-typed-emitter";
|
|
2
|
-
import { Logger } from "ts-log";
|
|
3
|
-
import { TrustDevice, Cipher, EventRecordResponse, ConfirmInvite, SensorHistoryEntry, ApiResponse, HouseDetail, DeviceListResponse, StationListResponse, HouseInviteListResponse, HouseListResponse, PassportProfileResponse, User, AddUserResponse } from "./models";
|
|
4
|
-
import { HTTPApiEvents, Ciphers, FullDevices, Hubs, Voices, Invites, HTTPApiRequest, HTTPApiPersistentData, LoginOptions } from "./interfaces";
|
|
5
|
-
import { EventFilterType, PublicKeyType, VerfyCodeTypes } from "./types";
|
|
6
|
-
export declare class HTTPApi extends TypedEmitter<HTTPApiEvents> {
|
|
7
|
-
private static apiDomainBase;
|
|
8
|
-
private readonly SERVER_PUBLIC_KEY;
|
|
9
|
-
private apiBase;
|
|
10
|
-
private username;
|
|
11
|
-
private password;
|
|
12
|
-
private ecdh;
|
|
13
|
-
private token;
|
|
14
|
-
private tokenExpiration;
|
|
15
|
-
private renewAuthTokenJob?;
|
|
16
|
-
private log;
|
|
17
|
-
private connected;
|
|
18
|
-
private requestEufyCloud;
|
|
19
|
-
private throttle;
|
|
20
|
-
private devices;
|
|
21
|
-
private hubs;
|
|
22
|
-
private houses;
|
|
23
|
-
private persistentData;
|
|
24
|
-
private headers;
|
|
25
|
-
private constructor();
|
|
26
|
-
static getApiBaseFromCloud(country: string): Promise<string>;
|
|
27
|
-
static initialize(country: string, username: string, password: string, log?: Logger, persistentData?: HTTPApiPersistentData): Promise<HTTPApi>;
|
|
28
|
-
private clearScheduleRenewAuthToken;
|
|
29
|
-
private scheduleRenewAuthToken;
|
|
30
|
-
private invalidateToken;
|
|
31
|
-
setPhoneModel(model: string): void;
|
|
32
|
-
getPhoneModel(): string;
|
|
33
|
-
getCountry(): string;
|
|
34
|
-
setLanguage(language: string): void;
|
|
35
|
-
getLanguage(): string;
|
|
36
|
-
login(options?: LoginOptions): Promise<void>;
|
|
37
|
-
sendVerifyCode(type?: VerfyCodeTypes): Promise<boolean>;
|
|
38
|
-
listTrustDevice(): Promise<Array<TrustDevice>>;
|
|
39
|
-
addTrustDevice(verifyCode: string): Promise<boolean>;
|
|
40
|
-
getStationList(): Promise<Array<StationListResponse>>;
|
|
41
|
-
getDeviceList(): Promise<Array<DeviceListResponse>>;
|
|
42
|
-
refreshHouseData(): Promise<void>;
|
|
43
|
-
refreshStationData(): Promise<void>;
|
|
44
|
-
refreshDeviceData(): Promise<void>;
|
|
45
|
-
refreshAllData(): Promise<void>;
|
|
46
|
-
request(request: HTTPApiRequest): Promise<ApiResponse>;
|
|
47
|
-
checkPushToken(): Promise<boolean>;
|
|
48
|
-
registerPushToken(token: string): Promise<boolean>;
|
|
49
|
-
setParameters(stationSN: string, deviceSN: string, params: {
|
|
50
|
-
paramType: number;
|
|
51
|
-
paramValue: any;
|
|
52
|
-
}[]): Promise<boolean>;
|
|
53
|
-
getCiphers(cipherIDs: Array<number>, userID: string): Promise<Ciphers>;
|
|
54
|
-
getVoices(deviceSN: string): Promise<Voices>;
|
|
55
|
-
getCipher(cipherID: number, userID: string): Promise<Cipher>;
|
|
56
|
-
getLog(): Logger;
|
|
57
|
-
getDevices(): FullDevices;
|
|
58
|
-
getHubs(): Hubs;
|
|
59
|
-
getToken(): string | null;
|
|
60
|
-
getTokenExpiration(): Date | null;
|
|
61
|
-
setToken(token: string): void;
|
|
62
|
-
setTokenExpiration(tokenExpiration: Date): void;
|
|
63
|
-
getAPIBase(): string;
|
|
64
|
-
setOpenUDID(openudid: string): void;
|
|
65
|
-
setSerialNumber(serialnumber: string): void;
|
|
66
|
-
private _getEvents;
|
|
67
|
-
getVideoEvents(startTime: Date, endTime: Date, filter?: EventFilterType, maxResults?: number): Promise<Array<EventRecordResponse>>;
|
|
68
|
-
getAlarmEvents(startTime: Date, endTime: Date, filter?: EventFilterType, maxResults?: number): Promise<Array<EventRecordResponse>>;
|
|
69
|
-
getHistoryEvents(startTime: Date, endTime: Date, filter?: EventFilterType, maxResults?: number): Promise<Array<EventRecordResponse>>;
|
|
70
|
-
getAllVideoEvents(filter?: EventFilterType, maxResults?: number): Promise<Array<EventRecordResponse>>;
|
|
71
|
-
getAllAlarmEvents(filter?: EventFilterType, maxResults?: number): Promise<Array<EventRecordResponse>>;
|
|
72
|
-
getAllHistoryEvents(filter?: EventFilterType, maxResults?: number): Promise<Array<EventRecordResponse>>;
|
|
73
|
-
isConnected(): boolean;
|
|
74
|
-
getInvites(): Promise<Invites>;
|
|
75
|
-
confirmInvites(confirmInvites: Array<ConfirmInvite>): Promise<boolean>;
|
|
76
|
-
getPublicKey(deviceSN: string, type: PublicKeyType): Promise<string>;
|
|
77
|
-
decryptAPIData(data?: string, json?: boolean): any;
|
|
78
|
-
getSensorHistory(stationSN: string, deviceSN: string): Promise<Array<SensorHistoryEntry>>;
|
|
79
|
-
getHouseDetail(houseID: string): Promise<HouseDetail | null>;
|
|
80
|
-
getHouseList(): Promise<Array<HouseListResponse>>;
|
|
81
|
-
getHouseInviteList(isInviter?: number): Promise<Array<HouseInviteListResponse>>;
|
|
82
|
-
confirmHouseInvite(houseID: string, inviteID: number): Promise<boolean>;
|
|
83
|
-
getPersistentData(): HTTPApiPersistentData | undefined;
|
|
84
|
-
getPassportProfile(): Promise<PassportProfileResponse | null>;
|
|
85
|
-
addUser(deviceSN: string, nickname: string, stationSN?: string): Promise<AddUserResponse | null>;
|
|
86
|
-
deleteUser(deviceSN: string, shortUserId: string, stationSN?: string): Promise<boolean>;
|
|
87
|
-
getUsers(deviceSN: string, stationSN: string): Promise<Array<User> | null>;
|
|
88
|
-
getUser(deviceSN: string, stationSN: string, shortUserId: string): Promise<User | null>;
|
|
89
|
-
updateUser(deviceSN: string, stationSN: string, shortUserId: string, nickname: string): Promise<boolean>;
|
|
90
|
-
}
|
|
1
|
+
import { TypedEmitter } from "tiny-typed-emitter";
|
|
2
|
+
import { Logger } from "ts-log";
|
|
3
|
+
import { TrustDevice, Cipher, EventRecordResponse, ConfirmInvite, SensorHistoryEntry, ApiResponse, HouseDetail, DeviceListResponse, StationListResponse, HouseInviteListResponse, HouseListResponse, PassportProfileResponse, User, AddUserResponse } from "./models";
|
|
4
|
+
import { HTTPApiEvents, Ciphers, FullDevices, Hubs, Voices, Invites, HTTPApiRequest, HTTPApiPersistentData, LoginOptions } from "./interfaces";
|
|
5
|
+
import { EventFilterType, PublicKeyType, VerfyCodeTypes } from "./types";
|
|
6
|
+
export declare class HTTPApi extends TypedEmitter<HTTPApiEvents> {
|
|
7
|
+
private static apiDomainBase;
|
|
8
|
+
private readonly SERVER_PUBLIC_KEY;
|
|
9
|
+
private apiBase;
|
|
10
|
+
private username;
|
|
11
|
+
private password;
|
|
12
|
+
private ecdh;
|
|
13
|
+
private token;
|
|
14
|
+
private tokenExpiration;
|
|
15
|
+
private renewAuthTokenJob?;
|
|
16
|
+
private log;
|
|
17
|
+
private connected;
|
|
18
|
+
private requestEufyCloud;
|
|
19
|
+
private throttle;
|
|
20
|
+
private devices;
|
|
21
|
+
private hubs;
|
|
22
|
+
private houses;
|
|
23
|
+
private persistentData;
|
|
24
|
+
private headers;
|
|
25
|
+
private constructor();
|
|
26
|
+
static getApiBaseFromCloud(country: string): Promise<string>;
|
|
27
|
+
static initialize(country: string, username: string, password: string, log?: Logger, persistentData?: HTTPApiPersistentData): Promise<HTTPApi>;
|
|
28
|
+
private clearScheduleRenewAuthToken;
|
|
29
|
+
private scheduleRenewAuthToken;
|
|
30
|
+
private invalidateToken;
|
|
31
|
+
setPhoneModel(model: string): void;
|
|
32
|
+
getPhoneModel(): string;
|
|
33
|
+
getCountry(): string;
|
|
34
|
+
setLanguage(language: string): void;
|
|
35
|
+
getLanguage(): string;
|
|
36
|
+
login(options?: LoginOptions): Promise<void>;
|
|
37
|
+
sendVerifyCode(type?: VerfyCodeTypes): Promise<boolean>;
|
|
38
|
+
listTrustDevice(): Promise<Array<TrustDevice>>;
|
|
39
|
+
addTrustDevice(verifyCode: string): Promise<boolean>;
|
|
40
|
+
getStationList(): Promise<Array<StationListResponse>>;
|
|
41
|
+
getDeviceList(): Promise<Array<DeviceListResponse>>;
|
|
42
|
+
refreshHouseData(): Promise<void>;
|
|
43
|
+
refreshStationData(): Promise<void>;
|
|
44
|
+
refreshDeviceData(): Promise<void>;
|
|
45
|
+
refreshAllData(): Promise<void>;
|
|
46
|
+
request(request: HTTPApiRequest): Promise<ApiResponse>;
|
|
47
|
+
checkPushToken(): Promise<boolean>;
|
|
48
|
+
registerPushToken(token: string): Promise<boolean>;
|
|
49
|
+
setParameters(stationSN: string, deviceSN: string, params: {
|
|
50
|
+
paramType: number;
|
|
51
|
+
paramValue: any;
|
|
52
|
+
}[]): Promise<boolean>;
|
|
53
|
+
getCiphers(cipherIDs: Array<number>, userID: string): Promise<Ciphers>;
|
|
54
|
+
getVoices(deviceSN: string): Promise<Voices>;
|
|
55
|
+
getCipher(cipherID: number, userID: string): Promise<Cipher>;
|
|
56
|
+
getLog(): Logger;
|
|
57
|
+
getDevices(): FullDevices;
|
|
58
|
+
getHubs(): Hubs;
|
|
59
|
+
getToken(): string | null;
|
|
60
|
+
getTokenExpiration(): Date | null;
|
|
61
|
+
setToken(token: string): void;
|
|
62
|
+
setTokenExpiration(tokenExpiration: Date): void;
|
|
63
|
+
getAPIBase(): string;
|
|
64
|
+
setOpenUDID(openudid: string): void;
|
|
65
|
+
setSerialNumber(serialnumber: string): void;
|
|
66
|
+
private _getEvents;
|
|
67
|
+
getVideoEvents(startTime: Date, endTime: Date, filter?: EventFilterType, maxResults?: number): Promise<Array<EventRecordResponse>>;
|
|
68
|
+
getAlarmEvents(startTime: Date, endTime: Date, filter?: EventFilterType, maxResults?: number): Promise<Array<EventRecordResponse>>;
|
|
69
|
+
getHistoryEvents(startTime: Date, endTime: Date, filter?: EventFilterType, maxResults?: number): Promise<Array<EventRecordResponse>>;
|
|
70
|
+
getAllVideoEvents(filter?: EventFilterType, maxResults?: number): Promise<Array<EventRecordResponse>>;
|
|
71
|
+
getAllAlarmEvents(filter?: EventFilterType, maxResults?: number): Promise<Array<EventRecordResponse>>;
|
|
72
|
+
getAllHistoryEvents(filter?: EventFilterType, maxResults?: number): Promise<Array<EventRecordResponse>>;
|
|
73
|
+
isConnected(): boolean;
|
|
74
|
+
getInvites(): Promise<Invites>;
|
|
75
|
+
confirmInvites(confirmInvites: Array<ConfirmInvite>): Promise<boolean>;
|
|
76
|
+
getPublicKey(deviceSN: string, type: PublicKeyType): Promise<string>;
|
|
77
|
+
decryptAPIData(data?: string, json?: boolean): any;
|
|
78
|
+
getSensorHistory(stationSN: string, deviceSN: string): Promise<Array<SensorHistoryEntry>>;
|
|
79
|
+
getHouseDetail(houseID: string): Promise<HouseDetail | null>;
|
|
80
|
+
getHouseList(): Promise<Array<HouseListResponse>>;
|
|
81
|
+
getHouseInviteList(isInviter?: number): Promise<Array<HouseInviteListResponse>>;
|
|
82
|
+
confirmHouseInvite(houseID: string, inviteID: number): Promise<boolean>;
|
|
83
|
+
getPersistentData(): HTTPApiPersistentData | undefined;
|
|
84
|
+
getPassportProfile(): Promise<PassportProfileResponse | null>;
|
|
85
|
+
addUser(deviceSN: string, nickname: string, stationSN?: string): Promise<AddUserResponse | null>;
|
|
86
|
+
deleteUser(deviceSN: string, shortUserId: string, stationSN?: string): Promise<boolean>;
|
|
87
|
+
getUsers(deviceSN: string, stationSN: string): Promise<Array<User> | null>;
|
|
88
|
+
getUser(deviceSN: string, stationSN: string, shortUserId: string): Promise<User | null>;
|
|
89
|
+
updateUser(deviceSN: string, stationSN: string, shortUserId: string, nickname: string): Promise<boolean>;
|
|
90
|
+
}
|