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

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.
@@ -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.85",
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",