@camstack/addon-mqtt-broker 1.2.75 → 1.2.77
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/mqtt-broker.addon.js +66 -38
- package/dist/mqtt-broker.addon.mjs +66 -38
- package/package.json +1 -1
|
@@ -7878,17 +7878,29 @@ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
|
|
|
7878
7878
|
/**
|
|
7879
7879
|
* DERIVED per-camera storage summary — the single field cheap consumers read
|
|
7880
7880
|
* (the viewer's status dot, the camera list) instead of walking `bands`:
|
|
7881
|
-
* - `off`
|
|
7882
|
-
* - `events`
|
|
7883
|
-
* - `continuous`
|
|
7884
|
-
*
|
|
7885
|
-
*
|
|
7886
|
-
*
|
|
7881
|
+
* - `off` — no band covers the camera (or it is disabled).
|
|
7882
|
+
* - `events` — every band records around triggers only.
|
|
7883
|
+
* - `continuous` — at least one band records continuously.
|
|
7884
|
+
* - `on-device-decision`— the DEVICE decides: recording runs for as long as the
|
|
7885
|
+
* camera raises its own `recording-signal` level (a robot that cleans). There
|
|
7886
|
+
* is no schedule to author, because there is no hour to program — see
|
|
7887
|
+
* {@link RecordingConfigSchema}`.deviceDecision`.
|
|
7888
|
+
*
|
|
7889
|
+
* NEVER authored: the recorder stamps it from the authoritative intent
|
|
7890
|
+
* (`bands` + `deviceDecision`) on every save (`activeModeForConfig`). Writing it
|
|
7891
|
+
* has no effect.
|
|
7892
|
+
*
|
|
7893
|
+
* `on-device-decision` is named for WHO decides, not for how the recording is
|
|
7894
|
+
* requested. `on-demand` was rejected: in this repo's vocabulary a "demand" is
|
|
7895
|
+
* something the operator makes (the live gate is the recorder's own "demand
|
|
7896
|
+
* window"), and a knob whose name suggests the operator starts it while the
|
|
7897
|
+
* device actually does is the D62 shape — a control nobody can predict.
|
|
7887
7898
|
*/
|
|
7888
7899
|
var RecordingStorageModeSchema = _enum([
|
|
7889
7900
|
"off",
|
|
7890
7901
|
"events",
|
|
7891
|
-
"continuous"
|
|
7902
|
+
"continuous",
|
|
7903
|
+
"on-device-decision"
|
|
7892
7904
|
]);
|
|
7893
7905
|
/**
|
|
7894
7906
|
* Le macro classi che possono aprire una finestra di registrazione — le stesse
|
|
@@ -7938,22 +7950,7 @@ var RecordingTriggersSchema = object({
|
|
|
7938
7950
|
* il livello: un contatto trovato già aperto al riavvio del runner non fa
|
|
7939
7951
|
* registrare.
|
|
7940
7952
|
*/
|
|
7941
|
-
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
7942
|
-
/**
|
|
7943
|
-
* La camera registra per tutta la durata del SEGNALE che lei stessa
|
|
7944
|
-
* pubblica — la cap `recording-signal` (`active: true` mentre il device è in
|
|
7945
|
-
* funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
|
|
7946
|
-
* resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
|
|
7947
|
-
* caduta, così una pulizia di quaranta minuti è UNA clip.
|
|
7948
|
-
*
|
|
7949
|
-
* Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
|
|
7950
|
-
* suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
|
|
7951
|
-
* riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
|
|
7952
|
-
* segnale mai abbassato (un evento perso) non può tenere aperta una
|
|
7953
|
-
* registrazione (D11). Vedi `recorder/addon/band-decision.ts`
|
|
7954
|
-
* (`holdTrigger` / `releaseTrigger`).
|
|
7955
|
-
*/
|
|
7956
|
-
deviceSignal: boolean().optional()
|
|
7953
|
+
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
7957
7954
|
});
|
|
7958
7955
|
/**
|
|
7959
7956
|
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
@@ -7983,13 +7980,28 @@ var RecordingBandSchema = object({
|
|
|
7983
7980
|
end: string().regex(HHMM),
|
|
7984
7981
|
mode: RecordingBandModeSchema,
|
|
7985
7982
|
triggers: RecordingBandTriggersSchema.optional(),
|
|
7983
|
+
/**
|
|
7984
|
+
* RETIRED (D381). A band no longer carries a pre-buffer of its own.
|
|
7985
|
+
*
|
|
7986
|
+
* It was the retroactive KEEP bound — which already-written segments survive
|
|
7987
|
+
* a trigger — and it had to be at least as wide as the widest pre-roll the
|
|
7988
|
+
* broker could serve, or the gate would delete the seconds the ring had just
|
|
7989
|
+
* handed the writer. That "at least as wide as" is the tell: it was a second
|
|
7990
|
+
* expression of the broker's retention, in different units, in a different
|
|
7991
|
+
* addon, with an invariant the operator had to maintain by hand. The keep
|
|
7992
|
+
* bound is now derived from the one prebuffer ceiling and there is nothing
|
|
7993
|
+
* left to configure here.
|
|
7994
|
+
*
|
|
7995
|
+
* The key survives in the SHAPE so a config written before that record still
|
|
7996
|
+
* parses and can be migrated deliberately — `RecordingBandSchema` is not
|
|
7997
|
+
* strict, so simply deleting it would strip an operator's value in silence on
|
|
7998
|
+
* the next save (the failure D380 came one commit from shipping). Nothing
|
|
7999
|
+
* reads it: {@link stripRetiredBandPreBufferSec} removes it on load.
|
|
8000
|
+
*/
|
|
7986
8001
|
preBufferSec: number().min(0).optional(),
|
|
7987
8002
|
postBufferSec: number().min(0).optional()
|
|
7988
8003
|
});
|
|
7989
|
-
({
|
|
7990
|
-
preBufferSec: 15,
|
|
7991
|
-
postBufferSec: 30
|
|
7992
|
-
}).postBufferSec * 1e3;
|
|
8004
|
+
({ postBufferSec: 30 }).postBufferSec * 1e3;
|
|
7993
8005
|
/**
|
|
7994
8006
|
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
7995
8007
|
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
@@ -8037,8 +8049,29 @@ var RecordingConfigSchema = object({
|
|
|
8037
8049
|
* "off" is the absence of a covering band, never a band value.
|
|
8038
8050
|
*/
|
|
8039
8051
|
bands: array(RecordingBandSchema).default([]),
|
|
8052
|
+
/**
|
|
8053
|
+
* THE device-decided intent: record for as long as the camera itself raises
|
|
8054
|
+
* `recording-signal` (`active: true` while the device is in function — a
|
|
8055
|
+
* robot that cleans). AUTHORED, unlike `mode`, and the only authored
|
|
8056
|
+
* recording intent that is not a band.
|
|
8057
|
+
*
|
|
8058
|
+
* It carries NO schedule on purpose. A band is an HOUR, and this feature has
|
|
8059
|
+
* no hour to program: the device decides. What it costs the operator is one
|
|
8060
|
+
* flag — "this camera can record on its own" — and what it buys is the same
|
|
8061
|
+
* hold/release the recorder already implements (D371, `holdTrigger` /
|
|
8062
|
+
* `releaseTrigger`): the window opens on the rise, stays open for the whole
|
|
8063
|
+
* job however long it is, and closes one pad after the fall.
|
|
8064
|
+
*
|
|
8065
|
+
* EXCLUSIVE with `bands` (below): two authorities deciding when the same
|
|
8066
|
+
* camera records is the D62 failure. `off` remains `enabled: false`, so an
|
|
8067
|
+
* operator switching this camera off is REPORTED off, never as broken.
|
|
8068
|
+
*/
|
|
8069
|
+
deviceDecision: boolean().optional(),
|
|
8040
8070
|
retention: RecordingRetentionSchema.optional()
|
|
8041
|
-
}).strict()
|
|
8071
|
+
}).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
|
|
8072
|
+
message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
|
|
8073
|
+
path: ["bands"]
|
|
8074
|
+
});
|
|
8042
8075
|
/**
|
|
8043
8076
|
* Entity-relocation job state (storage entity-routing spec, Phase 4).
|
|
8044
8077
|
*
|
|
@@ -20754,11 +20787,7 @@ var CameraAudioStatusSchema = object({
|
|
|
20754
20787
|
});
|
|
20755
20788
|
/** Recording block — null when no recording cap is active for this device. */
|
|
20756
20789
|
var CameraRecordingStatusSchema = object({
|
|
20757
|
-
mode:
|
|
20758
|
-
"off",
|
|
20759
|
-
"continuous",
|
|
20760
|
-
"events"
|
|
20761
|
-
]),
|
|
20790
|
+
mode: RecordingStorageModeSchema,
|
|
20762
20791
|
active: boolean(),
|
|
20763
20792
|
storageBytes: number()
|
|
20764
20793
|
});
|
|
@@ -27164,11 +27193,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
|
|
|
27164
27193
|
var RecordingStatusSchema = object({
|
|
27165
27194
|
deviceId: number(),
|
|
27166
27195
|
enabled: boolean(),
|
|
27167
|
-
|
|
27168
|
-
|
|
27169
|
-
|
|
27170
|
-
|
|
27171
|
-
]),
|
|
27196
|
+
/** THE derived storage mode, from the one definition
|
|
27197
|
+
* (`deriveRecordingMode`) — never a second enum. A duplicated list is how
|
|
27198
|
+
* `on-device-decision` could have reached the recorder and not the status. */
|
|
27199
|
+
activeMode: RecordingStorageModeSchema,
|
|
27172
27200
|
nodeId: string(),
|
|
27173
27201
|
storageBytes: number()
|
|
27174
27202
|
});
|
|
@@ -7873,17 +7873,29 @@ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
|
|
|
7873
7873
|
/**
|
|
7874
7874
|
* DERIVED per-camera storage summary — the single field cheap consumers read
|
|
7875
7875
|
* (the viewer's status dot, the camera list) instead of walking `bands`:
|
|
7876
|
-
* - `off`
|
|
7877
|
-
* - `events`
|
|
7878
|
-
* - `continuous`
|
|
7879
|
-
*
|
|
7880
|
-
*
|
|
7881
|
-
*
|
|
7876
|
+
* - `off` — no band covers the camera (or it is disabled).
|
|
7877
|
+
* - `events` — every band records around triggers only.
|
|
7878
|
+
* - `continuous` — at least one band records continuously.
|
|
7879
|
+
* - `on-device-decision`— the DEVICE decides: recording runs for as long as the
|
|
7880
|
+
* camera raises its own `recording-signal` level (a robot that cleans). There
|
|
7881
|
+
* is no schedule to author, because there is no hour to program — see
|
|
7882
|
+
* {@link RecordingConfigSchema}`.deviceDecision`.
|
|
7883
|
+
*
|
|
7884
|
+
* NEVER authored: the recorder stamps it from the authoritative intent
|
|
7885
|
+
* (`bands` + `deviceDecision`) on every save (`activeModeForConfig`). Writing it
|
|
7886
|
+
* has no effect.
|
|
7887
|
+
*
|
|
7888
|
+
* `on-device-decision` is named for WHO decides, not for how the recording is
|
|
7889
|
+
* requested. `on-demand` was rejected: in this repo's vocabulary a "demand" is
|
|
7890
|
+
* something the operator makes (the live gate is the recorder's own "demand
|
|
7891
|
+
* window"), and a knob whose name suggests the operator starts it while the
|
|
7892
|
+
* device actually does is the D62 shape — a control nobody can predict.
|
|
7882
7893
|
*/
|
|
7883
7894
|
var RecordingStorageModeSchema = _enum([
|
|
7884
7895
|
"off",
|
|
7885
7896
|
"events",
|
|
7886
|
-
"continuous"
|
|
7897
|
+
"continuous",
|
|
7898
|
+
"on-device-decision"
|
|
7887
7899
|
]);
|
|
7888
7900
|
/**
|
|
7889
7901
|
* Le macro classi che possono aprire una finestra di registrazione — le stesse
|
|
@@ -7933,22 +7945,7 @@ var RecordingTriggersSchema = object({
|
|
|
7933
7945
|
* il livello: un contatto trovato già aperto al riavvio del runner non fa
|
|
7934
7946
|
* registrare.
|
|
7935
7947
|
*/
|
|
7936
|
-
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
7937
|
-
/**
|
|
7938
|
-
* La camera registra per tutta la durata del SEGNALE che lei stessa
|
|
7939
|
-
* pubblica — la cap `recording-signal` (`active: true` mentre il device è in
|
|
7940
|
-
* funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
|
|
7941
|
-
* resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
|
|
7942
|
-
* caduta, così una pulizia di quaranta minuti è UNA clip.
|
|
7943
|
-
*
|
|
7944
|
-
* Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
|
|
7945
|
-
* suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
|
|
7946
|
-
* riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
|
|
7947
|
-
* segnale mai abbassato (un evento perso) non può tenere aperta una
|
|
7948
|
-
* registrazione (D11). Vedi `recorder/addon/band-decision.ts`
|
|
7949
|
-
* (`holdTrigger` / `releaseTrigger`).
|
|
7950
|
-
*/
|
|
7951
|
-
deviceSignal: boolean().optional()
|
|
7948
|
+
sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
7952
7949
|
});
|
|
7953
7950
|
/**
|
|
7954
7951
|
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
@@ -7978,13 +7975,28 @@ var RecordingBandSchema = object({
|
|
|
7978
7975
|
end: string().regex(HHMM),
|
|
7979
7976
|
mode: RecordingBandModeSchema,
|
|
7980
7977
|
triggers: RecordingBandTriggersSchema.optional(),
|
|
7978
|
+
/**
|
|
7979
|
+
* RETIRED (D381). A band no longer carries a pre-buffer of its own.
|
|
7980
|
+
*
|
|
7981
|
+
* It was the retroactive KEEP bound — which already-written segments survive
|
|
7982
|
+
* a trigger — and it had to be at least as wide as the widest pre-roll the
|
|
7983
|
+
* broker could serve, or the gate would delete the seconds the ring had just
|
|
7984
|
+
* handed the writer. That "at least as wide as" is the tell: it was a second
|
|
7985
|
+
* expression of the broker's retention, in different units, in a different
|
|
7986
|
+
* addon, with an invariant the operator had to maintain by hand. The keep
|
|
7987
|
+
* bound is now derived from the one prebuffer ceiling and there is nothing
|
|
7988
|
+
* left to configure here.
|
|
7989
|
+
*
|
|
7990
|
+
* The key survives in the SHAPE so a config written before that record still
|
|
7991
|
+
* parses and can be migrated deliberately — `RecordingBandSchema` is not
|
|
7992
|
+
* strict, so simply deleting it would strip an operator's value in silence on
|
|
7993
|
+
* the next save (the failure D380 came one commit from shipping). Nothing
|
|
7994
|
+
* reads it: {@link stripRetiredBandPreBufferSec} removes it on load.
|
|
7995
|
+
*/
|
|
7981
7996
|
preBufferSec: number().min(0).optional(),
|
|
7982
7997
|
postBufferSec: number().min(0).optional()
|
|
7983
7998
|
});
|
|
7984
|
-
({
|
|
7985
|
-
preBufferSec: 15,
|
|
7986
|
-
postBufferSec: 30
|
|
7987
|
-
}).postBufferSec * 1e3;
|
|
7999
|
+
({ postBufferSec: 30 }).postBufferSec * 1e3;
|
|
7988
8000
|
/**
|
|
7989
8001
|
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
7990
8002
|
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
@@ -8032,8 +8044,29 @@ var RecordingConfigSchema = object({
|
|
|
8032
8044
|
* "off" is the absence of a covering band, never a band value.
|
|
8033
8045
|
*/
|
|
8034
8046
|
bands: array(RecordingBandSchema).default([]),
|
|
8047
|
+
/**
|
|
8048
|
+
* THE device-decided intent: record for as long as the camera itself raises
|
|
8049
|
+
* `recording-signal` (`active: true` while the device is in function — a
|
|
8050
|
+
* robot that cleans). AUTHORED, unlike `mode`, and the only authored
|
|
8051
|
+
* recording intent that is not a band.
|
|
8052
|
+
*
|
|
8053
|
+
* It carries NO schedule on purpose. A band is an HOUR, and this feature has
|
|
8054
|
+
* no hour to program: the device decides. What it costs the operator is one
|
|
8055
|
+
* flag — "this camera can record on its own" — and what it buys is the same
|
|
8056
|
+
* hold/release the recorder already implements (D371, `holdTrigger` /
|
|
8057
|
+
* `releaseTrigger`): the window opens on the rise, stays open for the whole
|
|
8058
|
+
* job however long it is, and closes one pad after the fall.
|
|
8059
|
+
*
|
|
8060
|
+
* EXCLUSIVE with `bands` (below): two authorities deciding when the same
|
|
8061
|
+
* camera records is the D62 failure. `off` remains `enabled: false`, so an
|
|
8062
|
+
* operator switching this camera off is REPORTED off, never as broken.
|
|
8063
|
+
*/
|
|
8064
|
+
deviceDecision: boolean().optional(),
|
|
8035
8065
|
retention: RecordingRetentionSchema.optional()
|
|
8036
|
-
}).strict()
|
|
8066
|
+
}).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
|
|
8067
|
+
message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
|
|
8068
|
+
path: ["bands"]
|
|
8069
|
+
});
|
|
8037
8070
|
/**
|
|
8038
8071
|
* Entity-relocation job state (storage entity-routing spec, Phase 4).
|
|
8039
8072
|
*
|
|
@@ -20749,11 +20782,7 @@ var CameraAudioStatusSchema = object({
|
|
|
20749
20782
|
});
|
|
20750
20783
|
/** Recording block — null when no recording cap is active for this device. */
|
|
20751
20784
|
var CameraRecordingStatusSchema = object({
|
|
20752
|
-
mode:
|
|
20753
|
-
"off",
|
|
20754
|
-
"continuous",
|
|
20755
|
-
"events"
|
|
20756
|
-
]),
|
|
20785
|
+
mode: RecordingStorageModeSchema,
|
|
20757
20786
|
active: boolean(),
|
|
20758
20787
|
storageBytes: number()
|
|
20759
20788
|
});
|
|
@@ -27159,11 +27188,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
|
|
|
27159
27188
|
var RecordingStatusSchema = object({
|
|
27160
27189
|
deviceId: number(),
|
|
27161
27190
|
enabled: boolean(),
|
|
27162
|
-
|
|
27163
|
-
|
|
27164
|
-
|
|
27165
|
-
|
|
27166
|
-
]),
|
|
27191
|
+
/** THE derived storage mode, from the one definition
|
|
27192
|
+
* (`deriveRecordingMode`) — never a second enum. A duplicated list is how
|
|
27193
|
+
* `on-device-decision` could have reached the recorder and not the status. */
|
|
27194
|
+
activeMode: RecordingStorageModeSchema,
|
|
27167
27195
|
nodeId: string(),
|
|
27168
27196
|
storageBytes: number()
|
|
27169
27197
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-mqtt-broker",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.77",
|
|
4
4
|
"description": "MQTT broker registry addon for CamStack — manages external broker entries + an optional embedded aedes broker. Consumers spin up their own `mqtt.js` clients via the `mqtt-broker` cap.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|