unifi-protect 5.4.2 → 5.5.0
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 +28 -1
- package/dist/client/client.d.ts +46 -10
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +55 -13
- package/dist/client/client.js.map +1 -1
- package/dist/client/connection.d.ts +9 -6
- package/dist/client/connection.d.ts.map +1 -1
- package/dist/client/connection.js +17 -7
- package/dist/client/connection.js.map +1 -1
- package/dist/devices/device.js.map +1 -1
- package/dist/errors.d.ts +3 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +3 -2
- package/dist/errors.js.map +1 -1
- package/dist/event-bus.d.ts +28 -8
- package/dist/event-bus.d.ts.map +1 -1
- package/dist/event-bus.js +70 -15
- package/dist/event-bus.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/protocol/events.d.ts +51 -3
- package/dist/protocol/events.d.ts.map +1 -1
- package/dist/protocol/events.js +105 -9
- package/dist/protocol/events.js.map +1 -1
- package/dist/protocol/packet.d.ts +18 -0
- package/dist/protocol/packet.d.ts.map +1 -1
- package/dist/protocol/packet.js +45 -3
- package/dist/protocol/packet.js.map +1 -1
- package/dist/schema-manifest.json +1 -1
- package/dist/settings.d.ts +7 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +7 -0
- package/dist/settings.js.map +1 -1
- package/dist/testing.d.ts +3 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +7 -0
- package/dist/testing.js.map +1 -0
- package/dist/transport/events-stream.d.ts +15 -5
- package/dist/transport/events-stream.d.ts.map +1 -1
- package/dist/transport/events-stream.js +46 -21
- package/dist/transport/events-stream.js.map +1 -1
- package/dist/transport/http.d.ts +16 -12
- package/dist/transport/http.d.ts.map +1 -1
- package/dist/transport/http.js +43 -16
- package/dist/transport/http.js.map +1 -1
- package/dist/transport/livestream-session.d.ts +5 -3
- package/dist/transport/livestream-session.d.ts.map +1 -1
- package/dist/transport/livestream-session.js +8 -4
- package/dist/transport/livestream-session.js.map +1 -1
- package/dist/transport/talkback-session-double.d.ts +129 -0
- package/dist/transport/talkback-session-double.d.ts.map +1 -0
- package/dist/transport/talkback-session-double.js +187 -0
- package/dist/transport/talkback-session-double.js.map +1 -0
- package/dist/util/cli/commands/camera-talkback.js.map +1 -1
- package/dist/util/cli/commands/capture.js.map +1 -1
- package/dist/util/cli/commands/decode.d.ts.map +1 -1
- package/dist/util/cli/commands/decode.js +128 -19
- package/dist/util/cli/commands/decode.js.map +1 -1
- package/dist/util/cli/commands/doctor.js.map +1 -1
- package/dist/util/cli/commands/watch-events.js.map +1 -1
- package/dist/util/cli/commands/watch-livestream.js.map +1 -1
- package/dist/util/cli/commands/watch-raw.js.map +1 -1
- package/dist/util/cli/commands/watch-state.js.map +1 -1
- package/dist/util/cli/shared.js.map +1 -1
- package/package.json +10 -6
- package/src/client/client.ts +63 -16
- package/src/client/connection.ts +23 -9
- package/src/devices/device.ts +1 -1
- package/src/errors.ts +3 -2
- package/src/event-bus.ts +87 -17
- package/src/index.ts +8 -5
- package/src/protocol/events.ts +148 -12
- package/src/protocol/packet.ts +58 -3
- package/src/settings.ts +8 -0
- package/src/testing.ts +7 -0
- package/src/transport/events-stream.ts +48 -21
- package/src/transport/http.ts +53 -16
- package/src/transport/livestream-session.ts +8 -4
- package/src/transport/talkback-session-double.ts +317 -0
- package/src/util/cli/commands/camera-talkback.ts +1 -1
- package/src/util/cli/commands/capture.ts +2 -2
- package/src/util/cli/commands/decode.ts +164 -22
- package/src/util/cli/commands/doctor.ts +2 -2
- package/src/util/cli/commands/watch-events.ts +1 -1
- package/src/util/cli/commands/watch-livestream.ts +1 -1
- package/src/util/cli/commands/watch-raw.ts +1 -1
- package/src/util/cli/commands/watch-state.ts +4 -4
- package/src/util/cli/shared.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../src/devices/device.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AASvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAgB,UAAU;IAEX,GAAG,CAAgB;IAEtC,oKAAoK;IACpK,mFAAmF;IAC1E,OAAO,CAA+C;IAE/D,YAAsB,GAAkB,EAAE,MAAoD;QAE5F,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;;;;OAMG;IACH,IAAI,MAAM;QAER,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC;IAC/B,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI;QAEF,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,CAAC,OAAO,CAAC,OAAiC,EAAE;QAEhD,iKAAiK;QACjK,6HAA6H;QAC7H,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../src/devices/device.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AASvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAgB,UAAU;IAEX,GAAG,CAAgB;IAEtC,oKAAoK;IACpK,mFAAmF;IAC1E,OAAO,CAA+C;IAE/D,YAAsB,GAAkB,EAAE,MAAoD;QAE5F,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;;;;OAMG;IACH,IAAI,MAAM;QAER,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AE9C,MAAM,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,yEAAyE;IAC/D,cAAc;QAEtB,OAAO,SAAS,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,QAAQ,GAAG,iDAAiD,CAAC;IACxG,CAAC;CACF"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -114,8 +114,9 @@ export declare class ProtectCertificateError extends ProtectNetworkError {
|
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
|
-
* The caller's `AbortSignal` fired
|
|
118
|
-
*
|
|
117
|
+
* The operation was cancelled rather than failed: the caller's `AbortSignal` fired, or the resource the operation needed closed - a wait pending on the events of a
|
|
118
|
+
* subsystem that was disposed or tore down, or a request sent to a transport already disposed. Neither is the library's own deadline. Recoverable in the sense that
|
|
119
|
+
* nothing went wrong with the controller - re-issuing the operation with a fresh signal, or on a fresh resource, is valid.
|
|
119
120
|
*
|
|
120
121
|
* @category Errors
|
|
121
122
|
*/
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,8BAAsB,YAAa,SAAQ,KAAK;IAK9C,SAAS,aAAa,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAMrE;AAED;;;;;;GAMG;AACH,8BAAsB,gBAAiB,SAAQ,YAAY;CAAG;AAE9D;;;;;;GAMG;AACH,8BAAsB,UAAW,SAAQ,YAAY;CAAG;AAExD;;;;;GAKG;AACH,qBAAa,qBAAsB,SAAQ,gBAAgB;IAEzD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|
-
* The caller's `AbortSignal` fired
|
|
134
|
-
*
|
|
133
|
+
* The operation was cancelled rather than failed: the caller's `AbortSignal` fired, or the resource the operation needed closed - a wait pending on the events of a
|
|
134
|
+
* subsystem that was disposed or tore down, or a request sent to a transport already disposed. Neither is the library's own deadline. Recoverable in the sense that
|
|
135
|
+
* nothing went wrong with the controller - re-issuing the operation with a fresh signal, or on a fresh resource, is valid.
|
|
135
136
|
*
|
|
136
137
|
* @category Errors
|
|
137
138
|
*/
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAgB,YAAa,SAAQ,KAAK;IAE9C,iKAAiK;IACjK,+JAA+J;IAC/J,+CAA+C;IAC/C,YAAsB,OAAe,EAAE,OAA6B;QAElE,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;QAE1C,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,OAAgB,gBAAiB,SAAQ,YAAY;CAAG;AAE9D;;;;;;GAMG;AACH,MAAM,OAAgB,UAAW,SAAQ,YAAY;CAAG;AAExD;;;;;GAKG;AACH,MAAM,OAAO,qBAAsB,SAAQ,gBAAgB;IAEzD,8FAA8F;IACrF,UAAU,CAAS;IAE5B,YAAY,OAAe,EAAE,OAAgD;QAE3E,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QAEzC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACvC,CAAC;CACF;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,mBAAoB,SAAQ,gBAAgB;IAEvD,+GAA+G;IACtG,SAA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E,CAAC;QAEhH,OAAO,KAA8B,CAAC;IACxC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAc;IAEjD,OAAO,CAAC,KAAK,YAAY,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AACxE,CAAC"}
|
package/dist/event-bus.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ProtectLogging } from "./logging.ts";
|
|
2
2
|
/**
|
|
3
|
-
* Options accepted by the event-bus `stream` rail
|
|
4
|
-
*
|
|
3
|
+
* Options accepted by the event-bus `stream` rail: the abort signal that terminates the iteration. The queue is unbounded, matching the livestream-subscription rule (a
|
|
4
|
+
* subscriber receives every emission until it aborts, stops iterating, or the owner of the events closes).
|
|
5
5
|
*
|
|
6
6
|
* @category Events
|
|
7
7
|
*/
|
|
@@ -31,6 +31,10 @@ export interface StreamOptions {
|
|
|
31
31
|
* and logs a throw at error level through the logger the bus was built with, the host's own, and the listeners after it still run. The {@link once} and
|
|
32
32
|
* {@link stream} rails need no such guard, because their consumers run on a later microtask, outside the emit.
|
|
33
33
|
*
|
|
34
|
+
* Closing the bus is terminal, and each host closes its own once it has made its last emission. Every open stream ends cleanly after delivering what was emitted
|
|
35
|
+
* before the close, every pending wait rejects with the reason the host closed with, and every callback is released; from then on a new stream ends at once, a new
|
|
36
|
+
* wait rejects at once with that same reason, and a callback registers nothing.
|
|
37
|
+
*
|
|
34
38
|
* `EventMap` keys are the event names; each value is the tuple of arguments that event carries (e.g., `{ throttleEntered: []; packet: [event: TypedEvent] }`).
|
|
35
39
|
*
|
|
36
40
|
* @typeParam EventMap - A record mapping each event name to the readonly tuple of arguments emitted with it.
|
|
@@ -48,18 +52,20 @@ export declare class EventBus<EventMap extends Record<keyof EventMap, readonly u
|
|
|
48
52
|
* Long-lived notification subscription. Registers `handler` for `event` and returns a `Disposable` whose disposal detaches it.
|
|
49
53
|
*
|
|
50
54
|
* Prefer `using sub = bus.on("event", handler);` so the listener is removed automatically when the binding leaves scope. Where a `using` declaration does not fit,
|
|
51
|
-
* call `sub[Symbol.dispose]()` explicitly. Disposing twice is safe - the second `off` is a no-op.
|
|
55
|
+
* call `sub[Symbol.dispose]()` explicitly. Disposing twice is safe - the second `off` is a no-op. A close releases every listener, and on a closed bus nothing is
|
|
56
|
+
* registered, since nothing will ever be emitted to it.
|
|
52
57
|
*
|
|
53
58
|
* @param event - The event name to listen for.
|
|
54
|
-
* @param handler - Invoked with the event's argument tuple on every emission until the returned handle is disposed. A throw from it is logged at
|
|
55
|
-
* reaches neither the emitter nor the listeners after it.
|
|
59
|
+
* @param handler - Invoked with the event's argument tuple on every emission until the returned handle is disposed or the bus closes. A throw from it is logged at
|
|
60
|
+
* error level and reaches neither the emitter nor the listeners after it.
|
|
56
61
|
*
|
|
57
62
|
* @returns A `Disposable` that removes this listener when disposed.
|
|
58
63
|
*/
|
|
59
64
|
on<K extends keyof EventMap & string>(event: K, handler: (...args: EventMap[K]) => void): Disposable;
|
|
60
65
|
/**
|
|
61
66
|
* One-shot wait for the next emission of `event`. Resolves with the event's argument tuple. Cancellable: if `opts.signal` aborts before the event fires, the
|
|
62
|
-
* promise rejects with the signal's
|
|
67
|
+
* promise rejects with an `AbortError` whose `cause` is the signal's reason. If the bus closes first, the promise rejects with the reason it closed with, as does a
|
|
68
|
+
* wait begun on a closed bus, so a wait that is never awaited needs a rejection handler.
|
|
63
69
|
*
|
|
64
70
|
* @param event - The event name to await.
|
|
65
71
|
* @param opts - Optional abort signal that cancels the wait.
|
|
@@ -70,8 +76,10 @@ export declare class EventBus<EventMap extends Record<keyof EventMap, readonly u
|
|
|
70
76
|
signal?: AbortSignal;
|
|
71
77
|
}): Promise<EventMap[K]>;
|
|
72
78
|
/**
|
|
73
|
-
*
|
|
74
|
-
* event's argument tuple. The queue is unbounded
|
|
79
|
+
* Async iterable of every subsequent emission of `event`, until `opts.signal` aborts, the consumer stops iterating, or the bus closes. Each yielded value is the
|
|
80
|
+
* event's argument tuple. The queue is unbounded - a slow consumer accumulates pending emissions rather than dropping them. A close ends the iteration cleanly once
|
|
81
|
+
* every emission made before it has been delivered, and a stream begun on a closed bus ends at once; an abort rejects the iteration with an `AbortError` whose
|
|
82
|
+
* `cause` is the signal's reason.
|
|
75
83
|
*
|
|
76
84
|
* @param event - The event name to stream.
|
|
77
85
|
* @param opts - Optional abort signal that terminates the iteration.
|
|
@@ -79,6 +87,18 @@ export declare class EventBus<EventMap extends Record<keyof EventMap, readonly u
|
|
|
79
87
|
* @returns An async iterable yielding the argument tuple of each emission.
|
|
80
88
|
*/
|
|
81
89
|
stream<K extends keyof EventMap & string>(event: K, opts?: StreamOptions): AsyncIterable<EventMap[K]>;
|
|
90
|
+
/**
|
|
91
|
+
* Close the bus for good. Every open stream ends once it has delivered what was emitted before the close, every pending wait rejects with `reason`, and every
|
|
92
|
+
* callback is released; from then on a new stream ends at once, a new wait rejects with the same `reason`, a callback registers nothing, and an emit reaches no
|
|
93
|
+
* listener. A no-op on repeat, so the first reason stands.
|
|
94
|
+
*
|
|
95
|
+
* This method is package-internal: the host closes its own bus once it has made its last emission.
|
|
96
|
+
*
|
|
97
|
+
* @param reason - What ended the host, the error every pending and later wait rejects with.
|
|
98
|
+
*
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
close(reason: Error): void;
|
|
82
102
|
/**
|
|
83
103
|
* Emit `event` with its argument tuple, synchronously invoking every active listener (callbacks, pending `once` waiters, open `stream` iterators).
|
|
84
104
|
*
|
package/dist/event-bus.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-bus.d.ts","sourceRoot":"","sources":["../src/event-bus.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,WA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IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO;CAIjF"}
|
package/dist/event-bus.js
CHANGED
|
@@ -2,13 +2,22 @@
|
|
|
2
2
|
*
|
|
3
3
|
* event-bus.ts: A typed, three-rail event facade composing node:events.EventEmitter.
|
|
4
4
|
*/
|
|
5
|
-
import { EventEmitter,
|
|
5
|
+
import { EventEmitter, on as subscribeIterator } from "node:events";
|
|
6
6
|
// Every public event name is namespaced with this prefix before it reaches the composed EventEmitter. node:events special-cases three event names - `error` (emitting
|
|
7
7
|
// it with no listener throws synchronously, and it rejects any open `events.on()` async iterator of *other* events), `newListener`, and `removeListener` - and that
|
|
8
8
|
// special-casing would otherwise leak straight through this facade, which exists precisely to insulate consumers from EventEmitter's semantics. By translating, say,
|
|
9
9
|
// `error` to `ufp:event:error` at the single boundary below, the underlying emitter never sees a literal `error`, so a typed `error` rail behaves like any other rail:
|
|
10
10
|
// it never throws on a missing listener and never cross-rejects a sibling stream. The prefix is internal and never observable; consumers always use the bare name.
|
|
11
11
|
const EVENT_NAME_PREFIX = "ufp:event:";
|
|
12
|
+
// The event a close emits to end every open stream. It lies outside the EVENT_NAME_PREFIX namespace, so no rail's name can ever collide with it.
|
|
13
|
+
const CLOSE_EVENT = "ufp:close";
|
|
14
|
+
// The options every stream registers with: the close event that ends its iteration. A stream with no signal passes this one object, so it allocates nothing beyond
|
|
15
|
+
// node's own iterator, and a stream with a signal passes a copy that adds it.
|
|
16
|
+
const CLOSE_OPTIONS = { close: [CLOSE_EVENT] };
|
|
17
|
+
// The stream a closed bus hands out. It has nothing to yield, so a `for await` over it ends on its first step, and it registers nothing on the emitter.
|
|
18
|
+
async function* endedStream() {
|
|
19
|
+
// A closed bus has nothing more to deliver.
|
|
20
|
+
}
|
|
12
21
|
/**
|
|
13
22
|
* A typed facade over `node:events.EventEmitter` that exposes a fixed set of subscription shapes - the canonical contract every event-producing subsystem in this
|
|
14
23
|
* library presents (`Transport`, `EventStream`, `ConnectionMonitor`, `LivestreamSession`, `ProtectClient`).
|
|
@@ -32,6 +41,10 @@ const EVENT_NAME_PREFIX = "ufp:event:";
|
|
|
32
41
|
* and logs a throw at error level through the logger the bus was built with, the host's own, and the listeners after it still run. The {@link once} and
|
|
33
42
|
* {@link stream} rails need no such guard, because their consumers run on a later microtask, outside the emit.
|
|
34
43
|
*
|
|
44
|
+
* Closing the bus is terminal, and each host closes its own once it has made its last emission. Every open stream ends cleanly after delivering what was emitted
|
|
45
|
+
* before the close, every pending wait rejects with the reason the host closed with, and every callback is released; from then on a new stream ends at once, a new
|
|
46
|
+
* wait rejects at once with that same reason, and a callback registers nothing.
|
|
47
|
+
*
|
|
35
48
|
* `EventMap` keys are the event names; each value is the tuple of arguments that event carries (e.g., `{ throttleEntered: []; packet: [event: TypedEvent] }`).
|
|
36
49
|
*
|
|
37
50
|
* @typeParam EventMap - A record mapping each event name to the readonly tuple of arguments emitted with it.
|
|
@@ -45,6 +58,9 @@ export class EventBus {
|
|
|
45
58
|
// The composed emitter. Private so the inherited EventEmitter surface never escapes; the only way in or out is through the facade's subscription rails plus emit.
|
|
46
59
|
#emitter = new EventEmitter();
|
|
47
60
|
#log;
|
|
61
|
+
// The reason the bus closed with, null while it is open, which is the bus's whole closed state. It is typed as the value a throw carries, because once throws it as
|
|
62
|
+
// it stands, while close admits nothing but an Error.
|
|
63
|
+
#closeReason = null;
|
|
48
64
|
/**
|
|
49
65
|
* @param log - The host subsystem's logger, which records a listener's throw. Required rather than defaulted, so a throw is recorded wherever the host records
|
|
50
66
|
* everything else.
|
|
@@ -60,15 +76,21 @@ export class EventBus {
|
|
|
60
76
|
* Long-lived notification subscription. Registers `handler` for `event` and returns a `Disposable` whose disposal detaches it.
|
|
61
77
|
*
|
|
62
78
|
* Prefer `using sub = bus.on("event", handler);` so the listener is removed automatically when the binding leaves scope. Where a `using` declaration does not fit,
|
|
63
|
-
* call `sub[Symbol.dispose]()` explicitly. Disposing twice is safe - the second `off` is a no-op.
|
|
79
|
+
* call `sub[Symbol.dispose]()` explicitly. Disposing twice is safe - the second `off` is a no-op. A close releases every listener, and on a closed bus nothing is
|
|
80
|
+
* registered, since nothing will ever be emitted to it.
|
|
64
81
|
*
|
|
65
82
|
* @param event - The event name to listen for.
|
|
66
|
-
* @param handler - Invoked with the event's argument tuple on every emission until the returned handle is disposed. A throw from it is logged at
|
|
67
|
-
* reaches neither the emitter nor the listeners after it.
|
|
83
|
+
* @param handler - Invoked with the event's argument tuple on every emission until the returned handle is disposed or the bus closes. A throw from it is logged at
|
|
84
|
+
* error level and reaches neither the emitter nor the listeners after it.
|
|
68
85
|
*
|
|
69
86
|
* @returns A `Disposable` that removes this listener when disposed.
|
|
70
87
|
*/
|
|
71
88
|
on(event, handler) {
|
|
89
|
+
// A closed bus registers nothing: a handler left on the emitter would run for an emit the closed bus must answer as having no listener, so the handle returned
|
|
90
|
+
// here has nothing to detach.
|
|
91
|
+
if (this.#closeReason !== null) {
|
|
92
|
+
return { [Symbol.dispose]: () => undefined };
|
|
93
|
+
}
|
|
72
94
|
/* We register a forwarding wrapper rather than the handler itself so the `args` boundary cast lives in one place and `off` has a stable reference to remove. The
|
|
73
95
|
* emitter is untyped, so the cast from `unknown[]` to the event's argument tuple is the single unavoidable boundary cast - everything above it is fully typed.
|
|
74
96
|
*
|
|
@@ -89,7 +111,8 @@ export class EventBus {
|
|
|
89
111
|
}
|
|
90
112
|
/**
|
|
91
113
|
* One-shot wait for the next emission of `event`. Resolves with the event's argument tuple. Cancellable: if `opts.signal` aborts before the event fires, the
|
|
92
|
-
* promise rejects with the signal's
|
|
114
|
+
* promise rejects with an `AbortError` whose `cause` is the signal's reason. If the bus closes first, the promise rejects with the reason it closed with, as does a
|
|
115
|
+
* wait begun on a closed bus, so a wait that is never awaited needs a rejection handler.
|
|
93
116
|
*
|
|
94
117
|
* @param event - The event name to await.
|
|
95
118
|
* @param opts - Optional abort signal that cancels the wait.
|
|
@@ -97,15 +120,18 @@ export class EventBus {
|
|
|
97
120
|
* @returns A promise resolving to the argument tuple of the next emission.
|
|
98
121
|
*/
|
|
99
122
|
async once(event, opts = {}) {
|
|
100
|
-
//
|
|
101
|
-
//
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
123
|
+
// The wait is the first item of a stream, so it registers, aborts and ends exactly as a stream does, and leaving the loop releases the stream's listeners. A stream
|
|
124
|
+
// ends without an item only when the bus closes, so falling out of the loop is the close, and the wait rejects with the reason the bus closed with.
|
|
125
|
+
for await (const args of this.stream(event, opts)) {
|
|
126
|
+
return args;
|
|
127
|
+
}
|
|
128
|
+
throw this.#closeReason;
|
|
105
129
|
}
|
|
106
130
|
/**
|
|
107
|
-
*
|
|
108
|
-
* event's argument tuple. The queue is unbounded
|
|
131
|
+
* Async iterable of every subsequent emission of `event`, until `opts.signal` aborts, the consumer stops iterating, or the bus closes. Each yielded value is the
|
|
132
|
+
* event's argument tuple. The queue is unbounded - a slow consumer accumulates pending emissions rather than dropping them. A close ends the iteration cleanly once
|
|
133
|
+
* every emission made before it has been delivered, and a stream begun on a closed bus ends at once; an abort rejects the iteration with an `AbortError` whose
|
|
134
|
+
* `cause` is the signal's reason.
|
|
109
135
|
*
|
|
110
136
|
* @param event - The event name to stream.
|
|
111
137
|
* @param opts - Optional abort signal that terminates the iteration.
|
|
@@ -113,9 +139,38 @@ export class EventBus {
|
|
|
113
139
|
* @returns An async iterable yielding the argument tuple of each emission.
|
|
114
140
|
*/
|
|
115
141
|
stream(event, opts = {}) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
142
|
+
/* The caller's signal is read before the closed state, so a signal that has already aborted keeps its meaning on a closed bus: node's `on` throws its
|
|
143
|
+
* `AbortError` before registering anything, as it does on an open bus. A closed bus otherwise hands out a stream that has already ended.
|
|
144
|
+
*
|
|
145
|
+
* node:events' `on` returns an async iterator that registers here, before anything is awaited, so an emission made before the first step is buffered rather than
|
|
146
|
+
* lost. It rejects with an `AbortError` when the signal fires, which the firehose sugar smooths into a clean return, and the close event ends it cleanly: its
|
|
147
|
+
* listeners and its hold on the signal come off at the close, and it yields what it had buffered before it reports done. The yielded values are the argument
|
|
148
|
+
* arrays, which are our tuple type at the boundary.
|
|
149
|
+
*/
|
|
150
|
+
if ((opts.signal?.aborted !== true) && (this.#closeReason !== null)) {
|
|
151
|
+
return endedStream();
|
|
152
|
+
}
|
|
153
|
+
return subscribeIterator(this.#emitter, EVENT_NAME_PREFIX + event, opts.signal ? { ...CLOSE_OPTIONS, signal: opts.signal } : CLOSE_OPTIONS);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Close the bus for good. Every open stream ends once it has delivered what was emitted before the close, every pending wait rejects with `reason`, and every
|
|
157
|
+
* callback is released; from then on a new stream ends at once, a new wait rejects with the same `reason`, a callback registers nothing, and an emit reaches no
|
|
158
|
+
* listener. A no-op on repeat, so the first reason stands.
|
|
159
|
+
*
|
|
160
|
+
* This method is package-internal: the host closes its own bus once it has made its last emission.
|
|
161
|
+
*
|
|
162
|
+
* @param reason - What ended the host, the error every pending and later wait rejects with.
|
|
163
|
+
*
|
|
164
|
+
* @internal
|
|
165
|
+
*/
|
|
166
|
+
close(reason) {
|
|
167
|
+
if (this.#closeReason !== null) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
// The close event ends every open stream, and the removal that follows releases every callback and anything else the emitter still holds.
|
|
171
|
+
this.#closeReason = reason;
|
|
172
|
+
this.#emitter.emit(CLOSE_EVENT);
|
|
173
|
+
this.#emitter.removeAllListeners();
|
|
119
174
|
}
|
|
120
175
|
/**
|
|
121
176
|
* Emit `event` with its argument tuple, synchronously invoking every active listener (callbacks, pending `once` waiters, open `stream` iterators).
|
package/dist/event-bus.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-bus.js","sourceRoot":"","sources":["../src/event-bus.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"event-bus.js","source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a,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,aAAa,CAC9G,CAAC;IAC/B,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,MAAa;QAEjB,IAAG,IAAI,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;YAE9B,OAAO;QACT,CAAC;QAED,0IAA0I;QAC1I,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC;QAC3B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC;IACrC,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CAAoC,KAAQ,EAAE,GAAG,IAAiB;QAEpE,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,iBAAiB,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;IAChE,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type { ProtectEventHeader, RawPacket } from "./protocol/packet.ts";
|
|
|
13
13
|
export type { LivestreamSource, Segment } from "./transport/livestream-session.ts";
|
|
14
14
|
export type { LivestreamDescription, LivestreamInit, LivestreamTrack } from "./protocol/init-segment.ts";
|
|
15
15
|
export { DEVICE_COLLECTION_KEYS } from "./protocol/events.ts";
|
|
16
|
-
export type { AuthMethod, DeviceCollectionKey, SmartDetectType, StateModelKey, TypedEvent } from "./protocol/events.ts";
|
|
16
|
+
export type { AuthMethod, DeviceCollectionKey, SmartDetectType, StateModelKey, StreamClassifier, TypedEvent } from "./protocol/events.ts";
|
|
17
17
|
export { isMacAddress, normalizeMacAddress } from "./protocol/address.ts";
|
|
18
18
|
export { isPlainObject } from "./protocol/plain-object.ts";
|
|
19
19
|
export type { TalkbackSession, TalkbackState } from "./transport/talkback-session.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.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AC;AAI9E,oKAAoK;AACpK,8CAA8C;AAC9C,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAShE,8IAA8I;AAC9I,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,kCAAkC,EAAE,+BAA+B,EACpJ,kCAAkC,EAAE,+BAA+B,EAAE,+BAA+B,EAAE,uCAAuC,EAC7I,uCAAuC,EAAE,wCAAwC,EAAE,oCAAoC,EAAE,sCAAsC,EAC/J,qCAAqC,EACrC,kCAAkC,EAAE,iCAAiC,EAAE,mCAAmC,EAAE,oCAAoC,EAChJ,mCAAmC,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The typed-event taxonomy for the UniFi Protect realtime stream, the pure {@link classifyPacket} that lifts a {@link RawPacket} into it,
|
|
2
|
+
* The typed-event taxonomy for the UniFi Protect realtime stream, the pure {@link classifyPacket} that lifts a {@link RawPacket} into it, the {@link StreamClassifier}
|
|
3
|
+
* that lifts a stream's frames through it while carrying each open event's camera and start to the event's later frames, and the bootstrap-dimension
|
|
3
4
|
* {@link findUnmodeledDeviceCollections} that lifts an applied bootstrap into the device collections the reducer does not model.
|
|
4
5
|
*
|
|
5
6
|
* This module is Layer 1: it reads the codec's output shape and the domain types by type alone, value-imports only the error module's `assertNever` and the
|
|
6
|
-
* plain-object predicate `isPlainObject`, performs no I/O, and holds no state
|
|
7
|
+
* plain-object predicate `isPlainObject`, performs no I/O, and holds no state at module scope; a `StreamClassifier` instance holds its own stream's open events, and
|
|
8
|
+
* the bound on them is its caller's to hand in. It is the second half of the protocol contract -
|
|
7
9
|
* {@link ../protocol/packet | packet.ts} turns bytes into a `RawPacket`; this turns a `RawPacket` into a {@link TypedEvent}. Because it owns
|
|
8
10
|
* the modelKey vocabulary ({@link DEVICE_MODEL_KEYS} / {@link KNOWN_MODEL_KEYS}), it also hosts the bootstrap-dimension classifier: where `classifyPacket` catches
|
|
9
11
|
* an unmodeled class that *emits a realtime packet*, `findUnmodeledDeviceCollections` catches one that merely *lives in the bootstrap* - the standing twin the realtime
|
|
@@ -77,7 +79,8 @@ export type AuthMethod = "fingerprint" | "nfc";
|
|
|
77
79
|
* `event` model key (the only place an occurrence carries identity and metadata), flow only to the `client.events()` firehose, and are no-ops in the reducer:
|
|
78
80
|
*
|
|
79
81
|
* - `motionDetected` - raw motion began on a camera.
|
|
80
|
-
* - `smartDetect` - a smart object class was detected (`objectTypes` carries the classes).
|
|
82
|
+
* - `smartDetect` - a smart object class was detected (`objectTypes` carries the classes). A detection's first event can carry an empty `objectTypes`: an audio
|
|
83
|
+
* detection opens before the controller names its class, and the class follows on a later event with the same `eventId`.
|
|
81
84
|
* - `tamperDetected` - a camera reported tampering (the controller's `smartDetectTamper` occurrence). A one-way signal with no paired clear and no camera-state field,
|
|
82
85
|
* unlike motion's `lastMotion` - so the occurrence is its single source of truth. It is a sibling of `motionDetected`, not a `smartDetect` variant: tamper is not a
|
|
83
86
|
* smart object class and carries no `objectTypes`.
|
|
@@ -186,6 +189,10 @@ export declare const KNOWN_EVENT_TYPES: readonly string[];
|
|
|
186
189
|
* as a `devicePatched`; it is never re-synthesized into an activity signal, which would require remembering the previous value and thus break purity. "Did motion
|
|
187
190
|
* happen?" has exactly one home (the occurrence); "what is the camera's current `lastMotion`?" has exactly one home (the state).
|
|
188
191
|
*
|
|
192
|
+
* Being single-packet, it cannot attribute a frame that omits its camera. The controller names an event's camera and start on the event's `add` alone, so a
|
|
193
|
+
* camera-attributed event's later `update` that names neither, an audio detection's classed update above all, classifies as `null` here. The live rail lifts its
|
|
194
|
+
* frames through a {@link StreamClassifier}, which remembers each open event's camera and start and carries them to such a frame.
|
|
195
|
+
*
|
|
189
196
|
* @param raw - A structurally valid packet from {@link ../protocol/packet | decodePacket}.
|
|
190
197
|
*
|
|
191
198
|
* @returns The classified {@link TypedEvent}, or `null` for a valid-but-unmodeled packet.
|
|
@@ -193,6 +200,47 @@ export declare const KNOWN_EVENT_TYPES: readonly string[];
|
|
|
193
200
|
* @category Events
|
|
194
201
|
*/
|
|
195
202
|
export declare function classifyPacket(raw: RawPacket): TypedEvent | null;
|
|
203
|
+
/**
|
|
204
|
+
* The classifier a realtime stream lifts its frames through: {@link ProtectClient.classifyPacket}, with each open event's camera and start carried to the event's
|
|
205
|
+
* later frames.
|
|
206
|
+
*
|
|
207
|
+
* The controller names an event's camera and start on its `add` and sends what it learns later as partial `update`s that name neither - an audio detection's class
|
|
208
|
+
* above all, since the controller saves every audio event with no class and names the class in a frame of its own. So this remembers each open event's camera and
|
|
209
|
+
* start under its id and supplies them to a later frame that omits them, while what was detected is still read from the frame that says it alone. An entry opens on
|
|
210
|
+
* an `add` that names its own camera and carries no `end`, and closes on the frame that carries an `end` or on the event's `remove`, because what the controller
|
|
211
|
+
* sends after an end restates the event, a visual detection's classes among it, and lifting that would deliver a detection for an event already over. The frame
|
|
212
|
+
* that carries the `end` is lifted with the entry before the entry goes, while a `remove` is read from the header whatever its payload carries, and its own frame
|
|
213
|
+
* takes nothing from the entry it closes.
|
|
214
|
+
*
|
|
215
|
+
* One instance serves one stream for that stream's life, so a new connection starts with no open events. Its memory is bounded by the capacity its owner hands in,
|
|
216
|
+
* at which the oldest entry is evicted to admit a new one, the bound for an event whose end never arrives. A frame of any other model key costs nothing beyond
|
|
217
|
+
* `classifyPacket`, and an `event` frame costs at most one map read, with a write only at an event's `add`, its end or its `remove`.
|
|
218
|
+
*
|
|
219
|
+
* A consumer reaches one through {@link ProtectClient.createClassifier}, built as the events stream builds its own, at the same bound, so a recording of one
|
|
220
|
+
* connection, taken unfiltered from its start and lifted in order through one classifier, reads as the live rail read it.
|
|
221
|
+
*
|
|
222
|
+
* @category Events
|
|
223
|
+
*/
|
|
224
|
+
export declare class StreamClassifier {
|
|
225
|
+
#private;
|
|
226
|
+
/**
|
|
227
|
+
* @param options - The classifier's options.
|
|
228
|
+
* @param options.capacity - The most open events remembered at once, the oldest evicted to admit a new one at this bound.
|
|
229
|
+
*
|
|
230
|
+
* @internal
|
|
231
|
+
*/
|
|
232
|
+
constructor({ capacity }: {
|
|
233
|
+
capacity: number;
|
|
234
|
+
});
|
|
235
|
+
/**
|
|
236
|
+
* Classify one frame of the stream, remembering or forgetting its event as the frame opens or ends it.
|
|
237
|
+
*
|
|
238
|
+
* @param raw - A structurally valid packet from {@link ProtectClient.decodePacket}.
|
|
239
|
+
*
|
|
240
|
+
* @returns The classified {@link TypedEvent}, or `null` for a valid-but-unmodeled packet.
|
|
241
|
+
*/
|
|
242
|
+
classify(raw: RawPacket): TypedEvent | null;
|
|
243
|
+
}
|
|
196
244
|
/**
|
|
197
245
|
* The id(s) of the record(s) a {@link TypedEvent} concerns - the single, total mapping from an event to its subject(s), shared by every consumer that attributes an event
|
|
198
246
|
* to a device (the CLI's `--device` filter and event rendering today; any future generic consumer tomorrow). A state transition concerns the one reduced record it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/protocol/events.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/protocol/events.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC9F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAW7C,eAAO,MAAM,sBAAsB,2EAA8E,CAAC;AAGlH,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,kFAAgD,CAAC;AAM/E,gBAAgB;AAChB,eAAO,MAAM,gBAAgB,sGAAwD,CAAC;AAStF,gBAAgB;AAChB,eAAO,MAAM,gBAAgB,uPAC6B,CAAC;AAE3D;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,sBAAsB,CAAC,MAAM,CAAC,CAAC;AAExE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