@mega-yfue/eufy-sdk 0.2.0-beta.10 → 0.2.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/client/eufy-mega.d.ts +11 -6
- package/dist/core/contracts.d.ts +9 -34
- package/dist/index.js +307 -124
- package/dist/index.js.map +2 -2
- package/dist/transport/p2p/command-router.d.ts +120 -15
- package/dist/transport/p2p/live-stream.d.ts +5 -4
- package/dist/transport/p2p/media.d.ts +2 -2
- package/dist/transport/p2p/session-manager.d.ts +57 -23
- package/dist/transport/p2p/shared-live-source.d.ts +10 -1
- package/package.json +1 -1
|
@@ -393,9 +393,9 @@ export declare class EufyMega extends EventEmitter {
|
|
|
393
393
|
/**
|
|
394
394
|
* Combine explicit P2P media with the optional passive push-thumbnail provider.
|
|
395
395
|
*
|
|
396
|
-
* The retained still also becomes the answer for a live still that could not be captured.
|
|
397
|
-
* serves one camera at a time and a live view outranks a tile
|
|
398
|
-
* being watched is refused at the transport. Answering the retained bytes answers the read rather than
|
|
396
|
+
* The retained still also becomes the answer for a live still that could not be captured. One session
|
|
397
|
+
* serves one camera at a time and a live view outranks a tile — a still does not open a connection of its
|
|
398
|
+
* own — so a still asked for while a sibling is being watched is refused at the transport. Answering the retained bytes answers the read rather than
|
|
399
399
|
* failing it, marked {@link MediaProvider.snapshotLive} `retained` so the caller knows they are not
|
|
400
400
|
* current. With nothing retained the refusal stands.
|
|
401
401
|
*/
|
|
@@ -752,10 +752,15 @@ export declare class EufyMega extends EventEmitter {
|
|
|
752
752
|
*/
|
|
753
753
|
private sendRealtimeInit;
|
|
754
754
|
/**
|
|
755
|
-
*
|
|
755
|
+
* The open P2P sessions, by key. P2P is auto-managed: wired stations are warmed at login, battery
|
|
756
756
|
* stations open on demand (command / stream, or an opted-in event pre-warm) and idle-detach — so this
|
|
757
|
-
* map grows and shrinks over time.
|
|
758
|
-
*
|
|
757
|
+
* map grows and shrinks over time.
|
|
758
|
+
*
|
|
759
|
+
* A station's own session is keyed by its serial, and `p2pConnect(stationSn)` / `p2pClose(stationSn)`
|
|
760
|
+
* track those. A station serving more than one camera at once also holds a session per extra camera,
|
|
761
|
+
* keyed `<stationSn>#live:<channel>` — these carry media alone and raise no connection events, because
|
|
762
|
+
* a station announces its state to every client that connects and reporting each copy would double
|
|
763
|
+
* every event the station's own session already delivers.
|
|
759
764
|
*/
|
|
760
765
|
getP2pSessions(): Map<string, P2PSession>;
|
|
761
766
|
/**
|
package/dist/core/contracts.d.ts
CHANGED
|
@@ -129,32 +129,6 @@ export declare class StationUnreachableError extends Error {
|
|
|
129
129
|
cause?: unknown;
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
/**
|
|
133
|
-
* A live stream was refused: the station is already serving another of its cameras to a viewer.
|
|
134
|
-
*
|
|
135
|
-
* A station fans several cameras out over one session and serves ONE of them at a time. Accepting a second
|
|
136
|
-
* live pull does not make it serve two: measured on a base carrying three attached cameras, each opened
|
|
137
|
-
* stream took the station from the others in turn and all three received their media in bursts. So a second
|
|
138
|
-
* viewer is refused rather than admitted and degraded, which is the difference between a caller being told
|
|
139
|
-
* the constraint and a caller watching every picture stutter.
|
|
140
|
-
*
|
|
141
|
-
* Which camera deserves the station is the caller's decision, not the SDK's, so nothing is queued or
|
|
142
|
-
* pre-empted here.
|
|
143
|
-
*
|
|
144
|
-
* A still is not refused: it yields the station instead, and answers with the retained image where one is
|
|
145
|
-
* held. Only pulls that deliver continuous media contend for a viewer's place.
|
|
146
|
-
*/
|
|
147
|
-
export declare class StationBusyError extends Error {
|
|
148
|
-
/** The channel the station is already serving. */
|
|
149
|
-
readonly servingChannel: number;
|
|
150
|
-
/** Always true: the station is busy now, and stops being busy when the other stream is released. */
|
|
151
|
-
readonly retryable = true;
|
|
152
|
-
constructor(
|
|
153
|
-
/** The channel the station is already serving. */
|
|
154
|
-
servingChannel: number, options?: {
|
|
155
|
-
cause?: unknown;
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
132
|
/**
|
|
159
133
|
* How a live stream ended before its first video keyframe: the warm-up deadline elapsed, the source
|
|
160
134
|
* reported an error, or the source ended on its own.
|
|
@@ -739,8 +713,9 @@ export interface MediaProvider {
|
|
|
739
713
|
/**
|
|
740
714
|
* Present and `true` only when these bytes are the RETAINED still rather than a fresh capture.
|
|
741
715
|
*
|
|
742
|
-
* A live still is refused while a sibling camera on the same station is being watched, because
|
|
743
|
-
*
|
|
716
|
+
* A live still is refused while a sibling camera on the same station is being watched, because one
|
|
717
|
+
* session serves one camera at a time, a still does not open a connection of its own, and the live view
|
|
718
|
+
* is the picture someone is looking at. Answering
|
|
744
719
|
* the retained still there answers the call instead of failing it, and this says the bytes are not
|
|
745
720
|
* current. Absent means freshly captured.
|
|
746
721
|
*/
|
|
@@ -749,12 +724,12 @@ export interface MediaProvider {
|
|
|
749
724
|
/**
|
|
750
725
|
* Open a managed live stream.
|
|
751
726
|
*
|
|
752
|
-
* Several cameras behind one station
|
|
753
|
-
*
|
|
754
|
-
*
|
|
755
|
-
*
|
|
756
|
-
*
|
|
757
|
-
* camera.
|
|
727
|
+
* Several cameras behind one station stream at the same time, each over its own connection to it. One
|
|
728
|
+
* connection serves one camera — a station answers the most recent start on a session, so two cameras
|
|
729
|
+
* sharing one take it from each other in turn — so a camera asked for while its station is already
|
|
730
|
+
* serving another gets a connection of its own. Measured on a base carrying two attached cameras, one
|
|
731
|
+
* at 3840x2160: both held full frame rate at once. Each handle receives only the frames the station
|
|
732
|
+
* tagged for ITS camera.
|
|
758
733
|
*
|
|
759
734
|
* @example
|
|
760
735
|
* ```ts
|