@mega-yfue/eufy-sdk 0.2.0-beta.12 → 0.2.0-beta.14

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.
@@ -28,10 +28,12 @@ import { FragmentRecording } from "./fragment-recording.js";
28
28
  * when these change.
29
29
  *
30
30
  * `connect` applies to every call on a station, because nothing can be addressed to one before its session is
31
- * up. `level2Grace` applies twice where the key is required: the negotiation is re-prompted once.
31
+ * up, and it is the session's own connect deadline: a session that reaches it closes itself, so waiting past it
32
+ * waits on a connection that can no longer answer. `level2Grace` applies twice where the key is required: the
33
+ * negotiation is re-prompted once.
32
34
  */
33
35
  export declare const P2P_STATION_WAITS: {
34
- readonly connect: 20000;
36
+ readonly connect: 15000;
35
37
  readonly level2Grace: 25000;
36
38
  readonly level2Settle: 8000;
37
39
  };
@@ -63,6 +63,20 @@ export type LiveTrace =
63
63
  phase: "sequence-restart";
64
64
  dataType: number;
65
65
  }
66
+ /**
67
+ * Which lookup channels a connection can ask for the station on, before it asks.
68
+ *
69
+ * A station is found by a local lookup, by a cloud lookup, or by both, and each needs something the other
70
+ * does not: the local one needs the station on this link, the cloud one needs both a key for the station and
71
+ * an address to ask. A connect that had one channel failed for that channel's reason alone, and a connect
72
+ * that had neither could not have succeeded — outcomes a station that is switched off is otherwise
73
+ * indistinguishable from, because nothing else in a failed connect states what was even attempted.
74
+ */
75
+ | {
76
+ phase: "lookup-channels";
77
+ local: boolean;
78
+ cloud: boolean;
79
+ }
66
80
  /**
67
81
  * Work on a station is holding for its session to connect, with the milliseconds it will wait.
68
82
  *
@@ -150,17 +164,21 @@ export type LiveTrace =
150
164
  /**
151
165
  * A station was resolved for a call, stating what the caller's device is on it and whose station it is.
152
166
  *
153
- * Emitted before anything is sent, so it is the only account of the intended topology on a call that fails
154
- * during resolution: an attached camera's media start has no unencrypted form, so whether a device was taken
155
- * as attached decides what its failure means. `stationAdmin` states whether the signed-in account is the
156
- * station's administrator, which is what a key the account cannot resolve turns on; `unstated` is a device
157
- * record that names no administrator, which is not the same as naming another.
167
+ * Emitted before the session is waited on, so a station that is never reached still has this record: an
168
+ * attached camera's media start has no unencrypted form, so whether a device was taken as attached decides
169
+ * what its failure means. `stationAdmin` states whether the signed-in account is the station's
170
+ * administrator, which is what a key the account cannot resolve turns on; `unstated` is a device record
171
+ * that names no administrator, which is not the same as naming another. `stationModel` is the model of the
172
+ * station the call resolved — the base's for an attached camera, the device's own where it is its own
173
+ * station — absent where that record states none; without it a base this SDK reaches differently is
174
+ * indistinguishable from one that is switched off.
158
175
  */
159
176
  | {
160
177
  phase: "station-resolved";
161
178
  topology: "attached" | "own";
162
179
  channel: number;
163
180
  stationAdmin: "self" | "other" | "unstated";
181
+ stationModel?: string;
164
182
  }
165
183
  /** A shared source began warming, with the interval it re-issues on and the deadline it fails at. */
166
184
  | {
@@ -16,6 +16,15 @@
16
16
  import { EventEmitter } from "node:events";
17
17
  import { type Address, type P2PDataFrameHeader } from "./codec.js";
18
18
  import { type Logger } from "../../core/logger.js";
19
+ /**
20
+ * How long a station is given to answer a lookup before the connection gives up on it and closes.
21
+ *
22
+ * The whole deadline for reaching a station: the lookups are re-sent every second until one is answered, and
23
+ * a connection that reaches this closes itself, so nothing addressed to that station can succeed afterwards.
24
+ * Published because it bounds every wait on a session connecting — a second number for the same deadline
25
+ * elsewhere would outlive the connection it waits on and charge the difference to every failure.
26
+ */
27
+ export declare const CONNECT_TIMEOUT_MS = 15000;
19
28
  /**
20
29
  * The channel a command addresses the station itself on, rather than one of its cameras, and the value a
21
30
  * session's channel-taking methods resolve an omitted channel to.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mega-yfue/eufy-sdk",
3
- "version": "0.2.0-beta.12",
3
+ "version": "0.2.0-beta.14",
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",