@mega-yfue/eufy-sdk 0.2.0-beta.14 → 0.2.0-beta.16
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.
- package/dist/core/store.d.ts +18 -1
- package/dist/index.js +449 -193
- package/dist/index.js.map +4 -4
- package/dist/transport/http/decodeImageV2.d.ts +8 -14
- package/dist/transport/http/jpeg-scan.d.ts +59 -0
- package/dist/transport/http/media-download.d.ts +3 -0
- package/dist/transport/http/mega-client.d.ts +22 -2
- package/dist/transport/http/solix-client.d.ts +5 -0
- package/dist/transport/media-failure.d.ts +48 -0
- package/dist/transport/stored-image-cache.d.ts +7 -1
- package/package.json +1 -1
package/dist/core/store.d.ts
CHANGED
|
@@ -5,6 +5,14 @@ import type { RegionShard } from "../transport/http/mega-client.js";
|
|
|
5
5
|
*/
|
|
6
6
|
export interface PersistedSession {
|
|
7
7
|
userId: string;
|
|
8
|
+
/**
|
|
9
|
+
* The eufy account's own `user_id` — the id the `gtoken` header is hashed from, which is not always the
|
|
10
|
+
* `ap_cloud_user_id` that `userId` prefers.
|
|
11
|
+
*
|
|
12
|
+
* Always written, equal to `userId` when the login reply carried only the one id. Absent therefore means a
|
|
13
|
+
* record from before this was tracked, which {@link isSessionValid} refuses rather than restore.
|
|
14
|
+
*/
|
|
15
|
+
accountUserId?: string;
|
|
8
16
|
authToken: string;
|
|
9
17
|
geoKey?: string;
|
|
10
18
|
region: RegionShard;
|
|
@@ -50,5 +58,14 @@ export declare class FileSessionStore<T = PersistedSession> implements SessionSt
|
|
|
50
58
|
* (e.g. Solix) whose session shape differs but whose freshness rule is identical.
|
|
51
59
|
*/
|
|
52
60
|
export declare function tokenNotExpired(tokenExpiresAt: number | undefined, skewSec?: number): boolean;
|
|
53
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* A persisted session is usable if it carries a complete credential — token, bound ECDH key, and the account
|
|
63
|
+
* id the `gtoken` header is hashed from — whose token isn't (near-)expired.
|
|
64
|
+
*
|
|
65
|
+
* `accountUserId` is part of the credential, not an optional extra: a record without it was written before
|
|
66
|
+
* that id was tracked, so it can only be restored as the other id, which is what the gateway rejects the
|
|
67
|
+
* header on. Nothing in a restored session can recover it either — the id arrives with a login reply. So such
|
|
68
|
+
* a record is refused and one login re-establishes it, rather than reinstating a session whose every
|
|
69
|
+
* authenticated call fails identically.
|
|
70
|
+
*/
|
|
54
71
|
export declare function isSessionValid(s: PersistedSession | null, skewSec?: number): boolean;
|