eufy-security-client 4.0.0-dev.32 → 4.0.0-dev.34
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/build/eufysecurity.d.ts +15 -0
- package/build/eufysecurity.js +58 -6
- package/build/eufysecurity.js.map +1 -1
- package/build/http/index.d.ts +2 -0
- package/build/http/index.js +2 -0
- package/build/http/index.js.map +1 -1
- package/build/http/interfaces.d.ts +2 -0
- package/build/http/megaApi.d.ts +186 -0
- package/build/http/megaApi.js +513 -0
- package/build/http/megaApi.js.map +1 -0
- package/build/http/megaCrypto.d.ts +84 -0
- package/build/http/megaCrypto.js +129 -0
- package/build/http/megaCrypto.js.map +1 -0
- package/build/http/megaInterfaces.d.ts +83 -0
- package/build/http/megaInterfaces.js +3 -0
- package/build/http/megaInterfaces.js.map +1 -0
- package/build/http/megaTransition.d.ts +103 -0
- package/build/http/megaTransition.js +203 -0
- package/build/http/megaTransition.js.map +1 -0
- package/build/http/station.d.ts +1 -0
- package/build/http/station.js +4 -0
- package/build/http/station.js.map +1 -1
- package/build/http/types.d.ts +7 -1
- package/build/http/types.js +6 -0
- package/build/http/types.js.map +1 -1
- package/build/interfaces.d.ts +2 -0
- package/build/p2p/interfaces.d.ts +2 -0
- package/build/p2p/session.js +17 -0
- package/build/p2p/session.js.map +1 -1
- package/build/p2p/types.d.ts +1 -0
- package/build/p2p/types.js +1 -0
- package/build/p2p/types.js.map +1 -1
- package/coverage/clover.xml +7703 -7366
- package/coverage/coverage-final.json +26 -23
- package/coverage/lcov-report/index.html +35 -35
- package/coverage/lcov.info +12683 -12033
- package/package.json +1 -1
package/build/interfaces.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { Readable } from "stream";
|
|
6
6
|
import { Device } from "./http/device";
|
|
7
7
|
import { HTTPApiPersistentData, Picture, PropertyValue, Schedule } from "./http/interfaces";
|
|
8
|
+
import { MegaSession } from "./http/megaApi";
|
|
8
9
|
import { Station } from "./http/station";
|
|
9
10
|
import { DeviceSmartLockMessage } from "./mqtt/model";
|
|
10
11
|
import { DatabaseCountByDate, DatabaseQueryByDate, DatabaseQueryLatestInfo, DatabaseQueryLocal, StreamMetadata } from "./p2p/interfaces";
|
|
@@ -54,6 +55,7 @@ export interface EufySecurityPersistentData {
|
|
|
54
55
|
version: string;
|
|
55
56
|
httpApi?: HTTPApiPersistentData;
|
|
56
57
|
fallbackTrustedDeviceName?: string;
|
|
58
|
+
megaApi?: MegaSession;
|
|
57
59
|
}
|
|
58
60
|
export interface EufySecurityEvents {
|
|
59
61
|
"device added": (device: Device) => void;
|
|
@@ -3,6 +3,7 @@ import { Readable } from "stream";
|
|
|
3
3
|
import { SortedMap } from "sweet-collections";
|
|
4
4
|
import { AlarmMode, DeviceType, MicStatus, ParamType, TriggerType, VideoType } from "../http/types";
|
|
5
5
|
import { Address, CmdCameraInfoResponse, CommandResult, CustomData, StorageInfoBodyHB3 } from "./models";
|
|
6
|
+
import { PushMessage } from "../push/models";
|
|
6
7
|
import { TalkbackStream } from "./talkback";
|
|
7
8
|
import { AlarmEvent, AudioCodec, CommandType, DatabaseReturnCode, IndoorSoloSmartdropCommandType, P2PDataType, SmartSafeAlarm911Event, SmartSafeShakeAlarmEvent, P2PStorageType, TFCardStatus, VideoCodec, InternalP2PCommandType } from "./types";
|
|
8
9
|
export interface P2PClientProtocolEvents {
|
|
@@ -48,6 +49,7 @@ export interface P2PClientProtocolEvents {
|
|
|
48
49
|
"sensor status": (channel: number, status: number) => void;
|
|
49
50
|
"garage door status": (channel: number, doorId: number, status: number) => void;
|
|
50
51
|
"storage info hb3": (channel: number, storageInfo: StorageInfoBodyHB3) => void;
|
|
52
|
+
"push notification": (message: PushMessage) => void;
|
|
51
53
|
"sequence error": (channel: number, command: number, sequence: number, serialnumber: string) => void;
|
|
52
54
|
"hub notify update": () => void;
|
|
53
55
|
}
|
package/build/p2p/session.js
CHANGED
|
@@ -2904,6 +2904,23 @@ class P2PClientProtocol extends tiny_typed_emitter_1.TypedEmitter {
|
|
|
2904
2904
|
});
|
|
2905
2905
|
this.emit("hub notify update");
|
|
2906
2906
|
}
|
|
2907
|
+
else if (json.cmd === types_1.CommandType.CMD_CAMERA_PUSH_NOTIFY) {
|
|
2908
|
+
// P2P camera push notification from HB3 station (motion, person detection, etc.)
|
|
2909
|
+
// The outer payload is a JSON string that must be parsed separately.
|
|
2910
|
+
const innerPayload = (0, utils_3.parseJSON)(typeof json.payload === "string" ? json.payload : JSON.stringify(json.payload), logging_1.rootP2PLogger);
|
|
2911
|
+
if (innerPayload !== undefined) {
|
|
2912
|
+
logging_1.rootP2PLogger.debug(`Handle DATA ${types_1.P2PDataType[message.dataType]} - CMD_NOTIFY_PAYLOAD - Camera push notification`, {
|
|
2913
|
+
stationSN: this.rawStation.station_sn,
|
|
2914
|
+
event_type: innerPayload.event_type,
|
|
2915
|
+
device_sn: innerPayload.device_sn,
|
|
2916
|
+
});
|
|
2917
|
+
this.emit("push notification", {
|
|
2918
|
+
...innerPayload,
|
|
2919
|
+
type: innerPayload.msg_type,
|
|
2920
|
+
station_sn: this.rawStation.station_sn,
|
|
2921
|
+
});
|
|
2922
|
+
}
|
|
2923
|
+
}
|
|
2907
2924
|
else {
|
|
2908
2925
|
logging_1.rootP2PLogger.debug(`Handle DATA ${types_1.P2PDataType[message.dataType]} - CMD_NOTIFY_PAYLOAD - Not implemented 2`, {
|
|
2909
2926
|
stationSN: this.rawStation.station_sn,
|