@mega-yfue/eufy-sdk 0.4.0-beta.10 → 0.4.0-beta.11
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/index.js +415 -416
- package/dist/index.js.map +4 -4
- package/dist/transport/http/passport.d.ts +21 -0
- package/dist/transport/http/solix-client.d.ts +5 -6
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `algo_ecdh` passport steps the eufy and Solix clients share byte for byte. Hosts, header sets, key
|
|
3
|
+
* caching, 2FA delivery and the `gtoken` id differ per app line and stay in each client.
|
|
4
|
+
*/
|
|
5
|
+
import { type SessionEntry } from "../../core/index.js";
|
|
6
|
+
/** The credential fields every `/passport/login` body starts with; each client adds its own challenge fields. */
|
|
7
|
+
export declare function loginCredentials(email: string, password: string, country: string): Record<string, unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* Read a decrypted `/passport/login` reply; `undefined` when it carries no id or no token. `twoFactorPending`
|
|
10
|
+
* is true while `fa_info.info` is non-empty and false once 2FA is satisfied.
|
|
11
|
+
*/
|
|
12
|
+
export declare function readLoginReply(data: Record<string, unknown>): {
|
|
13
|
+
userId: string;
|
|
14
|
+
accountUserId: string | undefined;
|
|
15
|
+
authToken: string;
|
|
16
|
+
geoKey: string | undefined;
|
|
17
|
+
tokenExpiresAt: number;
|
|
18
|
+
twoFactorPending: boolean;
|
|
19
|
+
} | undefined;
|
|
20
|
+
/** The headers that mark `encBody` as `algo_ecdh`-encrypted under `entry` and sign it. */
|
|
21
|
+
export declare function signedHeaders(entry: SessionEntry, encBody: string): Record<string, string>;
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
* eufy client uses.
|
|
4
4
|
*
|
|
5
5
|
* Why this is separate from the eufy device client: Solix shares Anker's `algo_ecdh` passport (so
|
|
6
|
-
* {@link prepareKeyExchange}
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* and
|
|
10
|
-
*
|
|
11
|
-
* the encrypted passport handshake to obtain a token, then makes plain authenticated reads.
|
|
6
|
+
* {@link prepareKeyExchange} and the steps in `./passport.ts` are shared with it) but exposes a different device
|
|
7
|
+
* backend — its own `app-name`, host, and bootstrap key (`SOLIX_APP_NAME`, `SOLIX_DEFAULT_API_HOST`,
|
|
8
|
+
* {@link SOLIX_LOCAL_KEY_HEX}) — and its authenticated resource reads are PLAIN JSON, carrying only the auth token
|
|
9
|
+
* and a `gtoken = md5(user_id)`, with no per-request encryption or signature. This client therefore does the
|
|
10
|
+
* encrypted passport handshake to obtain a token, then makes plain authenticated reads.
|
|
12
11
|
*
|
|
13
12
|
* This is the wire client (transport layer): it returns the vendor's typed JSON as received. Building
|
|
14
13
|
* those records into capability-driven `SolixDevice` models is the model layer's job — see
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mega-yfue/eufy-sdk",
|
|
3
|
-
"version": "0.4.0-beta.
|
|
3
|
+
"version": "0.4.0-beta.11",
|
|
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",
|