@mega-yfue/eufy-sdk 0.5.0-beta.84 → 0.5.0-beta.86

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.
@@ -49,6 +49,8 @@ export declare const CAMERA_CMD: {
49
49
  * (1013). (Some models omit full colour; enum in {@link NightVision}.)
50
50
  */
51
51
  readonly NIGHT_VISION_TYPE: 1277;
52
+ /** T8442 infrared night vision on/off: direct L1 int-string, hardware verified (0/1). */
53
+ readonly IC_NIGHT_VISION_TYPE: 1013;
52
54
  /**
53
55
  * Push-notification STYLE — how much a detection push carries: text alone, a thumbnail, or text
54
56
  * followed by a thumbnail. App `CMD_INDOOR_PUSH_NOTIFY_TYPE`, and the "indoor" is a misnomer: the
@@ -259,6 +261,8 @@ export type CameraActions = Surface<typeof CAMERA_MEMBERS> & {
259
261
  /** Power the camera off. */
260
262
  off(): Promise<void>;
261
263
  };
264
+ /** T8442 has a binary night-vision wire, unlike cameras with the three-mode 1277 control. */
265
+ declare function isT8442(ctx: AvailabilityContext): boolean;
262
266
  /**
263
267
  * Every `camera` feature, declared once. The property schema, the typed getters, the derived setters,
264
268
  * the intent routes, the media methods and the descriptions all come out of this table.
@@ -445,8 +449,17 @@ export declare const CAMERA_MEMBERS: {
445
449
  readonly 1: "Infrared";
446
450
  readonly 2: "Full Color";
447
451
  };
452
+ readonly enumValuesFor: (ctx: AvailabilityContext) => {
453
+ 0: string;
454
+ 1: string;
455
+ } | undefined;
448
456
  readonly provenance: "verified";
449
457
  readonly available: typeof isCameraCodec;
458
+ readonly readAvailable: (ctx: AvailabilityContext) => boolean;
459
+ readonly readAliases: readonly [{
460
+ readonly paramType: 2002;
461
+ readonly available: typeof isT8442;
462
+ }];
450
463
  readonly description: string;
451
464
  readonly write: (v: string | number | boolean, ctx: CommandContext) => Command | undefined;
452
465
  };
@@ -596,3 +609,4 @@ export declare const CAMERA_MEMBERS: {
596
609
  readonly talkback: import("./members.js").ProvidedMember<"media", false | ((opts?: Parameters<NonNullable<MediaProvider["talkback"]>>[0]) => Promise<import("../../core/contracts.js").TalkbackHandle>) | undefined>;
597
610
  };
598
611
  export declare const CAMERA: CapabilityModule;
612
+ export {};
@@ -185,6 +185,10 @@ export declare class P2PSession extends EventEmitter {
185
185
  * change (the level-2 key arrived after an initial level-1 start), otherwise sends the 1139 nudge.
186
186
  */
187
187
  private readonly liveStartedChannels;
188
+ /** The `cipher_id` this connection's `CMD_GATEWAYINFO` reply named, once its negotiation has read it. */
189
+ private gatewayCipherId?;
190
+ /** The `n` of the last `[0x01, n]` header this connection sent in the clear — see {@link nextClearCommandBytes}. */
191
+ private clearCommandCount;
188
192
  private readonly unackedLiveStarts;
189
193
  private liveStartRetransmitTimer?;
190
194
  private readonly logger;
@@ -396,6 +400,9 @@ export declare class P2PSession extends EventEmitter {
396
400
  * `video_type` is 12, and `transaction` is the millisecond timestamp as a string. The device answers a
397
401
  * start carrying these values with a keyframe; `encryptkey` is the modulus it RSA-wraps each keyframe's
398
402
  * AES media key with (unwrapped by {@link decodeVideoFrame}).
403
+ *
404
+ * With `clearMsgId`, the body of a start sent in the clear: `{accountId, encryptkey, msg_id, streamtype: 1}`
405
+ * only, `msg_id` being `clearMsgId`, which changes from one start to the next.
399
406
  */
400
407
  private startLiveJson;
401
408
  /**
@@ -403,8 +410,20 @@ export declare class P2PSession extends EventEmitter {
403
410
  * (GCM, signCode 8, frame type 10) when the session has a negotiated key, else level-1 (AES-128-ECB,
404
411
  * signCode 1, frame type 11) — chosen by the session key, not the device family. The camera RSA-wraps
405
412
  * each keyframe's AES media key with the `encryptkey` modulus (unwrapped by {@link decodeVideoFrame}).
413
+ * A session that {@link sendsInTheClear} sends it unencrypted instead: signCode 0, frame type 0, header
414
+ * bytes `[0x01, n]` from {@link nextClearCommandBytes}, and `n` as the body's `msg_id`.
406
415
  */
407
416
  private sendStartLiveOwnSession;
417
+ /**
418
+ * Whether this session's own-session start and stop go in the clear: its `CMD_GATEWAYINFO` reply named
419
+ * `cipher_id` 0.
420
+ */
421
+ private sendsInTheClear;
422
+ /**
423
+ * Header bytes 10-11 of this connection's next command sent in the clear: `[0x01, n]`, with `n` counting
424
+ * those commands from 1 and never 0. A retransmit repeats its `n`, and the device's reply echoes it.
425
+ */
426
+ private nextClearCommandBytes;
408
427
  /**
409
428
  * Repeat unacknowledged own-session live starts until the device takes one. Runs only while a start is
410
429
  * outstanding.
@@ -475,6 +494,8 @@ export declare class P2PSession extends EventEmitter {
475
494
  * `uint32`, the same 4-byte body as the attached talkback frames. The app sends this frame on closing
476
495
  * an own-session camera's live view; the camera stops streaming on it within a second, and keeps
477
496
  * streaming through the 1350-wrapped form.
497
+ * - own-session on a session that {@link sendsInTheClear}: the same 4-byte body unencrypted, signCode 0,
498
+ * header bytes from {@link nextClearCommandBytes}.
478
499
  * - without a level-2 key: the bare 1004 command.
479
500
  */
480
501
  stopLiveMedia(channel?: number, accountId?: string, homeBaseAttached?: boolean): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mega-yfue/eufy-sdk",
3
- "version": "0.5.0-beta.84",
3
+ "version": "0.5.0-beta.86",
4
4
  "description": "One typed TypeScript client for the Anker eufy v6 cloud — capability-driven devices, realtime events over P2P/MQTT/push, and live media",
5
5
  "license": "Apache-2.0",
6
6
  "author": "mega-yfue",