@mega-yfue/eufy-sdk 0.3.0-beta.3 → 0.3.0-beta.4

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.
@@ -91,8 +91,9 @@ export declare class SessionExpiredError extends Error {
91
91
  /**
92
92
  * Whether this rejection landed inside that bar — a token replaced recently and rejected again since.
93
93
  *
94
- * It says the session is being DISPLACED rather than expiring: something else is signing in on this
95
- * account, and replacing the token again only trades one login for another.
94
+ * That is the shape displacement by another client signed in on this account has, where replacing the
95
+ * token again only trades one login for another. It is not proof of one, since a cloud refusing to
96
+ * re-issue the session looks the same.
96
97
  */
97
98
  readonly contended: boolean;
98
99
  constructor(message: string, opts?: {
@@ -212,6 +213,8 @@ export declare class MegaHttpClient {
212
213
  private sessionKey?;
213
214
  /** Per-host ECDH session keys for non-mega gateways (e.g. eufylife) keyed by host. */
214
215
  private readonly sessionKeys;
216
+ /** The in-flight key exchanges, by host and the token they carry — see {@link ensureSessionKey}. */
217
+ private readonly keyExchanges;
215
218
  /**
216
219
  * The held credential. `userId` is the login reply's `ap_cloud_user_id` where it has one — the Anker
217
220
  * Passport cloud's id — while `accountUserId` is the eufy account's own `user_id`.
@@ -318,6 +321,8 @@ export declare class MegaHttpClient {
318
321
  * so it MUST be reused (don't re-exchange after login).
319
322
  */
320
323
  ensureSessionKey(targetHost?: string): Promise<SessionEntry>;
324
+ /** One key exchange against `host`, installed as that host's key. */
325
+ private exchangeSessionKey;
321
326
  /**
322
327
  * Signed + encrypted POST. Content-type auto-falls-back (text/plain ↔ json).
323
328
  *
@@ -523,8 +528,8 @@ export declare class MegaHttpClient {
523
528
  * like the same device — and the cloud keeps one session per device. Each finds its token rejected, replaces
524
529
  * it, and evicts the other: an unbounded login war, silent, and repeated logins are exactly what makes an
525
530
  * account start demanding captchas. The first replacement is immediate, because a token displaced once is
526
- * the ordinary case; a second one soon after is evidence of contention rather than expiry, so the wait grows
527
- * and a caller is told the honest reason instead of being served a fight.
531
+ * the ordinary case; a second one soon after has the shape of contention rather than expiry, so the wait grows
532
+ * and a caller is told what was seen instead of being served a fight.
528
533
  */
529
534
  private recoveryDue;
530
535
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mega-yfue/eufy-sdk",
3
- "version": "0.3.0-beta.3",
3
+ "version": "0.3.0-beta.4",
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",