@camstack/addon-remote-storage 1.2.11 → 1.2.13

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.
@@ -7213,8 +7213,31 @@ var AdoptionJobSchema = object({
7213
7213
  error: string().nullable()
7214
7214
  });
7215
7215
  /**
7216
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7217
- * pipeline functions an operator thinks in terms of.
7216
+ * Per-camera FUNCTION SWITCHES.
7217
+ *
7218
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7219
+ *
7220
+ * This file shipped as "the one coherent on/off surface over the pipeline
7221
+ * functions an operator thinks in terms of". The operator's verdict on
7222
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7223
+ * every function already had a settings page of its own, and a second place to
7224
+ * turn it off is a second place to look. Each switch is going back to its own
7225
+ * component's original options — detection to the detection-pipeline wrapper
7226
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7227
+ * (which was always first-class; the switch was a veneer over
7228
+ * `recording.setDeviceConfig`), notifications to a notification-center
7229
+ * per-device setting, the two camera planes to their own components.
7230
+ *
7231
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7232
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7233
+ * straight from the authorities with no group in the middle. That rule was
7234
+ * never about a control panel.
7235
+ *
7236
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7237
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7238
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7239
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7240
+ * stop; nothing new may be built on it.
7218
7241
  *
7219
7242
  * ## This file adds no state
7220
7243
  *
@@ -7559,14 +7582,21 @@ var RecordingConfigSchema = object({
7559
7582
  /**
7560
7583
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7561
7584
  *
7562
- * One shape shared by the recorder's `relocateFootage` (segments) and
7563
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7564
- * page renders both movers with one component. Jobs are in-RAM (a restart
7565
- * forgets them re-running is safe by construction: copy-if-absent, delete
7566
- * after verify) and each completed/failed run also lands one durable ops-log
7567
- * row on the owning addon's surface.
7585
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7586
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7587
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7588
+ * Each completed/failed run also lands one durable ops-log row on its owning
7589
+ * addon surface.
7590
+ */
7591
+ /**
7592
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7593
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7594
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7595
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7596
+ * runs at all.
7568
7597
  */
7569
7598
  var RelocateJobStateSchema = _enum([
7599
+ "queued",
7570
7600
  "running",
7571
7601
  "done",
7572
7602
  "failed",
@@ -7591,19 +7621,109 @@ var RelocateJobSchema = object({
7591
7621
  finishedAt: number().nullable(),
7592
7622
  error: string().nullable()
7593
7623
  });
7624
+ /** Profile-derived footage selection used only by the migration coordinator:
7625
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7626
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7594
7627
  var RelocateFootageInputSchema = object({
7595
- deviceId: number().optional(),
7596
7628
  fromLocationId: string(),
7597
7629
  toLocationId: string(),
7598
7630
  entities: array(_enum(["segments"])).optional(),
7631
+ /** Limits relocation to the logical profile class. Omit only for the
7632
+ * pre-orchestration compatibility path. */
7633
+ footageClass: RelocateFootageClassSchema.optional(),
7634
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7635
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7636
+ * unit is a (camera, profile) pile, not a disk. */
7637
+ deviceId: number().int().optional(),
7638
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7639
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7640
+ * placement plan assigns those two independently, so a rebalance that could
7641
+ * only say "recordings" would move footage the plan never asked to move. */
7642
+ profiles: array(string()).optional(),
7599
7643
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7600
7644
  * never allowed to starve live writers. */
7601
7645
  throttleMbps: number().min(1).max(1e3).optional()
7602
7646
  });
7603
- var RelocateMediaInputSchema = object({
7604
- deviceId: number().optional(),
7647
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7648
+ * from persistent recording settings: a migration never changes
7649
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7650
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
7651
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
7652
+ var StorageMigrationMediaMoveInputSchema = object({
7605
7653
  toLocationId: string(),
7606
7654
  throttleMbps: number().min(1).max(1e3).optional()
7655
+ }).extend({ leaseId: string().min(1) });
7656
+ /** The independently selectable logical storage classes. `recordings`
7657
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7658
+ * segments; `eventMedia` is post-analysis blobs. */
7659
+ var StorageMigrationClassSchema = _enum([
7660
+ "recordings",
7661
+ "recordingsLow",
7662
+ "eventMedia"
7663
+ ]);
7664
+ /** A destination is always an existing, fully-qualified location id. The
7665
+ * migration API intentionally never changes a source location's `basePath`:
7666
+ * callers create a new `<type>:<slug>` location, then select it here. */
7667
+ var StorageMigrationDestinationsSchema = object({
7668
+ recordings: string().min(1).optional(),
7669
+ recordingsLow: string().min(1).optional(),
7670
+ eventMedia: string().min(1).optional()
7671
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7672
+ /** Shared input for planning and starting an orchestrated storage migration. */
7673
+ var StorageMigrationInputSchema = object({
7674
+ destinations: StorageMigrationDestinationsSchema,
7675
+ throttleMbps: number().min(1).max(1e3).optional()
7676
+ });
7677
+ /** The durable coordinator state machine. The only phase that changes default
7678
+ * locations is `repointing`, after every selected mover has completed and been
7679
+ * verified. */
7680
+ var StorageMigrationPhaseSchema = _enum([
7681
+ "planning",
7682
+ "pausing",
7683
+ "moving",
7684
+ "verifying",
7685
+ "repointing",
7686
+ "refreshing",
7687
+ "resuming",
7688
+ "done",
7689
+ "failed",
7690
+ "cancelled"
7691
+ ]);
7692
+ var StorageMigrationParticipantSchema = _enum([
7693
+ "pipeline",
7694
+ "recorder",
7695
+ "analytics"
7696
+ ]);
7697
+ var StorageMigrationMoveSchema = object({
7698
+ storageClass: StorageMigrationClassSchema,
7699
+ fromLocationId: string(),
7700
+ toLocationId: string(),
7701
+ moverJobId: string().nullable(),
7702
+ state: RelocateJobStateSchema.nullable(),
7703
+ error: string().nullable()
7704
+ });
7705
+ var StorageMigrationJobSchema = object({
7706
+ jobId: string(),
7707
+ phase: StorageMigrationPhaseSchema,
7708
+ destinations: StorageMigrationDestinationsSchema,
7709
+ throttleMbps: number(),
7710
+ moves: array(StorageMigrationMoveSchema),
7711
+ pauseLeaseId: string().nullable(),
7712
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7713
+ repointed: boolean(),
7714
+ cancelRequested: boolean(),
7715
+ startedAt: number(),
7716
+ updatedAt: number(),
7717
+ finishedAt: number().nullable(),
7718
+ error: string().nullable()
7719
+ });
7720
+ var StorageMigrationPlanSchema = object({
7721
+ destinations: StorageMigrationDestinationsSchema,
7722
+ moves: array(object({
7723
+ storageClass: StorageMigrationClassSchema,
7724
+ fromLocationId: string(),
7725
+ toLocationId: string()
7726
+ }))
7607
7727
  });
7608
7728
  /**
7609
7729
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7655,6 +7775,21 @@ var StorageLocationSchema = object({
7655
7775
  nodeId: string().optional(),
7656
7776
  isDefault: boolean().default(false),
7657
7777
  isSystem: boolean().default(false),
7778
+ /**
7779
+ * Operator opt-in: whether consumers that BALANCE across several locations
7780
+ * of a type may write here. Recordings reads it today; event media and
7781
+ * backups are the next consumers, which is why the flag lives on the
7782
+ * location rather than in any one addon's store — nothing has to be
7783
+ * extended to add the next consumer.
7784
+ *
7785
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7786
+ * flag existed reads back with no flag and keeps working exactly as before;
7787
+ * that is the whole compat story, and it is why no migration ships with it.
7788
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7789
+ * disk must not silently start writing to it); the default of a type is
7790
+ * always stamped `true`.
7791
+ */
7792
+ enabled: boolean().optional(),
7658
7793
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7659
7794
  * for node-local locations it can reach) — never persisted, absent when the
7660
7795
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -11957,7 +12092,8 @@ method(object({
11957
12092
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
11958
12093
  /**
11959
12094
  * filesystem-browse — per-node capability for browsing the node's local
11960
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12095
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12096
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
11961
12097
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
11962
12098
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
11963
12099
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -13770,6 +13906,13 @@ var MaskGridDimsSchema = object({
13770
13906
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
13771
13907
  * this one field keeps the schema additive — a rule still declares exactly
13772
13908
  * one trigger.
13909
+ *
13910
+ * AUDIO rules add no member here, for the reason occupancy added none: the
13911
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
13912
+ * mirror.ts` fails the build on a member the app cannot render) and every
13913
+ * member costs a release train. A sustained-sound rule is therefore an
13914
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
13915
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
13773
13916
  */
13774
13917
  var NcDeliverySchema = _enum([
13775
13918
  "immediate",
@@ -13784,15 +13927,32 @@ var NcDeliverySchema = _enum([
13784
13927
  * depend on a provider's raw event name or payload shape.
13785
13928
  */
13786
13929
  var NcSystemEventKindSchema = _enum([
13787
- "camera-online",
13788
- "camera-offline",
13930
+ "device-online",
13931
+ "device-offline",
13932
+ "device-disabled",
13933
+ "device-enabled",
13789
13934
  "stream-online",
13790
13935
  "stream-offline",
13791
13936
  "node-online",
13792
13937
  "node-offline",
13793
13938
  "addon-update-available",
13794
- "server-update-available"
13939
+ "server-update-available",
13940
+ "alarm-triggered",
13941
+ "alarm-armed",
13942
+ "alarm-disarmed",
13943
+ "camera-online",
13944
+ "camera-offline",
13945
+ "camera-disabled",
13946
+ "camera-enabled"
13947
+ ]);
13948
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
13949
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
13950
+ "camera-online",
13951
+ "camera-offline",
13952
+ "camera-disabled",
13953
+ "camera-enabled"
13795
13954
  ]);
13955
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
13796
13956
  /**
13797
13957
  * One coherent system-event condition. `kinds` is the required opt-in safety
13798
13958
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -13801,6 +13961,18 @@ var NcSystemEventKindSchema = _enum([
13801
13961
  var NcSystemEventConditionSchema = object({
13802
13962
  kinds: array(NcSystemEventKindSchema).min(1),
13803
13963
  deviceIds: array(number().int()).min(1).optional(),
13964
+ /**
13965
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
13966
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
13967
+ * is what a liveness rule means when nobody said otherwise.
13968
+ *
13969
+ * This is where "only my cameras" is expressed, and it lives on the rule for
13970
+ * one reason: the intake cannot know which devices this household cares
13971
+ * about, and a producer-side filter is one no operator can change. Fails
13972
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
13973
+ * does not carry) matches no `deviceTypes` list.
13974
+ */
13975
+ deviceTypes: array(string().min(1)).min(1).optional(),
13804
13976
  nodeIds: array(string().min(1)).min(1).optional(),
13805
13977
  packageNames: array(string().min(1)).min(1).optional()
13806
13978
  });
@@ -13851,6 +14023,47 @@ var NcOccupancyConditionSchema = object({
13851
14023
  sustainSeconds: number().int().min(0).max(3600).default(15)
13852
14024
  });
13853
14025
  /**
14026
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14027
+ *
14028
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14029
+ * reference notifier uses, so an operator moving between them re-uses what
14030
+ * they already know): a rule matches when, over a sampling window of
14031
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14032
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14033
+ *
14034
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14035
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14036
+ * - `labels` — the classifier put at least one of these labels on it.
14037
+ *
14038
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14039
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14040
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14041
+ * is given** — a window in which every sample is trivially a hit would fire on
14042
+ * silence, so the engine refuses such a condition rather than notifying on
14043
+ * nothing (the schema cannot express "at least one of" without becoming a
14044
+ * ZodEffects the cap path would have to special-case).
14045
+ *
14046
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14047
+ * must be FULL before it can match — a window that has been open for two
14048
+ * seconds of its ten is 100% of nothing, and firing on it would make
14049
+ * `samplingSeconds` decorative.
14050
+ *
14051
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14052
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14053
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14054
+ * an operator who typed `dog` mean the same thing.
14055
+ */
14056
+ var NcAudioConditionSchema = object({
14057
+ /** Audio macro labels; absent = any sound (level-only rule). */
14058
+ labels: array(string().min(1)).min(1).optional(),
14059
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14060
+ dbThreshold: number().min(-96).max(0).optional(),
14061
+ /** Percentage of the window's samples that must be hits (1–100). */
14062
+ hitPercent: number().int().min(1).max(100).default(60),
14063
+ /** Length of the sampling window in seconds. */
14064
+ samplingSeconds: number().int().min(1).max(300).default(10)
14065
+ });
14066
+ /**
13854
14067
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
13855
14068
  *
13856
14069
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14123,7 +14336,33 @@ var NcConditionsSchema = object({
14123
14336
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14124
14337
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14125
14338
  */
14126
- occupancy: NcOccupancyConditionSchema.optional()
14339
+ occupancy: NcOccupancyConditionSchema.optional(),
14340
+ /**
14341
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14342
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14343
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14344
+ * a window that is not full yet, neither filter given). See
14345
+ * {@link NcAudioCondition}.
14346
+ *
14347
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14348
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14349
+ * a detection, a track or a device event (the same fail-closed pairing
14350
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14351
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14352
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14353
+ * classified sample) stays exactly as it was for rules that already use it.
14354
+ *
14355
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14356
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14357
+ * (`camstack/src/data/notification-center.ts`, guarded by
14358
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14359
+ * condition fields it does not know when a rule is saved from the phone.
14360
+ * Publishing an editor for a condition the app cannot round-trip is how an
14361
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14362
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14363
+ * does an audio rule become authorable.
14364
+ */
14365
+ audio: NcAudioConditionSchema.optional()
14127
14366
  });
14128
14367
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14129
14368
  var NcRuleTargetSchema = object({
@@ -14237,6 +14476,73 @@ var NcThrottleSchema = object({
14237
14476
  */
14238
14477
  granularity: NcThrottleGranularitySchema.optional()
14239
14478
  });
14479
+ /**
14480
+ * How long the confirm gate may hold ONE notification, and how big the picture
14481
+ * it judges may be.
14482
+ *
14483
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14484
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14485
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14486
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14487
+ * tokens for pixels the model pools away.
14488
+ */
14489
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14490
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14491
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14492
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14493
+ var NcConfirmExpectSchema = object({
14494
+ op: _enum([
14495
+ ">=",
14496
+ ">",
14497
+ "<=",
14498
+ "<",
14499
+ "=="
14500
+ ]),
14501
+ count: number().int().min(0).max(1e3)
14502
+ });
14503
+ /**
14504
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14505
+ * to ship and says whether it agrees with the rule.
14506
+ *
14507
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14508
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14509
+ * on the operator's phone is not a verdict about this notification.
14510
+ *
14511
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14512
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14513
+ * the default and every fail-open is COUNTED, because a gate that always fails
14514
+ * open looks in the log exactly like a gate that works.
14515
+ *
14516
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14517
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14518
+ * production failures in one day), so the gate reads absent as the constant
14519
+ * above rather than trusting a parse it may never have seen.
14520
+ */
14521
+ var NcConfirmSchema = object({
14522
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14523
+ * same thing, and both mean "deliver exactly as before". */
14524
+ enabled: boolean().default(false),
14525
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14526
+ profileId: string().optional(),
14527
+ /**
14528
+ * The operator's question, in his own words. Absent = a question derived
14529
+ * from the rule (its class and its expectation).
14530
+ *
14531
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14532
+ * banners, signage and plates as instructions if you let them reach the
14533
+ * prompt — proven live — so the authoritative contract stays in the system
14534
+ * turn and only rule-authored words land here.
14535
+ */
14536
+ prompt: string().max(1e3).optional(),
14537
+ /** Fire only when the model's count satisfies this. Absent = the model's
14538
+ * own boolean verdict decides. */
14539
+ expect: NcConfirmExpectSchema.optional(),
14540
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14541
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14542
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14543
+ /** Longest edge the judged image is downscaled to before it is sent. */
14544
+ maxImagePx: number().int().min(64).max(2048).default(448)
14545
+ });
14240
14546
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14241
14547
  var NcRuleInputSchema = object({
14242
14548
  name: string().min(1).max(200),
@@ -14297,7 +14603,13 @@ var NcRuleInputSchema = object({
14297
14603
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14298
14604
  * shape as every other actuation.
14299
14605
  */
14300
- actions: NcRuleActionsSchema.optional()
14606
+ actions: NcRuleActionsSchema.optional(),
14607
+ /**
14608
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14609
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14610
+ * did, and absent is the only way to say that without a migration.
14611
+ */
14612
+ confirm: NcConfirmSchema.optional()
14301
14613
  });
14302
14614
  /**
14303
14615
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14308,7 +14620,37 @@ var NcRuleInputSchema = object({
14308
14620
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14309
14621
  * `updateRule` patch.
14310
14622
  */
14311
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14623
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14624
+ disabledTargetIds: array(string()).optional(),
14625
+ /**
14626
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14627
+ *
14628
+ * It makes the key optional to SUPPLY; the parse still materialises the
14629
+ * default when the key is absent. And `NcRuleStore.update` merges with
14630
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14631
+ * one — which made every partial edit destructive:
14632
+ *
14633
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14634
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14635
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14636
+ *
14637
+ * A rule scoped to one camera and one zone silently became a rule that
14638
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14639
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14640
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
14641
+ * within a minute of a two-field patch.
14642
+ *
14643
+ * So every defaulted field is re-declared here WITHOUT its default. The
14644
+ * inner defaults still apply when the caller DOES send the key — `{}` for
14645
+ * conditions remains a real instruction ("clear them") — and only the
14646
+ * absent key is now genuinely absent.
14647
+ */
14648
+ enabled: boolean().optional(),
14649
+ conditions: NcConditionsSchema.optional(),
14650
+ media: NcMediaPolicySchema.optional(),
14651
+ throttle: NcThrottleSchema.optional(),
14652
+ priority: number().int().min(1).max(5).optional()
14653
+ });
14312
14654
  /** A persisted rule. */
14313
14655
  var NcRuleSchema = NcRuleInputSchema.extend({
14314
14656
  id: string(),
@@ -14609,6 +14951,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14609
14951
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14610
14952
  * copy would lie the first time a rule is disabled.
14611
14953
  */
14954
+ /**
14955
+ * Why a device a mode NAMES is nonetheless not armed by it.
14956
+ *
14957
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
14958
+ * per-camera notification switch the Notification Center already owns,
14959
+ * `detection-off` is the device's own detection binding being inactive, and
14960
+ * `offline` is the device manager's liveness. A fourth reason would mean a
14961
+ * fourth authority, and inventing one here is how a panel starts disagreeing
14962
+ * with the switches the operator actually used.
14963
+ */
14964
+ var NcAlarmSkipReasonSchema = _enum([
14965
+ "muted",
14966
+ "detection-off",
14967
+ "offline"
14968
+ ]);
14969
+ var NcAlarmSkippedDeviceSchema = object({
14970
+ deviceId: number().int(),
14971
+ reason: NcAlarmSkipReasonSchema
14972
+ });
14612
14973
  var NcAlarmModeCoverageSchema = object({
14613
14974
  mode: AlarmArmModeSchema,
14614
14975
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14616,7 +14977,18 @@ var NcAlarmModeCoverageSchema = object({
14616
14977
  /** At least one covering rule has no device scope, so the mode covers all. */
14617
14978
  allDevices: boolean(),
14618
14979
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14619
- deviceIds: array(number().int())
14980
+ deviceIds: array(number().int()),
14981
+ /**
14982
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
14983
+ * excludes it.
14984
+ *
14985
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
14986
+ * twelve makes it false in exactly the way nobody notices until an incident.
14987
+ * Defaulted to `[]` so a coverage answer computed before this field existed
14988
+ * still parses as "nothing known to be skipped" rather than failing the whole
14989
+ * alarm tab.
14990
+ */
14991
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14620
14992
  });
14621
14993
  var NcAlarmConfigSchema = object({
14622
14994
  /**
@@ -15979,13 +16351,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
15979
16351
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
15980
16352
  kind: "mutation",
15981
16353
  auth: "admin"
15982
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
16354
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
15983
16355
  kind: "mutation",
15984
16356
  auth: "admin"
15985
- }), method(object({}), array(RelocateJobSchema).readonly(), {
15986
- kind: "query",
16357
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16358
+ kind: "mutation",
15987
16359
  auth: "admin"
15988
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16360
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16361
+ kind: "mutation",
16362
+ auth: "admin"
16363
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
16364
+ kind: "mutation",
16365
+ auth: "admin"
16366
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
15989
16367
  kind: "mutation",
15990
16368
  auth: "admin"
15991
16369
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17409,9 +17787,16 @@ var CameraStatusSchema = object({
17409
17787
  audio: CameraAudioStatusSchema.nullable(),
17410
17788
  recording: CameraRecordingStatusSchema.nullable(),
17411
17789
  /**
17412
- * Per-camera function switches an OPERATOR has turned off
17790
+ * Per-camera functions an OPERATOR has turned off
17413
17791
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17414
17792
  *
17793
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
17794
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
17795
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
17796
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
17797
+ * The badge outlives the control panel: the panel was a convenience, this is
17798
+ * the difference between a camera being off and a camera being dead.
17799
+ *
17415
17800
  * This is the difference between DISABLED and BROKEN. A camera whose
17416
17801
  * `detection` block reports zero fps and whose `switchedOff` contains
17417
17802
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17482,7 +17867,13 @@ var NodeInferenceDevicesSchema = object({
17482
17867
  reachable: boolean(),
17483
17868
  devices: array(NodeInferenceDeviceSchema).readonly()
17484
17869
  });
17485
- method(object({
17870
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
17871
+ kind: "mutation",
17872
+ auth: "admin"
17873
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
17874
+ kind: "mutation",
17875
+ auth: "admin"
17876
+ }), method(object({
17486
17877
  deviceId: number(),
17487
17878
  agentNodeId: string()
17488
17879
  }), object({ success: literal(true) }), {
@@ -18156,6 +18547,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
18156
18547
  locationId: string(),
18157
18548
  targetBytes: number().int().positive()
18158
18549
  }), EvictResultSchema, { kind: "mutation" });
18550
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
18551
+ kind: "mutation",
18552
+ auth: "admin"
18553
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
18554
+ kind: "mutation",
18555
+ auth: "admin"
18556
+ });
18159
18557
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18160
18558
  providerId: string().min(1),
18161
18559
  displayName: string().min(1),
@@ -18304,6 +18702,28 @@ var TerminalProfileInfoSchema = object({
18304
18702
  label: string(),
18305
18703
  description: string().optional()
18306
18704
  });
18705
+ /**
18706
+ * A durable operator-created Terminal instance. Profiles are templates; only
18707
+ * an instance declares a camera.
18708
+ */
18709
+ var TerminalInstanceInfoSchema = object({
18710
+ instanceId: string(),
18711
+ cameraStableId: string(),
18712
+ nodeId: string(),
18713
+ profileId: string(),
18714
+ profileLabel: string(),
18715
+ name: string(),
18716
+ enabled: boolean()
18717
+ });
18718
+ var TerminalLegacyCameraSchema = object({
18719
+ stableId: string(),
18720
+ nodeId: string(),
18721
+ profileId: string(),
18722
+ profileLabel: string(),
18723
+ name: string(),
18724
+ /** Only legacy monitor cameras can retain their historic stable identity. */
18725
+ adoptable: boolean()
18726
+ });
18307
18727
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18308
18728
  seq: number().int().positive(),
18309
18729
  kind: literal("data"),
@@ -18320,7 +18740,29 @@ var TerminalOutputBatchSchema = object({
18320
18740
  snapshot: string().optional(),
18321
18741
  events: array(TerminalOutputEventSchema).readonly()
18322
18742
  });
18323
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18743
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
18744
+ targetNodeId: string().min(1),
18745
+ profileId: string().min(1),
18746
+ name: string().trim().min(1).max(160).optional()
18747
+ }), TerminalInstanceInfoSchema, {
18748
+ kind: "mutation",
18749
+ auth: "admin"
18750
+ }), method(object({ instanceId: string().min(1) }), _void(), {
18751
+ kind: "mutation",
18752
+ auth: "admin"
18753
+ }), method(object({
18754
+ instanceId: string().min(1),
18755
+ enabled: boolean()
18756
+ }), TerminalInstanceInfoSchema, {
18757
+ kind: "mutation",
18758
+ auth: "admin"
18759
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
18760
+ stableId: string().min(1),
18761
+ name: string().trim().min(1).max(160).optional()
18762
+ }), TerminalInstanceInfoSchema, {
18763
+ kind: "mutation",
18764
+ auth: "admin"
18765
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18324
18766
  profileId: string(),
18325
18767
  cols: number().int().positive(),
18326
18768
  rows: number().int().positive()
@@ -18337,7 +18779,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18337
18779
  }), method(object({
18338
18780
  sessionId: string(),
18339
18781
  afterSeq: number().int().nonnegative(),
18340
- waitMs: number().int().min(0).max(2e3).default(0)
18782
+ waitMs: number().int().min(0).max(2e3).default(0),
18783
+ /**
18784
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
18785
+ * browser's initial repaint remains immediate; the camera snapshot
18786
+ * relay uses it to avoid encoding a blank startup frame.
18787
+ */
18788
+ waitForOutput: boolean().optional()
18341
18789
  }), TerminalOutputBatchSchema, {
18342
18790
  kind: "mutation",
18343
18791
  auth: "admin",
@@ -20278,6 +20726,7 @@ var FaceInfoSchema = object({
20278
20726
  var FaceFilterEnum = _enum([
20279
20727
  "unassigned",
20280
20728
  "recognized",
20729
+ "identified",
20281
20730
  "all"
20282
20731
  ]);
20283
20732
  var MediaFileLiteSchema$1 = object({
@@ -20306,6 +20755,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
20306
20755
  kind: "mutation",
20307
20756
  auth: "admin"
20308
20757
  }), method(object({
20758
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
20759
+ deviceId: number().int().optional(),
20309
20760
  limit: number().int().positive().optional(),
20310
20761
  filter: FaceFilterEnum.optional(),
20311
20762
  /**
@@ -22071,6 +22522,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
22071
22522
  capName: string().min(1).max(64),
22072
22523
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
22073
22524
  valuePath: string().min(1).max(64)
22525
+ }),
22526
+ object({
22527
+ kind: literal("latest-recognition"),
22528
+ recognition: _enum(["person", "plate"])
22074
22529
  })
22075
22530
  ]);
22076
22531
  var OsdSlotBindingSchema = object({
@@ -22176,6 +22631,15 @@ method(object({ deviceId: number().int() }), object({
22176
22631
  }), object({ success: literal(true) }), {
22177
22632
  kind: "mutation",
22178
22633
  auth: "admin"
22634
+ }), method(object({
22635
+ sourceDeviceId: number().int(),
22636
+ targetDeviceId: number().int()
22637
+ }), object({
22638
+ copied: number().int().nonnegative(),
22639
+ skipped: number().int().nonnegative()
22640
+ }), {
22641
+ kind: "mutation",
22642
+ auth: "admin"
22179
22643
  }), method(object({
22180
22644
  deviceId: number().int(),
22181
22645
  slotId: string().min(1),
@@ -22886,7 +23350,19 @@ var RecordingManifestSchema = object({
22886
23350
  * profiles/subtrees/locations on this node). */
22887
23351
  var RecordingDeviceUsageSchema = object({
22888
23352
  deviceId: number(),
22889
- usedBytes: number()
23353
+ usedBytes: number(),
23354
+ /**
23355
+ * Start of this camera's OLDEST indexed segment, across every profile and
23356
+ * location — the "Oldest footage" column in Recordings → Storage, and the
23357
+ * only honest answer to "is retention actually holding?" per camera.
23358
+ *
23359
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
23360
+ * predates this field omits it entirely, and a hub whose types carry the
23361
+ * field must keep validating that older provider's payload: the framework
23362
+ * (types) and the addon ship on different trains, and the addon is usually
23363
+ * the later of the two.
23364
+ */
23365
+ oldestMs: number().nullable().optional()
22890
23366
  });
22891
23367
  /** Recording storage usage + capacity for one storage location. */
22892
23368
  var RecordingLocationUsageSchema = object({
@@ -22914,6 +23390,57 @@ var RecordingStorageUsageSchema = object({
22914
23390
  locations: array(RecordingLocationUsageSchema)
22915
23391
  });
22916
23392
  /**
23393
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
23394
+ *
23395
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
23396
+ * is the operator asking for the EXISTING archive to be brought into line with
23397
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
23398
+ * location, run FIFO behind the single-flight mover.
23399
+ *
23400
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
23401
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
23402
+ * (empty on the plan).
23403
+ */
23404
+ var RecordingRebalanceMoveSchema = object({
23405
+ deviceId: number(),
23406
+ profile: string(),
23407
+ fromLocationId: string(),
23408
+ toLocationId: string(),
23409
+ bytes: number(),
23410
+ files: number().int()
23411
+ });
23412
+ /** Why a pile that is out of place is staying there. Every refusal is
23413
+ * reported: a rebalance that silently drops a camera reads exactly like one
23414
+ * that had nothing to do. */
23415
+ var RecordingRebalanceSkipReasonSchema = _enum([
23416
+ "unassigned",
23417
+ "target-not-writable",
23418
+ "below-threshold",
23419
+ "no-headroom"
23420
+ ]);
23421
+ var RecordingRebalanceSkipSchema = object({
23422
+ deviceId: number(),
23423
+ profile: string(),
23424
+ fromLocationId: string(),
23425
+ /** The location the plan wants; null when the camera has no assignment. */
23426
+ toLocationId: string().nullable(),
23427
+ bytes: number(),
23428
+ reason: RecordingRebalanceSkipReasonSchema
23429
+ });
23430
+ var RecordingRebalancePlanSchema = object({
23431
+ moves: array(RecordingRebalanceMoveSchema),
23432
+ skipped: array(RecordingRebalanceSkipSchema),
23433
+ bytesToMove: number(),
23434
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
23435
+ jobIds: array(string())
23436
+ });
23437
+ var RecordingRebalanceInputSchema = object({
23438
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
23439
+ throttleMbps: number().min(1).max(1e3).optional(),
23440
+ /** Ignore piles smaller than this (default 1 GB). */
23441
+ minMoveGb: number().min(0).optional()
23442
+ });
23443
+ /**
22917
23444
  * Result of locating footage at a wall-clock instant for one device/profile.
22918
23445
  * `segment` carries the covering segment's window; `gap` reports the forward
22919
23446
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -23061,6 +23588,21 @@ method(object({
23061
23588
  }), {
23062
23589
  kind: "mutation",
23063
23590
  auth: "admin"
23591
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
23592
+ kind: "mutation",
23593
+ auth: "admin"
23594
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
23595
+ kind: "mutation",
23596
+ auth: "admin"
23597
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
23598
+ kind: "mutation",
23599
+ auth: "admin"
23600
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
23601
+ kind: "mutation",
23602
+ auth: "admin"
23603
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23604
+ kind: "mutation",
23605
+ auth: "admin"
23064
23606
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
23065
23607
  kind: "mutation",
23066
23608
  auth: "admin"
@@ -23070,9 +23612,15 @@ method(object({
23070
23612
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23071
23613
  kind: "mutation",
23072
23614
  auth: "admin"
23615
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23616
+ kind: "query",
23617
+ auth: "admin"
23618
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23619
+ kind: "mutation",
23620
+ auth: "admin"
23073
23621
  });
23074
23622
  /**
23075
- * `recordingExport` cap — render a footage time range into a single downloadable
23623
+ * `recording-export` cap — render a footage time range into a single downloadable
23076
23624
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
23077
23625
  * bounded lifetime with a durable history, auto-expiry, and optional
23078
23626
  * delete-after-download.
@@ -23087,10 +23635,42 @@ method(object({
23087
23635
  */
23088
23636
  /** Playback-speed multiplier for the render (1 = realtime). */
23089
23637
  var ExportSpeedSchema = number().min(.25).max(32);
23638
+ /**
23639
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23640
+ *
23641
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
23642
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23643
+ * playlist. Handing it absolute epochs would make every call site responsible
23644
+ * for the same subtraction, and the one that forgot would emit a filter that
23645
+ * selects nothing — silently, as a uniform timelapse.
23646
+ */
23647
+ var ExportDenseRangeSchema = object({
23648
+ fromSec: number().nonnegative(),
23649
+ toSec: number().nonnegative()
23650
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
23651
+ /**
23652
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
23653
+ * listed ranges and at the base `everyMs` everywhere else.
23654
+ *
23655
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
23656
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
23657
+ */
23658
+ var ExportDenseSchema = object({
23659
+ everyMs: number().int().positive(),
23660
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
23661
+ });
23090
23662
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
23091
23663
  var ExportTimelapseSchema = object({
23092
23664
  everyMs: number().int().positive(),
23093
- outputFps: number().int().min(1).max(60).optional()
23665
+ outputFps: number().int().min(1).max(60).optional(),
23666
+ /** Optional second, FASTER rate over the intervals that matter. */
23667
+ dense: ExportDenseSchema.optional()
23668
+ }).superRefine((v, ctx) => {
23669
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
23670
+ code: ZodIssueCode.custom,
23671
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
23672
+ path: ["dense", "everyMs"]
23673
+ });
23094
23674
  });
23095
23675
  /**
23096
23676
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -23148,6 +23728,19 @@ var ExportDownloadSchema = object({
23148
23728
  url: string(),
23149
23729
  endpoints: array(string())
23150
23730
  });
23731
+ /**
23732
+ * A finished export's bytes, inline.
23733
+ *
23734
+ * `bytes` is the DECODED length — the number the caller bounds and logs
23735
+ * against, so nobody has to infer it from the base64 length.
23736
+ */
23737
+ var ExportBytesSchema = object({
23738
+ base64: string(),
23739
+ contentType: string(),
23740
+ /** Suggested filename, extension included. */
23741
+ name: string(),
23742
+ bytes: number().int().nonnegative()
23743
+ });
23151
23744
  method(object({
23152
23745
  deviceId: number(),
23153
23746
  profile: string(),
@@ -23172,6 +23765,9 @@ method(object({
23172
23765
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
23173
23766
  kind: "query",
23174
23767
  auth: "protected"
23768
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
23769
+ kind: "query",
23770
+ auth: "protected"
23175
23771
  });
23176
23772
  /**
23177
23773
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -27189,6 +27785,12 @@ Object.freeze({
27189
27785
  addonId: null,
27190
27786
  access: "delete"
27191
27787
  },
27788
+ "osdManager.copyDeviceConfiguration": {
27789
+ capName: "osd-manager",
27790
+ capScope: "system",
27791
+ addonId: null,
27792
+ access: "create"
27793
+ },
27192
27794
  "osdManager.getConditionSupport": {
27193
27795
  capName: "osd-manager",
27194
27796
  capScope: "system",
@@ -27285,7 +27887,7 @@ Object.freeze({
27285
27887
  addonId: null,
27286
27888
  access: "create"
27287
27889
  },
27288
- "pipelineAnalytics.cancelMediaRelocate": {
27890
+ "pipelineAnalytics.cancelStorageMigrationMove": {
27289
27891
  capName: "pipeline-analytics",
27290
27892
  capScope: "device",
27291
27893
  addonId: null,
@@ -27357,12 +27959,6 @@ Object.freeze({
27357
27959
  addonId: null,
27358
27960
  access: "view"
27359
27961
  },
27360
- "pipelineAnalytics.getMediaRelocateStatus": {
27361
- capName: "pipeline-analytics",
27362
- capScope: "device",
27363
- addonId: null,
27364
- access: "view"
27365
- },
27366
27962
  "pipelineAnalytics.getMotionEvents": {
27367
27963
  capName: "pipeline-analytics",
27368
27964
  capScope: "device",
@@ -27399,6 +27995,12 @@ Object.freeze({
27399
27995
  addonId: null,
27400
27996
  access: "view"
27401
27997
  },
27998
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
27999
+ capName: "pipeline-analytics",
28000
+ capScope: "device",
28001
+ addonId: null,
28002
+ access: "view"
28003
+ },
27402
28004
  "pipelineAnalytics.getTrack": {
27403
28005
  capName: "pipeline-analytics",
27404
28006
  capScope: "device",
@@ -27477,6 +28079,12 @@ Object.freeze({
27477
28079
  addonId: null,
27478
28080
  access: "view"
27479
28081
  },
28082
+ "pipelineAnalytics.pauseForStorageMigration": {
28083
+ capName: "pipeline-analytics",
28084
+ capScope: "device",
28085
+ addonId: null,
28086
+ access: "create"
28087
+ },
27480
28088
  "pipelineAnalytics.proposeRetrainAnnotations": {
27481
28089
  capName: "pipeline-analytics",
27482
28090
  capScope: "device",
@@ -27507,7 +28115,7 @@ Object.freeze({
27507
28115
  addonId: null,
27508
28116
  access: "create"
27509
28117
  },
27510
- "pipelineAnalytics.relocateMedia": {
28118
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
27511
28119
  capName: "pipeline-analytics",
27512
28120
  capScope: "device",
27513
28121
  addonId: null,
@@ -27519,6 +28127,12 @@ Object.freeze({
27519
28127
  addonId: null,
27520
28128
  access: "create"
27521
28129
  },
28130
+ "pipelineAnalytics.resumeForStorageMigration": {
28131
+ capName: "pipeline-analytics",
28132
+ capScope: "device",
28133
+ addonId: null,
28134
+ access: "create"
28135
+ },
27522
28136
  "pipelineAnalytics.saveRetrainAnnotations": {
27523
28137
  capName: "pipeline-analytics",
27524
28138
  capScope: "device",
@@ -27543,6 +28157,12 @@ Object.freeze({
27543
28157
  addonId: null,
27544
28158
  access: "create"
27545
28159
  },
28160
+ "pipelineAnalytics.startStorageMigrationMove": {
28161
+ capName: "pipeline-analytics",
28162
+ capScope: "device",
28163
+ addonId: null,
28164
+ access: "create"
28165
+ },
27546
28166
  "pipelineAnalytics.wipeAllAnalytics": {
27547
28167
  capName: "pipeline-analytics",
27548
28168
  capScope: "device",
@@ -27909,6 +28529,12 @@ Object.freeze({
27909
28529
  addonId: null,
27910
28530
  access: "view"
27911
28531
  },
28532
+ "pipelineOrchestrator.pauseForStorageMigration": {
28533
+ capName: "pipeline-orchestrator",
28534
+ capScope: "system",
28535
+ addonId: null,
28536
+ access: "create"
28537
+ },
27912
28538
  "pipelineOrchestrator.rebalance": {
27913
28539
  capName: "pipeline-orchestrator",
27914
28540
  capScope: "system",
@@ -27933,6 +28559,12 @@ Object.freeze({
27933
28559
  addonId: null,
27934
28560
  access: "view"
27935
28561
  },
28562
+ "pipelineOrchestrator.resumeForStorageMigration": {
28563
+ capName: "pipeline-orchestrator",
28564
+ capScope: "system",
28565
+ addonId: null,
28566
+ access: "create"
28567
+ },
27936
28568
  "pipelineOrchestrator.saveTemplate": {
27937
28569
  capName: "pipeline-orchestrator",
27938
28570
  capScope: "system",
@@ -28329,7 +28961,13 @@ Object.freeze({
28329
28961
  addonId: null,
28330
28962
  access: "create"
28331
28963
  },
28332
- "recording.cancelRelocate": {
28964
+ "recording.cancelRelocateJob": {
28965
+ capName: "recording",
28966
+ capScope: "system",
28967
+ addonId: null,
28968
+ access: "create"
28969
+ },
28970
+ "recording.cancelStorageMigrationMove": {
28333
28971
  capName: "recording",
28334
28972
  capScope: "system",
28335
28973
  addonId: null,
@@ -28365,7 +29003,7 @@ Object.freeze({
28365
29003
  addonId: null,
28366
29004
  access: "view"
28367
29005
  },
28368
- "recording.getRelocateStatus": {
29006
+ "recording.getStorageMigrationMoveStatus": {
28369
29007
  capName: "recording",
28370
29008
  capScope: "system",
28371
29009
  addonId: null,
@@ -28383,12 +29021,30 @@ Object.freeze({
28383
29021
  addonId: null,
28384
29022
  access: "view"
28385
29023
  },
29024
+ "recording.listRelocateJobs": {
29025
+ capName: "recording",
29026
+ capScope: "system",
29027
+ addonId: null,
29028
+ access: "view"
29029
+ },
28386
29030
  "recording.locateSegment": {
28387
29031
  capName: "recording",
28388
29032
  capScope: "system",
28389
29033
  addonId: null,
28390
29034
  access: "view"
28391
29035
  },
29036
+ "recording.pauseForStorageMigration": {
29037
+ capName: "recording",
29038
+ capScope: "system",
29039
+ addonId: null,
29040
+ access: "create"
29041
+ },
29042
+ "recording.planStorageRebalance": {
29043
+ capName: "recording",
29044
+ capScope: "system",
29045
+ addonId: null,
29046
+ access: "view"
29047
+ },
28392
29048
  "recording.pruneFootage": {
28393
29049
  capName: "recording",
28394
29050
  capScope: "system",
@@ -28407,6 +29063,12 @@ Object.freeze({
28407
29063
  addonId: null,
28408
29064
  access: "view"
28409
29065
  },
29066
+ "recording.refreshStorageLocationsForMigration": {
29067
+ capName: "recording",
29068
+ capScope: "system",
29069
+ addonId: null,
29070
+ access: "create"
29071
+ },
28410
29072
  "recording.relocateFootage": {
28411
29073
  capName: "recording",
28412
29074
  capScope: "system",
@@ -28431,44 +29093,68 @@ Object.freeze({
28431
29093
  addonId: null,
28432
29094
  access: "create"
28433
29095
  },
29096
+ "recording.resumeForStorageMigration": {
29097
+ capName: "recording",
29098
+ capScope: "system",
29099
+ addonId: null,
29100
+ access: "create"
29101
+ },
28434
29102
  "recording.setDeviceConfig": {
28435
29103
  capName: "recording",
28436
29104
  capScope: "system",
28437
29105
  addonId: null,
28438
29106
  access: "create"
28439
29107
  },
29108
+ "recording.startStorageMigrationMove": {
29109
+ capName: "recording",
29110
+ capScope: "system",
29111
+ addonId: null,
29112
+ access: "create"
29113
+ },
29114
+ "recording.startStorageRebalance": {
29115
+ capName: "recording",
29116
+ capScope: "system",
29117
+ addonId: null,
29118
+ access: "create"
29119
+ },
28440
29120
  "recordingExport.cancelExport": {
28441
- capName: "recordingExport",
29121
+ capName: "recording-export",
28442
29122
  capScope: "system",
28443
29123
  addonId: null,
28444
29124
  access: "create"
28445
29125
  },
28446
29126
  "recordingExport.createExport": {
28447
- capName: "recordingExport",
29127
+ capName: "recording-export",
28448
29128
  capScope: "system",
28449
29129
  addonId: null,
28450
29130
  access: "create"
28451
29131
  },
28452
29132
  "recordingExport.deleteExport": {
28453
- capName: "recordingExport",
29133
+ capName: "recording-export",
28454
29134
  capScope: "system",
28455
29135
  addonId: null,
28456
29136
  access: "delete"
28457
29137
  },
28458
29138
  "recordingExport.getDownloadUrl": {
28459
- capName: "recordingExport",
29139
+ capName: "recording-export",
28460
29140
  capScope: "system",
28461
29141
  addonId: null,
28462
29142
  access: "view"
28463
29143
  },
28464
29144
  "recordingExport.getExport": {
28465
- capName: "recordingExport",
29145
+ capName: "recording-export",
28466
29146
  capScope: "system",
28467
29147
  addonId: null,
28468
29148
  access: "view"
28469
29149
  },
28470
29150
  "recordingExport.listExports": {
28471
- capName: "recordingExport",
29151
+ capName: "recording-export",
29152
+ capScope: "system",
29153
+ addonId: null,
29154
+ access: "view"
29155
+ },
29156
+ "recordingExport.readExportBytes": {
29157
+ capName: "recording-export",
28472
29158
  capScope: "system",
28473
29159
  addonId: null,
28474
29160
  access: "view"
@@ -28827,6 +29513,30 @@ Object.freeze({
28827
29513
  addonId: null,
28828
29514
  access: "view"
28829
29515
  },
29516
+ "storageMigration.cancel": {
29517
+ capName: "storage-migration",
29518
+ capScope: "system",
29519
+ addonId: null,
29520
+ access: "create"
29521
+ },
29522
+ "storageMigration.plan": {
29523
+ capName: "storage-migration",
29524
+ capScope: "system",
29525
+ addonId: null,
29526
+ access: "view"
29527
+ },
29528
+ "storageMigration.start": {
29529
+ capName: "storage-migration",
29530
+ capScope: "system",
29531
+ addonId: null,
29532
+ access: "create"
29533
+ },
29534
+ "storageMigration.status": {
29535
+ capName: "storage-migration",
29536
+ capScope: "system",
29537
+ addonId: null,
29538
+ access: "view"
29539
+ },
28830
29540
  "storageProvider.abortUpload": {
28831
29541
  capName: "storage-provider",
28832
29542
  capScope: "system",
@@ -29205,12 +29915,42 @@ Object.freeze({
29205
29915
  addonId: null,
29206
29916
  access: "create"
29207
29917
  },
29918
+ "terminalSession.adoptLegacyMonitor": {
29919
+ capName: "terminal-session",
29920
+ capScope: "system",
29921
+ addonId: null,
29922
+ access: "create"
29923
+ },
29208
29924
  "terminalSession.close": {
29209
29925
  capName: "terminal-session",
29210
29926
  capScope: "system",
29211
29927
  addonId: null,
29212
29928
  access: "create"
29213
29929
  },
29930
+ "terminalSession.createInstance": {
29931
+ capName: "terminal-session",
29932
+ capScope: "system",
29933
+ addonId: null,
29934
+ access: "create"
29935
+ },
29936
+ "terminalSession.deleteInstance": {
29937
+ capName: "terminal-session",
29938
+ capScope: "system",
29939
+ addonId: null,
29940
+ access: "delete"
29941
+ },
29942
+ "terminalSession.listInstances": {
29943
+ capName: "terminal-session",
29944
+ capScope: "system",
29945
+ addonId: null,
29946
+ access: "view"
29947
+ },
29948
+ "terminalSession.listLegacyCameras": {
29949
+ capName: "terminal-session",
29950
+ capScope: "system",
29951
+ addonId: null,
29952
+ access: "view"
29953
+ },
29214
29954
  "terminalSession.listProfiles": {
29215
29955
  capName: "terminal-session",
29216
29956
  capScope: "system",
@@ -29241,6 +29981,12 @@ Object.freeze({
29241
29981
  addonId: null,
29242
29982
  access: "create"
29243
29983
  },
29984
+ "terminalSession.setInstanceEnabled": {
29985
+ capName: "terminal-session",
29986
+ capScope: "system",
29987
+ addonId: null,
29988
+ access: "create"
29989
+ },
29244
29990
  "terminalSession.writeInput": {
29245
29991
  capName: "terminal-session",
29246
29992
  capScope: "system",
@@ -29785,6 +30531,104 @@ var FramerateField = number().int().min(1).max(60);
29785
30531
  var TargetsField = array(NcRuleTargetSchema).min(1);
29786
30532
  var PriorityField = number().int().min(1).max(5);
29787
30533
  /**
30534
+ * Explicit override of the DENSE sampling cadence, seconds.
30535
+ *
30536
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
30537
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
30538
+ * made that same base 3 s and rendered a person pass as two frames.)
30539
+ *
30540
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
30541
+ * `denseCadenceSec` and played at `framerate` occupies
30542
+ *
30543
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
30544
+ *
30545
+ * so a 7 s pass at 1 s / 12 fps is 0.58 s of video, and at 0.5 s it is 1.17 s.
30546
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
30547
+ * and therefore the length of a quiet night, does not move.
30548
+ *
30549
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
30550
+ * the recording has them returns the same frames, requested twice. Must be
30551
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
30552
+ * a uniform video the operator believes is two-rate — and upsert refuses it
30553
+ * rather than letting the export cap reject the render hours after the window.
30554
+ */
30555
+ var DenseCadenceSecField = number().min(.1).max(3600);
30556
+ /**
30557
+ * Minimum seconds of OUTPUT video each detection range must occupy.
30558
+ *
30559
+ * The operator-facing form of the arithmetic above: instead of solving for a
30560
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
30561
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
30562
+ * that range every ~583 ms.
30563
+ *
30564
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
30565
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
30566
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
30567
+ * ranges are sampled denser than they need. Per-range cadences require a cap
30568
+ * schema change and are the tracked follow-up.
30569
+ *
30570
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
30571
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
30572
+ * by real footage, never met by duplicating frames into motion that never
30573
+ * happened.
30574
+ */
30575
+ var MinDwellSecField = number().min(0).max(60);
30576
+ /**
30577
+ * Caption burned into the notification's preview frame.
30578
+ *
30579
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
30580
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
30581
+ * templating dialect for one field would be a second thing to explain.
30582
+ *
30583
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
30584
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
30585
+ * the reason this is not `.min(1)`.
30586
+ */
30587
+ var PreviewTextField = string().max(200);
30588
+ /**
30589
+ * Whether the notification's preview is a STILL or a short animation.
30590
+ *
30591
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
30592
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
30593
+ * night reads better as three seconds of motion than as one frame of it. Both
30594
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
30595
+ * simply applies it to a dozen frames sampled across the render and assembles
30596
+ * them.
30597
+ *
30598
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
30599
+ * seeks and a palette pass, and no rule that never asked for one should start
30600
+ * paying that on the deploy that shipped it.
30601
+ *
30602
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
30603
+ */
30604
+ var PreviewModeField = _enum(["image", "gif"]);
30605
+ /**
30606
+ * Which detection classes the notification reports counts for.
30607
+ *
30608
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
30609
+ * plan — no second query — aggregated per class. Absent or empty means "every
30610
+ * class the window actually contained", which is what an operator who never
30611
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
30612
+ * counts cars all night).
30613
+ *
30614
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
30615
+ * …). An unknown name simply never matches and reports nothing — it is not an
30616
+ * error, because a rule may legitimately name a class this camera's model does
30617
+ * not emit.
30618
+ *
30619
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
30620
+ * - `{{detections}}` — total over the reported classes
30621
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
30622
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
30623
+ * one per class, `count_` + the class name
30624
+ *
30625
+ * With NO custom body template the summary is appended to the derived body, and
30626
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
30627
+ * reads. With a custom template the operator owns every word — nothing is
30628
+ * appended, so `{{detectionSummary}}` is how he asks for it.
30629
+ */
30630
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
30631
+ /**
29788
30632
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
29789
30633
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
29790
30634
  * here (see the ownership note above).
@@ -29804,9 +30648,30 @@ var TimelapseRuleInputSchema = object({
29804
30648
  cadenceSec: CadenceSecField.default(15),
29805
30649
  /** Output frames per second of the assembled mp4 (predecessor parity). */
29806
30650
  framerate: FramerateField.default(10),
30651
+ /**
30652
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
30653
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
30654
+ * field gets.
30655
+ */
30656
+ denseCadenceSec: DenseCadenceSecField.optional(),
30657
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
30658
+ minDwellSec: MinDwellSecField.optional(),
29807
30659
  /** `notification-output` targets the finished video/thumbnail is sent to. */
29808
30660
  targets: TargetsField,
29809
30661
  template: TimelapseTemplateSchema.optional(),
30662
+ /**
30663
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
30664
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
30665
+ *
30666
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
30667
+ * the notification's title/body, and clearing it (`template: null`) must not
30668
+ * silently clear the caption too.
30669
+ */
30670
+ previewText: PreviewTextField.optional(),
30671
+ /** Still or animation — see {@link PreviewModeField}. */
30672
+ previewMode: PreviewModeField.default("image"),
30673
+ /** Classes the notification counts — see {@link ReportClassesField}. */
30674
+ reportClasses: ReportClassesField.optional(),
29810
30675
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
29811
30676
  priority: PriorityField.default(3)
29812
30677
  });
@@ -29817,8 +30682,13 @@ object({
29817
30682
  schedule: NcScheduleSchema.optional(),
29818
30683
  cadenceSec: CadenceSecField.optional(),
29819
30684
  framerate: FramerateField.optional(),
30685
+ denseCadenceSec: DenseCadenceSecField.optional(),
30686
+ minDwellSec: MinDwellSecField.optional(),
29820
30687
  targets: TargetsField.optional(),
29821
30688
  template: TimelapseTemplateSchema.nullable().optional(),
30689
+ previewText: PreviewTextField.optional(),
30690
+ previewMode: PreviewModeField.optional(),
30691
+ reportClasses: ReportClassesField.optional(),
29822
30692
  priority: PriorityField.optional()
29823
30693
  });
29824
30694
  TimelapseRuleInputSchema.extend({
@@ -29830,10 +30700,28 @@ TimelapseRuleInputSchema.extend({
29830
30700
  */
29831
30701
  ownerUserId: string().optional(),
29832
30702
  /**
29833
- * Epoch-ms of the last successful generation the 1-hour re-generation
29834
- * guard's durable state (predecessor parity). Absent = never generated.
30703
+ * Epoch-ms of the NEWEST successful generation across every camera of this
30704
+ * rule. What a UI shows, and the compatibility floor for
30705
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
29835
30706
  */
29836
30707
  lastGeneratedAt: number().optional(),
30708
+ /**
30709
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
30710
+ * re-generation guard's real durable state.
30711
+ *
30712
+ * One rule covers several cameras and each renders its own video, so a rule
30713
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
30714
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
30715
+ * already done — and B's night is gone for good, because the window will not
30716
+ * come back.
30717
+ *
30718
+ * ADDITIVE, so the migration is free: a row written before this field simply
30719
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
30720
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
30721
+ * "never generated" would re-render and re-notify every camera of every rule
30722
+ * once, on the deploy that shipped the map.
30723
+ */
30724
+ generatedByDevice: record(string(), number()).optional(),
29837
30725
  /** userId of the caller who created the rule (server-stamped). */
29838
30726
  createdBy: string(),
29839
30727
  createdAt: number(),