@mega-yfue/eufy-sdk 0.6.0-beta.35 → 0.6.0-beta.36

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.
@@ -194,7 +194,8 @@ export declare class RtcCommandRouter {
194
194
  /**
195
195
  * One bounded bring-up: the session is up when its command channel opens, and it fails, with the
196
196
  * session closed and every listener gone, when `connect()` throws, the session closes first (rejecting
197
- * with the failure that closed it, when it carries one), or {@link CONNECT_TIMEOUT_MS} passes. A single
197
+ * with the failure that closed it, when it carries one), or {@link CONNECT_TIMEOUT_MS} passes, naming the
198
+ * stage the session reached and its peer's last state. A single
198
199
  * promise, so an early failure cannot leave a second one rejecting unheard.
199
200
  */
200
201
  private bringUp;
@@ -18,7 +18,9 @@
18
18
  * nominally up. A dropped signalling socket closes the peer with it: a hub that still sees the peer
19
19
  * answers every later `scall` with 486 until that peer's ICE gives up. A peer that cannot be built when
20
20
  * the hub grants the relay ends the session there: the failure is emitted as `error` and `close` fires
21
- * carrying it.
21
+ * carrying it. Before the command channel opens, a peer that fails or closes also ends the session, and so
22
+ * does a hub `hangup` on a `scall` session, the exchange above; {@link RtcSession.stage} names how far
23
+ * the bring-up got. A `call` session's pre-open hangup is not evidenced as terminal and stays logged only.
22
24
  *
23
25
  * A session whose peer is a {@link RtcPeerOptions.mediaTrack} peer has no command channel: `close` fires
24
26
  * when the peer fails or closes, and the video track's packets are emitted as `rtp`.
@@ -47,6 +49,11 @@ export interface RtcSessionEvents {
47
49
  /** One packet of the video track, in a {@link RtcPeerOptions.mediaTrack} session. */
48
50
  rtp: [packet: Buffer];
49
51
  }
52
+ /**
53
+ * How far a session's bring-up got, in order: the sign fetch, the signalling socket, its auth, the placed
54
+ * call, the hub's relay grant, our answer to its offer, and the open command channel.
55
+ */
56
+ type RtcBringUpStage = "signing" | "connecting" | "authenticating" | "calling" | "relay-granted" | "answered" | "connected";
50
57
  export declare class RtcSession extends EventEmitter<RtcSessionEvents> {
51
58
  private readonly opts;
52
59
  private readonly signaling;
@@ -60,8 +67,15 @@ export declare class RtcSession extends EventEmitter<RtcSessionEvents> {
60
67
  private closeAnnounced;
61
68
  private sdpHandled;
62
69
  private chain;
70
+ private stageReached;
71
+ private lastPeerState?;
63
72
  constructor(opts: RtcSessionOptions);
73
+ private get mediaTrack();
64
74
  get isConnected(): boolean;
75
+ /** The last bring-up stage this session reached. */
76
+ get stage(): RtcBringUpStage;
77
+ /** The peer connection's last reported state; `undefined` before it reports one. */
78
+ get peerState(): string | undefined;
65
79
  /**
66
80
  * Start the sequence; resolves once the call is sent. `connected` fires when the channel opens. A session
67
81
  * closed by the time the sign fetch or the auth completes rejects instead of opening the socket or
@@ -99,3 +113,4 @@ export declare class RtcSession extends EventEmitter<RtcSessionEvents> {
99
113
  */
100
114
  private onInfo;
101
115
  }
116
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mega-yfue/eufy-sdk",
3
- "version": "0.6.0-beta.35",
3
+ "version": "0.6.0-beta.36",
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",