@camstack/addon-provider-unifi 0.2.75 → 0.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/addon.js CHANGED
@@ -7849,17 +7849,29 @@ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7849
7849
  /**
7850
7850
  * DERIVED per-camera storage summary — the single field cheap consumers read
7851
7851
  * (the viewer's status dot, the camera list) instead of walking `bands`:
7852
- * - `off` — no band covers the camera (or it is disabled).
7853
- * - `events` — every band records around triggers only.
7854
- * - `continuous` — at least one band records continuously.
7855
- *
7856
- * NEVER authored: the recorder stamps it from the authoritative `bands` on
7857
- * every save (`activeModeForConfig`). Writing it has no effect.
7852
+ * - `off` — no band covers the camera (or it is disabled).
7853
+ * - `events` — every band records around triggers only.
7854
+ * - `continuous` — at least one band records continuously.
7855
+ * - `on-device-decision`— the DEVICE decides: recording runs for as long as the
7856
+ * camera raises its own `recording-signal` level (a robot that cleans). There
7857
+ * is no schedule to author, because there is no hour to program — see
7858
+ * {@link RecordingConfigSchema}`.deviceDecision`.
7859
+ *
7860
+ * NEVER authored: the recorder stamps it from the authoritative intent
7861
+ * (`bands` + `deviceDecision`) on every save (`activeModeForConfig`). Writing it
7862
+ * has no effect.
7863
+ *
7864
+ * `on-device-decision` is named for WHO decides, not for how the recording is
7865
+ * requested. `on-demand` was rejected: in this repo's vocabulary a "demand" is
7866
+ * something the operator makes (the live gate is the recorder's own "demand
7867
+ * window"), and a knob whose name suggests the operator starts it while the
7868
+ * device actually does is the D62 shape — a control nobody can predict.
7858
7869
  */
7859
7870
  var RecordingStorageModeSchema = _enum([
7860
7871
  "off",
7861
7872
  "events",
7862
- "continuous"
7873
+ "continuous",
7874
+ "on-device-decision"
7863
7875
  ]);
7864
7876
  /**
7865
7877
  * Le macro classi che possono aprire una finestra di registrazione — le stesse
@@ -7909,22 +7921,7 @@ var RecordingTriggersSchema = object({
7909
7921
  * il livello: un contatto trovato già aperto al riavvio del runner non fa
7910
7922
  * registrare.
7911
7923
  */
7912
- sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
7913
- /**
7914
- * La camera registra per tutta la durata del SEGNALE che lei stessa
7915
- * pubblica — la cap `recording-signal` (`active: true` mentre il device è in
7916
- * funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
7917
- * resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
7918
- * caduta, così una pulizia di quaranta minuti è UNA clip.
7919
- *
7920
- * Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
7921
- * suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
7922
- * riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
7923
- * segnale mai abbassato (un evento perso) non può tenere aperta una
7924
- * registrazione (D11). Vedi `recorder/addon/band-decision.ts`
7925
- * (`holdTrigger` / `releaseTrigger`).
7926
- */
7927
- deviceSignal: boolean().optional()
7924
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7928
7925
  });
7929
7926
  /**
7930
7927
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -7954,13 +7951,28 @@ var RecordingBandSchema = object({
7954
7951
  end: string().regex(HHMM),
7955
7952
  mode: RecordingBandModeSchema,
7956
7953
  triggers: RecordingBandTriggersSchema.optional(),
7954
+ /**
7955
+ * RETIRED (D381). A band no longer carries a pre-buffer of its own.
7956
+ *
7957
+ * It was the retroactive KEEP bound — which already-written segments survive
7958
+ * a trigger — and it had to be at least as wide as the widest pre-roll the
7959
+ * broker could serve, or the gate would delete the seconds the ring had just
7960
+ * handed the writer. That "at least as wide as" is the tell: it was a second
7961
+ * expression of the broker's retention, in different units, in a different
7962
+ * addon, with an invariant the operator had to maintain by hand. The keep
7963
+ * bound is now derived from the one prebuffer ceiling and there is nothing
7964
+ * left to configure here.
7965
+ *
7966
+ * The key survives in the SHAPE so a config written before that record still
7967
+ * parses and can be migrated deliberately — `RecordingBandSchema` is not
7968
+ * strict, so simply deleting it would strip an operator's value in silence on
7969
+ * the next save (the failure D380 came one commit from shipping). Nothing
7970
+ * reads it: {@link stripRetiredBandPreBufferSec} removes it on load.
7971
+ */
7957
7972
  preBufferSec: number().min(0).optional(),
7958
7973
  postBufferSec: number().min(0).optional()
7959
7974
  });
7960
- ({
7961
- preBufferSec: 15,
7962
- postBufferSec: 30
7963
- }).postBufferSec * 1e3;
7975
+ ({ postBufferSec: 30 }).postBufferSec * 1e3;
7964
7976
  /**
7965
7977
  * Per-device retention overrides. Every field is optional; an unset or `0`
7966
7978
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -8008,8 +8020,29 @@ var RecordingConfigSchema = object({
8008
8020
  * "off" is the absence of a covering band, never a band value.
8009
8021
  */
8010
8022
  bands: array(RecordingBandSchema).default([]),
8023
+ /**
8024
+ * THE device-decided intent: record for as long as the camera itself raises
8025
+ * `recording-signal` (`active: true` while the device is in function — a
8026
+ * robot that cleans). AUTHORED, unlike `mode`, and the only authored
8027
+ * recording intent that is not a band.
8028
+ *
8029
+ * It carries NO schedule on purpose. A band is an HOUR, and this feature has
8030
+ * no hour to program: the device decides. What it costs the operator is one
8031
+ * flag — "this camera can record on its own" — and what it buys is the same
8032
+ * hold/release the recorder already implements (D371, `holdTrigger` /
8033
+ * `releaseTrigger`): the window opens on the rise, stays open for the whole
8034
+ * job however long it is, and closes one pad after the fall.
8035
+ *
8036
+ * EXCLUSIVE with `bands` (below): two authorities deciding when the same
8037
+ * camera records is the D62 failure. `off` remains `enabled: false`, so an
8038
+ * operator switching this camera off is REPORTED off, never as broken.
8039
+ */
8040
+ deviceDecision: boolean().optional(),
8011
8041
  retention: RecordingRetentionSchema.optional()
8012
- }).strict();
8042
+ }).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
8043
+ message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
8044
+ path: ["bands"]
8045
+ });
8013
8046
  /**
8014
8047
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
8015
8048
  *
@@ -21025,11 +21058,7 @@ var CameraAudioStatusSchema = object({
21025
21058
  });
21026
21059
  /** Recording block — null when no recording cap is active for this device. */
21027
21060
  var CameraRecordingStatusSchema = object({
21028
- mode: _enum([
21029
- "off",
21030
- "continuous",
21031
- "events"
21032
- ]),
21061
+ mode: RecordingStorageModeSchema,
21033
21062
  active: boolean(),
21034
21063
  storageBytes: number()
21035
21064
  });
@@ -29300,11 +29329,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
29300
29329
  var RecordingStatusSchema = object({
29301
29330
  deviceId: number(),
29302
29331
  enabled: boolean(),
29303
- activeMode: _enum([
29304
- "off",
29305
- "continuous",
29306
- "events"
29307
- ]),
29332
+ /** THE derived storage mode, from the one definition
29333
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
29334
+ * `on-device-decision` could have reached the recorder and not the status. */
29335
+ activeMode: RecordingStorageModeSchema,
29308
29336
  nodeId: string(),
29309
29337
  storageBytes: number()
29310
29338
  });
package/dist/addon.mjs CHANGED
@@ -7848,17 +7848,29 @@ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
7848
7848
  /**
7849
7849
  * DERIVED per-camera storage summary — the single field cheap consumers read
7850
7850
  * (the viewer's status dot, the camera list) instead of walking `bands`:
7851
- * - `off` — no band covers the camera (or it is disabled).
7852
- * - `events` — every band records around triggers only.
7853
- * - `continuous` — at least one band records continuously.
7854
- *
7855
- * NEVER authored: the recorder stamps it from the authoritative `bands` on
7856
- * every save (`activeModeForConfig`). Writing it has no effect.
7851
+ * - `off` — no band covers the camera (or it is disabled).
7852
+ * - `events` — every band records around triggers only.
7853
+ * - `continuous` — at least one band records continuously.
7854
+ * - `on-device-decision`— the DEVICE decides: recording runs for as long as the
7855
+ * camera raises its own `recording-signal` level (a robot that cleans). There
7856
+ * is no schedule to author, because there is no hour to program — see
7857
+ * {@link RecordingConfigSchema}`.deviceDecision`.
7858
+ *
7859
+ * NEVER authored: the recorder stamps it from the authoritative intent
7860
+ * (`bands` + `deviceDecision`) on every save (`activeModeForConfig`). Writing it
7861
+ * has no effect.
7862
+ *
7863
+ * `on-device-decision` is named for WHO decides, not for how the recording is
7864
+ * requested. `on-demand` was rejected: in this repo's vocabulary a "demand" is
7865
+ * something the operator makes (the live gate is the recorder's own "demand
7866
+ * window"), and a knob whose name suggests the operator starts it while the
7867
+ * device actually does is the D62 shape — a control nobody can predict.
7857
7868
  */
7858
7869
  var RecordingStorageModeSchema = _enum([
7859
7870
  "off",
7860
7871
  "events",
7861
- "continuous"
7872
+ "continuous",
7873
+ "on-device-decision"
7862
7874
  ]);
7863
7875
  /**
7864
7876
  * Le macro classi che possono aprire una finestra di registrazione — le stesse
@@ -7908,22 +7920,7 @@ var RecordingTriggersSchema = object({
7908
7920
  * il livello: un contatto trovato già aperto al riavvio del runner non fa
7909
7921
  * registrare.
7910
7922
  */
7911
- sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
7912
- /**
7913
- * La camera registra per tutta la durata del SEGNALE che lei stessa
7914
- * pubblica — la cap `recording-signal` (`active: true` mentre il device è in
7915
- * funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
7916
- * resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
7917
- * caduta, così una pulizia di quaranta minuti è UNA clip.
7918
- *
7919
- * Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
7920
- * suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
7921
- * riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
7922
- * segnale mai abbassato (un evento perso) non può tenere aperta una
7923
- * registrazione (D11). Vedi `recorder/addon/band-decision.ts`
7924
- * (`holdTrigger` / `releaseTrigger`).
7925
- */
7926
- deviceSignal: boolean().optional()
7923
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
7927
7924
  });
7928
7925
  /**
7929
7926
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -7953,13 +7950,28 @@ var RecordingBandSchema = object({
7953
7950
  end: string().regex(HHMM),
7954
7951
  mode: RecordingBandModeSchema,
7955
7952
  triggers: RecordingBandTriggersSchema.optional(),
7953
+ /**
7954
+ * RETIRED (D381). A band no longer carries a pre-buffer of its own.
7955
+ *
7956
+ * It was the retroactive KEEP bound — which already-written segments survive
7957
+ * a trigger — and it had to be at least as wide as the widest pre-roll the
7958
+ * broker could serve, or the gate would delete the seconds the ring had just
7959
+ * handed the writer. That "at least as wide as" is the tell: it was a second
7960
+ * expression of the broker's retention, in different units, in a different
7961
+ * addon, with an invariant the operator had to maintain by hand. The keep
7962
+ * bound is now derived from the one prebuffer ceiling and there is nothing
7963
+ * left to configure here.
7964
+ *
7965
+ * The key survives in the SHAPE so a config written before that record still
7966
+ * parses and can be migrated deliberately — `RecordingBandSchema` is not
7967
+ * strict, so simply deleting it would strip an operator's value in silence on
7968
+ * the next save (the failure D380 came one commit from shipping). Nothing
7969
+ * reads it: {@link stripRetiredBandPreBufferSec} removes it on load.
7970
+ */
7956
7971
  preBufferSec: number().min(0).optional(),
7957
7972
  postBufferSec: number().min(0).optional()
7958
7973
  });
7959
- ({
7960
- preBufferSec: 15,
7961
- postBufferSec: 30
7962
- }).postBufferSec * 1e3;
7974
+ ({ postBufferSec: 30 }).postBufferSec * 1e3;
7963
7975
  /**
7964
7976
  * Per-device retention overrides. Every field is optional; an unset or `0`
7965
7977
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -8007,8 +8019,29 @@ var RecordingConfigSchema = object({
8007
8019
  * "off" is the absence of a covering band, never a band value.
8008
8020
  */
8009
8021
  bands: array(RecordingBandSchema).default([]),
8022
+ /**
8023
+ * THE device-decided intent: record for as long as the camera itself raises
8024
+ * `recording-signal` (`active: true` while the device is in function — a
8025
+ * robot that cleans). AUTHORED, unlike `mode`, and the only authored
8026
+ * recording intent that is not a band.
8027
+ *
8028
+ * It carries NO schedule on purpose. A band is an HOUR, and this feature has
8029
+ * no hour to program: the device decides. What it costs the operator is one
8030
+ * flag — "this camera can record on its own" — and what it buys is the same
8031
+ * hold/release the recorder already implements (D371, `holdTrigger` /
8032
+ * `releaseTrigger`): the window opens on the rise, stays open for the whole
8033
+ * job however long it is, and closes one pad after the fall.
8034
+ *
8035
+ * EXCLUSIVE with `bands` (below): two authorities deciding when the same
8036
+ * camera records is the D62 failure. `off` remains `enabled: false`, so an
8037
+ * operator switching this camera off is REPORTED off, never as broken.
8038
+ */
8039
+ deviceDecision: boolean().optional(),
8010
8040
  retention: RecordingRetentionSchema.optional()
8011
- }).strict();
8041
+ }).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
8042
+ message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
8043
+ path: ["bands"]
8044
+ });
8012
8045
  /**
8013
8046
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
8014
8047
  *
@@ -21024,11 +21057,7 @@ var CameraAudioStatusSchema = object({
21024
21057
  });
21025
21058
  /** Recording block — null when no recording cap is active for this device. */
21026
21059
  var CameraRecordingStatusSchema = object({
21027
- mode: _enum([
21028
- "off",
21029
- "continuous",
21030
- "events"
21031
- ]),
21060
+ mode: RecordingStorageModeSchema,
21032
21061
  active: boolean(),
21033
21062
  storageBytes: number()
21034
21063
  });
@@ -29299,11 +29328,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
29299
29328
  var RecordingStatusSchema = object({
29300
29329
  deviceId: number(),
29301
29330
  enabled: boolean(),
29302
- activeMode: _enum([
29303
- "off",
29304
- "continuous",
29305
- "events"
29306
- ]),
29331
+ /** THE derived storage mode, from the one definition
29332
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
29333
+ * `on-device-decision` could have reached the recorder and not the status. */
29334
+ activeMode: RecordingStorageModeSchema,
29307
29335
  nodeId: string(),
29308
29336
  storageBytes: number()
29309
29337
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-unifi",
3
- "version": "0.2.75",
3
+ "version": "0.2.77",
4
4
  "description": "UniFi Network controller device-provider addon for CamStack — local-controller infra switches/APs (as containers) + network-client presence. NO cameras/Protect.",
5
5
  "keywords": [
6
6
  "camstack",