@mega-yfue/eufy-sdk 0.1.1-beta.0 → 0.1.1
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/README.md +11 -40
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,10 +23,6 @@
|
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
-
> [!NOTE]
|
|
27
|
-
> Pre-1.0, so a minor bump may break: old shapes are removed rather than kept beside their
|
|
28
|
-
> replacements. Each release's notes state what changed — see [Releases][releases].
|
|
29
|
-
|
|
30
26
|
## What it is
|
|
31
27
|
|
|
32
28
|
A TypeScript SDK for the Anker eufy cloud that the current eufy app speaks. It logs in (captcha and 2FA
|
|
@@ -44,9 +40,9 @@ await dev.light?.()?.setBrightness(60);
|
|
|
44
40
|
eufy.on("motion", (e) => console.log(e.deviceSn, "saw something"));
|
|
45
41
|
```
|
|
46
42
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
Accessors and methods are optional because both are **evidence-gated**: a device exposes exactly the
|
|
44
|
+
features it reported, so the optionality states that one may be absent. An **unverified write path
|
|
45
|
+
throws** rather than send a frame it cannot stand behind.
|
|
50
46
|
|
|
51
47
|
Realtime arrives over **P2P** (cameras and HomeBases), **secure MQTT** (appliances) and **push**
|
|
52
48
|
(events), all surfaced as typed semantic events. Live **video streaming** works, with one shared pull
|
|
@@ -59,12 +55,10 @@ code path and an unlisted or future device resolves the same way as a known one.
|
|
|
59
55
|
## Install
|
|
60
56
|
|
|
61
57
|
```bash
|
|
62
|
-
npm install @mega-yfue/eufy-sdk
|
|
58
|
+
npm install @mega-yfue/eufy-sdk # latest stable
|
|
59
|
+
npm install @mega-yfue/eufy-sdk@beta # the prerelease of the version in review
|
|
63
60
|
```
|
|
64
61
|
|
|
65
|
-
Releases go to **npmjs**, published from CI with provenance. Prereleases ship on the `beta` channel
|
|
66
|
-
(`npm install @mega-yfue/eufy-sdk@beta`) while a version is still under review.
|
|
67
|
-
|
|
68
62
|
**Node.js ≥ 24.5.0** is required, not just recommended (see [`.nvmrc`](./.nvmrc)). `ffmpeg` is
|
|
69
63
|
optional — only the live JPEG snapshot and one-shot mp4 record paths use it,
|
|
70
64
|
and a host that ships its own build names it with `new EufyMega({ ffmpegPath })` rather than needing
|
|
@@ -72,34 +66,13 @@ one on `PATH`.
|
|
|
72
66
|
|
|
73
67
|
## Documentation
|
|
74
68
|
|
|
75
|
-
The guides at **<https://mega-yfue.github.io/>**
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
in [`examples/`](./examples/).
|
|
79
|
-
|
|
80
|
-
## Design
|
|
81
|
-
|
|
82
|
-
Four layers, one dependency direction — `core` → `transport` → `model` → `client`:
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
src/
|
|
86
|
-
core/ shared floor: crypto, cross-layer contracts, value types, session store
|
|
87
|
-
transport/ every byte-on-a-wire module: http, mqtt, p2p, push, tuya
|
|
88
|
-
model/ Device + one self-contained module per capability
|
|
89
|
-
client/ the facade: login, device registry, event fan-out
|
|
90
|
-
index.ts public surface — one `export *` per layer barrel
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
**Capability ↔ transport decorrelation is a hard, CI-enforced rule:** `model/` never imports
|
|
94
|
-
`transport/` and vice versa. A capability describes what a value MEANS; a transport moves bytes and
|
|
95
|
-
never names a feature. Anything genuinely shared is a contract in `core/`. That rule and the rest of
|
|
96
|
-
the code practice are in [AGENTS.md](./AGENTS.md).
|
|
69
|
+
The guides at **<https://mega-yfue.github.io/>** cover installing and logging in, devices and
|
|
70
|
+
capabilities, events and realtime transports, consuming live media, and the generated API reference.
|
|
71
|
+
Runnable, typechecked samples live in [`examples/`](./examples/).
|
|
97
72
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
**Unverified write paths throw rather than guess.** Some writes are fire-and-forget, so a guessed
|
|
102
|
-
frame looks exactly like success; the SDK refuses instead of pretending.
|
|
73
|
+
The architecture — four layers with one dependency direction, and the CI-enforced rule that keeps
|
|
74
|
+
capabilities and transports from importing each other — is in [AGENTS.md](./AGENTS.md), with the rest of
|
|
75
|
+
the code practice.
|
|
103
76
|
|
|
104
77
|
## Develop
|
|
105
78
|
|
|
@@ -135,5 +108,3 @@ temporary cooldown.
|
|
|
135
108
|
The vendor now brands the line **Anker eufy**; "eufy" alone is the short form and still the name on
|
|
136
109
|
the wire (`eufy_security`, `eufy_life`, `eufy_mega`) and in every product name (eufyCam, eufy Clean,
|
|
137
110
|
eufy Life). Protocol vocabulary follows the device, not the marketing, so those are not renamed here.
|
|
138
|
-
|
|
139
|
-
[releases]: https://github.com/mega-yfue/eufy-sdk/releases
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mega-yfue/eufy-sdk",
|
|
3
|
-
"version": "0.1.1
|
|
3
|
+
"version": "0.1.1",
|
|
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",
|