@camstack/addon-smtp-nodemailer 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.
@@ -7226,8 +7226,31 @@ var AdoptionJobSchema = object({
7226
7226
  error: string().nullable()
7227
7227
  });
7228
7228
  /**
7229
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7230
- * pipeline functions an operator thinks in terms of.
7229
+ * Per-camera FUNCTION SWITCHES.
7230
+ *
7231
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7232
+ *
7233
+ * This file shipped as "the one coherent on/off surface over the pipeline
7234
+ * functions an operator thinks in terms of". The operator's verdict on
7235
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7236
+ * every function already had a settings page of its own, and a second place to
7237
+ * turn it off is a second place to look. Each switch is going back to its own
7238
+ * component's original options — detection to the detection-pipeline wrapper
7239
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7240
+ * (which was always first-class; the switch was a veneer over
7241
+ * `recording.setDeviceConfig`), notifications to a notification-center
7242
+ * per-device setting, the two camera planes to their own components.
7243
+ *
7244
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7245
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7246
+ * straight from the authorities with no group in the middle. That rule was
7247
+ * never about a control panel.
7248
+ *
7249
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7250
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7251
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7252
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7253
+ * stop; nothing new may be built on it.
7231
7254
  *
7232
7255
  * ## This file adds no state
7233
7256
  *
@@ -7572,14 +7595,21 @@ var RecordingConfigSchema = object({
7572
7595
  /**
7573
7596
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7574
7597
  *
7575
- * One shape shared by the recorder's `relocateFootage` (segments) and
7576
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7577
- * page renders both movers with one component. Jobs are in-RAM (a restart
7578
- * forgets them re-running is safe by construction: copy-if-absent, delete
7579
- * after verify) and each completed/failed run also lands one durable ops-log
7580
- * row on the owning addon's surface.
7598
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7599
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7600
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7601
+ * Each completed/failed run also lands one durable ops-log row on its owning
7602
+ * addon surface.
7603
+ */
7604
+ /**
7605
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7606
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7607
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7608
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7609
+ * runs at all.
7581
7610
  */
7582
7611
  var RelocateJobStateSchema = _enum([
7612
+ "queued",
7583
7613
  "running",
7584
7614
  "done",
7585
7615
  "failed",
@@ -7604,19 +7634,109 @@ var RelocateJobSchema = object({
7604
7634
  finishedAt: number().nullable(),
7605
7635
  error: string().nullable()
7606
7636
  });
7637
+ /** Profile-derived footage selection used only by the migration coordinator:
7638
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7639
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7607
7640
  var RelocateFootageInputSchema = object({
7608
- deviceId: number().optional(),
7609
7641
  fromLocationId: string(),
7610
7642
  toLocationId: string(),
7611
7643
  entities: array(_enum(["segments"])).optional(),
7644
+ /** Limits relocation to the logical profile class. Omit only for the
7645
+ * pre-orchestration compatibility path. */
7646
+ footageClass: RelocateFootageClassSchema.optional(),
7647
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7648
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7649
+ * unit is a (camera, profile) pile, not a disk. */
7650
+ deviceId: number().int().optional(),
7651
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7652
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7653
+ * placement plan assigns those two independently, so a rebalance that could
7654
+ * only say "recordings" would move footage the plan never asked to move. */
7655
+ profiles: array(string()).optional(),
7612
7656
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7613
7657
  * never allowed to starve live writers. */
7614
7658
  throttleMbps: number().min(1).max(1e3).optional()
7615
7659
  });
7616
- var RelocateMediaInputSchema = object({
7617
- deviceId: number().optional(),
7660
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7661
+ * from persistent recording settings: a migration never changes
7662
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7663
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
7664
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
7665
+ var StorageMigrationMediaMoveInputSchema = object({
7618
7666
  toLocationId: string(),
7619
7667
  throttleMbps: number().min(1).max(1e3).optional()
7668
+ }).extend({ leaseId: string().min(1) });
7669
+ /** The independently selectable logical storage classes. `recordings`
7670
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7671
+ * segments; `eventMedia` is post-analysis blobs. */
7672
+ var StorageMigrationClassSchema = _enum([
7673
+ "recordings",
7674
+ "recordingsLow",
7675
+ "eventMedia"
7676
+ ]);
7677
+ /** A destination is always an existing, fully-qualified location id. The
7678
+ * migration API intentionally never changes a source location's `basePath`:
7679
+ * callers create a new `<type>:<slug>` location, then select it here. */
7680
+ var StorageMigrationDestinationsSchema = object({
7681
+ recordings: string().min(1).optional(),
7682
+ recordingsLow: string().min(1).optional(),
7683
+ eventMedia: string().min(1).optional()
7684
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7685
+ /** Shared input for planning and starting an orchestrated storage migration. */
7686
+ var StorageMigrationInputSchema = object({
7687
+ destinations: StorageMigrationDestinationsSchema,
7688
+ throttleMbps: number().min(1).max(1e3).optional()
7689
+ });
7690
+ /** The durable coordinator state machine. The only phase that changes default
7691
+ * locations is `repointing`, after every selected mover has completed and been
7692
+ * verified. */
7693
+ var StorageMigrationPhaseSchema = _enum([
7694
+ "planning",
7695
+ "pausing",
7696
+ "moving",
7697
+ "verifying",
7698
+ "repointing",
7699
+ "refreshing",
7700
+ "resuming",
7701
+ "done",
7702
+ "failed",
7703
+ "cancelled"
7704
+ ]);
7705
+ var StorageMigrationParticipantSchema = _enum([
7706
+ "pipeline",
7707
+ "recorder",
7708
+ "analytics"
7709
+ ]);
7710
+ var StorageMigrationMoveSchema = object({
7711
+ storageClass: StorageMigrationClassSchema,
7712
+ fromLocationId: string(),
7713
+ toLocationId: string(),
7714
+ moverJobId: string().nullable(),
7715
+ state: RelocateJobStateSchema.nullable(),
7716
+ error: string().nullable()
7717
+ });
7718
+ var StorageMigrationJobSchema = object({
7719
+ jobId: string(),
7720
+ phase: StorageMigrationPhaseSchema,
7721
+ destinations: StorageMigrationDestinationsSchema,
7722
+ throttleMbps: number(),
7723
+ moves: array(StorageMigrationMoveSchema),
7724
+ pauseLeaseId: string().nullable(),
7725
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7726
+ repointed: boolean(),
7727
+ cancelRequested: boolean(),
7728
+ startedAt: number(),
7729
+ updatedAt: number(),
7730
+ finishedAt: number().nullable(),
7731
+ error: string().nullable()
7732
+ });
7733
+ var StorageMigrationPlanSchema = object({
7734
+ destinations: StorageMigrationDestinationsSchema,
7735
+ moves: array(object({
7736
+ storageClass: StorageMigrationClassSchema,
7737
+ fromLocationId: string(),
7738
+ toLocationId: string()
7739
+ }))
7620
7740
  });
7621
7741
  /**
7622
7742
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7668,6 +7788,21 @@ var StorageLocationSchema = object({
7668
7788
  nodeId: string().optional(),
7669
7789
  isDefault: boolean().default(false),
7670
7790
  isSystem: boolean().default(false),
7791
+ /**
7792
+ * Operator opt-in: whether consumers that BALANCE across several locations
7793
+ * of a type may write here. Recordings reads it today; event media and
7794
+ * backups are the next consumers, which is why the flag lives on the
7795
+ * location rather than in any one addon's store — nothing has to be
7796
+ * extended to add the next consumer.
7797
+ *
7798
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7799
+ * flag existed reads back with no flag and keeps working exactly as before;
7800
+ * that is the whole compat story, and it is why no migration ships with it.
7801
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7802
+ * disk must not silently start writing to it); the default of a type is
7803
+ * always stamped `true`.
7804
+ */
7805
+ enabled: boolean().optional(),
7671
7806
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7672
7807
  * for node-local locations it can reach) — never persisted, absent when the
7673
7808
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -11970,7 +12105,8 @@ method(object({
11970
12105
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
11971
12106
  /**
11972
12107
  * filesystem-browse — per-node capability for browsing the node's local
11973
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12108
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12109
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
11974
12110
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
11975
12111
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
11976
12112
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -13783,6 +13919,13 @@ var MaskGridDimsSchema = object({
13783
13919
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
13784
13920
  * this one field keeps the schema additive — a rule still declares exactly
13785
13921
  * one trigger.
13922
+ *
13923
+ * AUDIO rules add no member here, for the reason occupancy added none: the
13924
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
13925
+ * mirror.ts` fails the build on a member the app cannot render) and every
13926
+ * member costs a release train. A sustained-sound rule is therefore an
13927
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
13928
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
13786
13929
  */
13787
13930
  var NcDeliverySchema = _enum([
13788
13931
  "immediate",
@@ -13797,15 +13940,32 @@ var NcDeliverySchema = _enum([
13797
13940
  * depend on a provider's raw event name or payload shape.
13798
13941
  */
13799
13942
  var NcSystemEventKindSchema = _enum([
13800
- "camera-online",
13801
- "camera-offline",
13943
+ "device-online",
13944
+ "device-offline",
13945
+ "device-disabled",
13946
+ "device-enabled",
13802
13947
  "stream-online",
13803
13948
  "stream-offline",
13804
13949
  "node-online",
13805
13950
  "node-offline",
13806
13951
  "addon-update-available",
13807
- "server-update-available"
13952
+ "server-update-available",
13953
+ "alarm-triggered",
13954
+ "alarm-armed",
13955
+ "alarm-disarmed",
13956
+ "camera-online",
13957
+ "camera-offline",
13958
+ "camera-disabled",
13959
+ "camera-enabled"
13960
+ ]);
13961
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
13962
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
13963
+ "camera-online",
13964
+ "camera-offline",
13965
+ "camera-disabled",
13966
+ "camera-enabled"
13808
13967
  ]);
13968
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
13809
13969
  /**
13810
13970
  * One coherent system-event condition. `kinds` is the required opt-in safety
13811
13971
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -13814,6 +13974,18 @@ var NcSystemEventKindSchema = _enum([
13814
13974
  var NcSystemEventConditionSchema = object({
13815
13975
  kinds: array(NcSystemEventKindSchema).min(1),
13816
13976
  deviceIds: array(number().int()).min(1).optional(),
13977
+ /**
13978
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
13979
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
13980
+ * is what a liveness rule means when nobody said otherwise.
13981
+ *
13982
+ * This is where "only my cameras" is expressed, and it lives on the rule for
13983
+ * one reason: the intake cannot know which devices this household cares
13984
+ * about, and a producer-side filter is one no operator can change. Fails
13985
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
13986
+ * does not carry) matches no `deviceTypes` list.
13987
+ */
13988
+ deviceTypes: array(string().min(1)).min(1).optional(),
13817
13989
  nodeIds: array(string().min(1)).min(1).optional(),
13818
13990
  packageNames: array(string().min(1)).min(1).optional()
13819
13991
  });
@@ -13864,6 +14036,47 @@ var NcOccupancyConditionSchema = object({
13864
14036
  sustainSeconds: number().int().min(0).max(3600).default(15)
13865
14037
  });
13866
14038
  /**
14039
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14040
+ *
14041
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14042
+ * reference notifier uses, so an operator moving between them re-uses what
14043
+ * they already know): a rule matches when, over a sampling window of
14044
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14045
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14046
+ *
14047
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14048
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14049
+ * - `labels` — the classifier put at least one of these labels on it.
14050
+ *
14051
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14052
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14053
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14054
+ * is given** — a window in which every sample is trivially a hit would fire on
14055
+ * silence, so the engine refuses such a condition rather than notifying on
14056
+ * nothing (the schema cannot express "at least one of" without becoming a
14057
+ * ZodEffects the cap path would have to special-case).
14058
+ *
14059
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14060
+ * must be FULL before it can match — a window that has been open for two
14061
+ * seconds of its ten is 100% of nothing, and firing on it would make
14062
+ * `samplingSeconds` decorative.
14063
+ *
14064
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14065
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14066
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14067
+ * an operator who typed `dog` mean the same thing.
14068
+ */
14069
+ var NcAudioConditionSchema = object({
14070
+ /** Audio macro labels; absent = any sound (level-only rule). */
14071
+ labels: array(string().min(1)).min(1).optional(),
14072
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14073
+ dbThreshold: number().min(-96).max(0).optional(),
14074
+ /** Percentage of the window's samples that must be hits (1–100). */
14075
+ hitPercent: number().int().min(1).max(100).default(60),
14076
+ /** Length of the sampling window in seconds. */
14077
+ samplingSeconds: number().int().min(1).max(300).default(10)
14078
+ });
14079
+ /**
13867
14080
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
13868
14081
  *
13869
14082
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14136,7 +14349,33 @@ var NcConditionsSchema = object({
14136
14349
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14137
14350
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14138
14351
  */
14139
- occupancy: NcOccupancyConditionSchema.optional()
14352
+ occupancy: NcOccupancyConditionSchema.optional(),
14353
+ /**
14354
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14355
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14356
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14357
+ * a window that is not full yet, neither filter given). See
14358
+ * {@link NcAudioCondition}.
14359
+ *
14360
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14361
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14362
+ * a detection, a track or a device event (the same fail-closed pairing
14363
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14364
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14365
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14366
+ * classified sample) stays exactly as it was for rules that already use it.
14367
+ *
14368
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14369
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14370
+ * (`camstack/src/data/notification-center.ts`, guarded by
14371
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14372
+ * condition fields it does not know when a rule is saved from the phone.
14373
+ * Publishing an editor for a condition the app cannot round-trip is how an
14374
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14375
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14376
+ * does an audio rule become authorable.
14377
+ */
14378
+ audio: NcAudioConditionSchema.optional()
14140
14379
  });
14141
14380
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14142
14381
  var NcRuleTargetSchema = object({
@@ -14250,6 +14489,73 @@ var NcThrottleSchema = object({
14250
14489
  */
14251
14490
  granularity: NcThrottleGranularitySchema.optional()
14252
14491
  });
14492
+ /**
14493
+ * How long the confirm gate may hold ONE notification, and how big the picture
14494
+ * it judges may be.
14495
+ *
14496
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14497
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14498
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14499
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14500
+ * tokens for pixels the model pools away.
14501
+ */
14502
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14503
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14504
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14505
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14506
+ var NcConfirmExpectSchema = object({
14507
+ op: _enum([
14508
+ ">=",
14509
+ ">",
14510
+ "<=",
14511
+ "<",
14512
+ "=="
14513
+ ]),
14514
+ count: number().int().min(0).max(1e3)
14515
+ });
14516
+ /**
14517
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14518
+ * to ship and says whether it agrees with the rule.
14519
+ *
14520
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14521
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14522
+ * on the operator's phone is not a verdict about this notification.
14523
+ *
14524
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14525
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14526
+ * the default and every fail-open is COUNTED, because a gate that always fails
14527
+ * open looks in the log exactly like a gate that works.
14528
+ *
14529
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14530
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14531
+ * production failures in one day), so the gate reads absent as the constant
14532
+ * above rather than trusting a parse it may never have seen.
14533
+ */
14534
+ var NcConfirmSchema = object({
14535
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14536
+ * same thing, and both mean "deliver exactly as before". */
14537
+ enabled: boolean().default(false),
14538
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14539
+ profileId: string().optional(),
14540
+ /**
14541
+ * The operator's question, in his own words. Absent = a question derived
14542
+ * from the rule (its class and its expectation).
14543
+ *
14544
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14545
+ * banners, signage and plates as instructions if you let them reach the
14546
+ * prompt — proven live — so the authoritative contract stays in the system
14547
+ * turn and only rule-authored words land here.
14548
+ */
14549
+ prompt: string().max(1e3).optional(),
14550
+ /** Fire only when the model's count satisfies this. Absent = the model's
14551
+ * own boolean verdict decides. */
14552
+ expect: NcConfirmExpectSchema.optional(),
14553
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14554
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14555
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14556
+ /** Longest edge the judged image is downscaled to before it is sent. */
14557
+ maxImagePx: number().int().min(64).max(2048).default(448)
14558
+ });
14253
14559
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14254
14560
  var NcRuleInputSchema = object({
14255
14561
  name: string().min(1).max(200),
@@ -14310,7 +14616,13 @@ var NcRuleInputSchema = object({
14310
14616
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14311
14617
  * shape as every other actuation.
14312
14618
  */
14313
- actions: NcRuleActionsSchema.optional()
14619
+ actions: NcRuleActionsSchema.optional(),
14620
+ /**
14621
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14622
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14623
+ * did, and absent is the only way to say that without a migration.
14624
+ */
14625
+ confirm: NcConfirmSchema.optional()
14314
14626
  });
14315
14627
  /**
14316
14628
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14321,7 +14633,37 @@ var NcRuleInputSchema = object({
14321
14633
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14322
14634
  * `updateRule` patch.
14323
14635
  */
14324
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14636
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14637
+ disabledTargetIds: array(string()).optional(),
14638
+ /**
14639
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14640
+ *
14641
+ * It makes the key optional to SUPPLY; the parse still materialises the
14642
+ * default when the key is absent. And `NcRuleStore.update` merges with
14643
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14644
+ * one — which made every partial edit destructive:
14645
+ *
14646
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14647
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14648
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14649
+ *
14650
+ * A rule scoped to one camera and one zone silently became a rule that
14651
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14652
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14653
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
14654
+ * within a minute of a two-field patch.
14655
+ *
14656
+ * So every defaulted field is re-declared here WITHOUT its default. The
14657
+ * inner defaults still apply when the caller DOES send the key — `{}` for
14658
+ * conditions remains a real instruction ("clear them") — and only the
14659
+ * absent key is now genuinely absent.
14660
+ */
14661
+ enabled: boolean().optional(),
14662
+ conditions: NcConditionsSchema.optional(),
14663
+ media: NcMediaPolicySchema.optional(),
14664
+ throttle: NcThrottleSchema.optional(),
14665
+ priority: number().int().min(1).max(5).optional()
14666
+ });
14325
14667
  /** A persisted rule. */
14326
14668
  var NcRuleSchema = NcRuleInputSchema.extend({
14327
14669
  id: string(),
@@ -14622,6 +14964,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14622
14964
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14623
14965
  * copy would lie the first time a rule is disabled.
14624
14966
  */
14967
+ /**
14968
+ * Why a device a mode NAMES is nonetheless not armed by it.
14969
+ *
14970
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
14971
+ * per-camera notification switch the Notification Center already owns,
14972
+ * `detection-off` is the device's own detection binding being inactive, and
14973
+ * `offline` is the device manager's liveness. A fourth reason would mean a
14974
+ * fourth authority, and inventing one here is how a panel starts disagreeing
14975
+ * with the switches the operator actually used.
14976
+ */
14977
+ var NcAlarmSkipReasonSchema = _enum([
14978
+ "muted",
14979
+ "detection-off",
14980
+ "offline"
14981
+ ]);
14982
+ var NcAlarmSkippedDeviceSchema = object({
14983
+ deviceId: number().int(),
14984
+ reason: NcAlarmSkipReasonSchema
14985
+ });
14625
14986
  var NcAlarmModeCoverageSchema = object({
14626
14987
  mode: AlarmArmModeSchema,
14627
14988
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14629,7 +14990,18 @@ var NcAlarmModeCoverageSchema = object({
14629
14990
  /** At least one covering rule has no device scope, so the mode covers all. */
14630
14991
  allDevices: boolean(),
14631
14992
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14632
- deviceIds: array(number().int())
14993
+ deviceIds: array(number().int()),
14994
+ /**
14995
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
14996
+ * excludes it.
14997
+ *
14998
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
14999
+ * twelve makes it false in exactly the way nobody notices until an incident.
15000
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15001
+ * still parses as "nothing known to be skipped" rather than failing the whole
15002
+ * alarm tab.
15003
+ */
15004
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14633
15005
  });
14634
15006
  var NcAlarmConfigSchema = object({
14635
15007
  /**
@@ -15992,13 +16364,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
15992
16364
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
15993
16365
  kind: "mutation",
15994
16366
  auth: "admin"
15995
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
16367
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
15996
16368
  kind: "mutation",
15997
16369
  auth: "admin"
15998
- }), method(object({}), array(RelocateJobSchema).readonly(), {
15999
- kind: "query",
16370
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16371
+ kind: "mutation",
16000
16372
  auth: "admin"
16001
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16373
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16374
+ kind: "mutation",
16375
+ auth: "admin"
16376
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
16377
+ kind: "mutation",
16378
+ auth: "admin"
16379
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16002
16380
  kind: "mutation",
16003
16381
  auth: "admin"
16004
16382
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17422,9 +17800,16 @@ var CameraStatusSchema = object({
17422
17800
  audio: CameraAudioStatusSchema.nullable(),
17423
17801
  recording: CameraRecordingStatusSchema.nullable(),
17424
17802
  /**
17425
- * Per-camera function switches an OPERATOR has turned off
17803
+ * Per-camera functions an OPERATOR has turned off
17426
17804
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17427
17805
  *
17806
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
17807
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
17808
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
17809
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
17810
+ * The badge outlives the control panel: the panel was a convenience, this is
17811
+ * the difference between a camera being off and a camera being dead.
17812
+ *
17428
17813
  * This is the difference between DISABLED and BROKEN. A camera whose
17429
17814
  * `detection` block reports zero fps and whose `switchedOff` contains
17430
17815
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17495,7 +17880,13 @@ var NodeInferenceDevicesSchema = object({
17495
17880
  reachable: boolean(),
17496
17881
  devices: array(NodeInferenceDeviceSchema).readonly()
17497
17882
  });
17498
- method(object({
17883
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
17884
+ kind: "mutation",
17885
+ auth: "admin"
17886
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
17887
+ kind: "mutation",
17888
+ auth: "admin"
17889
+ }), method(object({
17499
17890
  deviceId: number(),
17500
17891
  agentNodeId: string()
17501
17892
  }), object({ success: literal(true) }), {
@@ -18182,6 +18573,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
18182
18573
  locationId: string(),
18183
18574
  targetBytes: number().int().positive()
18184
18575
  }), EvictResultSchema, { kind: "mutation" });
18576
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
18577
+ kind: "mutation",
18578
+ auth: "admin"
18579
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
18580
+ kind: "mutation",
18581
+ auth: "admin"
18582
+ });
18185
18583
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18186
18584
  providerId: string().min(1),
18187
18585
  displayName: string().min(1),
@@ -18285,6 +18683,28 @@ var TerminalProfileInfoSchema = object({
18285
18683
  label: string(),
18286
18684
  description: string().optional()
18287
18685
  });
18686
+ /**
18687
+ * A durable operator-created Terminal instance. Profiles are templates; only
18688
+ * an instance declares a camera.
18689
+ */
18690
+ var TerminalInstanceInfoSchema = object({
18691
+ instanceId: string(),
18692
+ cameraStableId: string(),
18693
+ nodeId: string(),
18694
+ profileId: string(),
18695
+ profileLabel: string(),
18696
+ name: string(),
18697
+ enabled: boolean()
18698
+ });
18699
+ var TerminalLegacyCameraSchema = object({
18700
+ stableId: string(),
18701
+ nodeId: string(),
18702
+ profileId: string(),
18703
+ profileLabel: string(),
18704
+ name: string(),
18705
+ /** Only legacy monitor cameras can retain their historic stable identity. */
18706
+ adoptable: boolean()
18707
+ });
18288
18708
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18289
18709
  seq: number().int().positive(),
18290
18710
  kind: literal("data"),
@@ -18301,7 +18721,29 @@ var TerminalOutputBatchSchema = object({
18301
18721
  snapshot: string().optional(),
18302
18722
  events: array(TerminalOutputEventSchema).readonly()
18303
18723
  });
18304
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18724
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
18725
+ targetNodeId: string().min(1),
18726
+ profileId: string().min(1),
18727
+ name: string().trim().min(1).max(160).optional()
18728
+ }), TerminalInstanceInfoSchema, {
18729
+ kind: "mutation",
18730
+ auth: "admin"
18731
+ }), method(object({ instanceId: string().min(1) }), _void(), {
18732
+ kind: "mutation",
18733
+ auth: "admin"
18734
+ }), method(object({
18735
+ instanceId: string().min(1),
18736
+ enabled: boolean()
18737
+ }), TerminalInstanceInfoSchema, {
18738
+ kind: "mutation",
18739
+ auth: "admin"
18740
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
18741
+ stableId: string().min(1),
18742
+ name: string().trim().min(1).max(160).optional()
18743
+ }), TerminalInstanceInfoSchema, {
18744
+ kind: "mutation",
18745
+ auth: "admin"
18746
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18305
18747
  profileId: string(),
18306
18748
  cols: number().int().positive(),
18307
18749
  rows: number().int().positive()
@@ -18318,7 +18760,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18318
18760
  }), method(object({
18319
18761
  sessionId: string(),
18320
18762
  afterSeq: number().int().nonnegative(),
18321
- waitMs: number().int().min(0).max(2e3).default(0)
18763
+ waitMs: number().int().min(0).max(2e3).default(0),
18764
+ /**
18765
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
18766
+ * browser's initial repaint remains immediate; the camera snapshot
18767
+ * relay uses it to avoid encoding a blank startup frame.
18768
+ */
18769
+ waitForOutput: boolean().optional()
18322
18770
  }), TerminalOutputBatchSchema, {
18323
18771
  kind: "mutation",
18324
18772
  auth: "admin",
@@ -20259,6 +20707,7 @@ var FaceInfoSchema = object({
20259
20707
  var FaceFilterEnum = _enum([
20260
20708
  "unassigned",
20261
20709
  "recognized",
20710
+ "identified",
20262
20711
  "all"
20263
20712
  ]);
20264
20713
  var MediaFileLiteSchema$1 = object({
@@ -20287,6 +20736,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
20287
20736
  kind: "mutation",
20288
20737
  auth: "admin"
20289
20738
  }), method(object({
20739
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
20740
+ deviceId: number().int().optional(),
20290
20741
  limit: number().int().positive().optional(),
20291
20742
  filter: FaceFilterEnum.optional(),
20292
20743
  /**
@@ -22052,6 +22503,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
22052
22503
  capName: string().min(1).max(64),
22053
22504
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
22054
22505
  valuePath: string().min(1).max(64)
22506
+ }),
22507
+ object({
22508
+ kind: literal("latest-recognition"),
22509
+ recognition: _enum(["person", "plate"])
22055
22510
  })
22056
22511
  ]);
22057
22512
  var OsdSlotBindingSchema = object({
@@ -22157,6 +22612,15 @@ method(object({ deviceId: number().int() }), object({
22157
22612
  }), object({ success: literal(true) }), {
22158
22613
  kind: "mutation",
22159
22614
  auth: "admin"
22615
+ }), method(object({
22616
+ sourceDeviceId: number().int(),
22617
+ targetDeviceId: number().int()
22618
+ }), object({
22619
+ copied: number().int().nonnegative(),
22620
+ skipped: number().int().nonnegative()
22621
+ }), {
22622
+ kind: "mutation",
22623
+ auth: "admin"
22160
22624
  }), method(object({
22161
22625
  deviceId: number().int(),
22162
22626
  slotId: string().min(1),
@@ -22867,7 +23331,19 @@ var RecordingManifestSchema = object({
22867
23331
  * profiles/subtrees/locations on this node). */
22868
23332
  var RecordingDeviceUsageSchema = object({
22869
23333
  deviceId: number(),
22870
- usedBytes: number()
23334
+ usedBytes: number(),
23335
+ /**
23336
+ * Start of this camera's OLDEST indexed segment, across every profile and
23337
+ * location — the "Oldest footage" column in Recordings → Storage, and the
23338
+ * only honest answer to "is retention actually holding?" per camera.
23339
+ *
23340
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
23341
+ * predates this field omits it entirely, and a hub whose types carry the
23342
+ * field must keep validating that older provider's payload: the framework
23343
+ * (types) and the addon ship on different trains, and the addon is usually
23344
+ * the later of the two.
23345
+ */
23346
+ oldestMs: number().nullable().optional()
22871
23347
  });
22872
23348
  /** Recording storage usage + capacity for one storage location. */
22873
23349
  var RecordingLocationUsageSchema = object({
@@ -22895,6 +23371,57 @@ var RecordingStorageUsageSchema = object({
22895
23371
  locations: array(RecordingLocationUsageSchema)
22896
23372
  });
22897
23373
  /**
23374
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
23375
+ *
23376
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
23377
+ * is the operator asking for the EXISTING archive to be brought into line with
23378
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
23379
+ * location, run FIFO behind the single-flight mover.
23380
+ *
23381
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
23382
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
23383
+ * (empty on the plan).
23384
+ */
23385
+ var RecordingRebalanceMoveSchema = object({
23386
+ deviceId: number(),
23387
+ profile: string(),
23388
+ fromLocationId: string(),
23389
+ toLocationId: string(),
23390
+ bytes: number(),
23391
+ files: number().int()
23392
+ });
23393
+ /** Why a pile that is out of place is staying there. Every refusal is
23394
+ * reported: a rebalance that silently drops a camera reads exactly like one
23395
+ * that had nothing to do. */
23396
+ var RecordingRebalanceSkipReasonSchema = _enum([
23397
+ "unassigned",
23398
+ "target-not-writable",
23399
+ "below-threshold",
23400
+ "no-headroom"
23401
+ ]);
23402
+ var RecordingRebalanceSkipSchema = object({
23403
+ deviceId: number(),
23404
+ profile: string(),
23405
+ fromLocationId: string(),
23406
+ /** The location the plan wants; null when the camera has no assignment. */
23407
+ toLocationId: string().nullable(),
23408
+ bytes: number(),
23409
+ reason: RecordingRebalanceSkipReasonSchema
23410
+ });
23411
+ var RecordingRebalancePlanSchema = object({
23412
+ moves: array(RecordingRebalanceMoveSchema),
23413
+ skipped: array(RecordingRebalanceSkipSchema),
23414
+ bytesToMove: number(),
23415
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
23416
+ jobIds: array(string())
23417
+ });
23418
+ var RecordingRebalanceInputSchema = object({
23419
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
23420
+ throttleMbps: number().min(1).max(1e3).optional(),
23421
+ /** Ignore piles smaller than this (default 1 GB). */
23422
+ minMoveGb: number().min(0).optional()
23423
+ });
23424
+ /**
22898
23425
  * Result of locating footage at a wall-clock instant for one device/profile.
22899
23426
  * `segment` carries the covering segment's window; `gap` reports the forward
22900
23427
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -23042,6 +23569,21 @@ method(object({
23042
23569
  }), {
23043
23570
  kind: "mutation",
23044
23571
  auth: "admin"
23572
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
23573
+ kind: "mutation",
23574
+ auth: "admin"
23575
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
23576
+ kind: "mutation",
23577
+ auth: "admin"
23578
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
23579
+ kind: "mutation",
23580
+ auth: "admin"
23581
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
23582
+ kind: "mutation",
23583
+ auth: "admin"
23584
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23585
+ kind: "mutation",
23586
+ auth: "admin"
23045
23587
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
23046
23588
  kind: "mutation",
23047
23589
  auth: "admin"
@@ -23051,9 +23593,15 @@ method(object({
23051
23593
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23052
23594
  kind: "mutation",
23053
23595
  auth: "admin"
23596
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23597
+ kind: "query",
23598
+ auth: "admin"
23599
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23600
+ kind: "mutation",
23601
+ auth: "admin"
23054
23602
  });
23055
23603
  /**
23056
- * `recordingExport` cap — render a footage time range into a single downloadable
23604
+ * `recording-export` cap — render a footage time range into a single downloadable
23057
23605
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
23058
23606
  * bounded lifetime with a durable history, auto-expiry, and optional
23059
23607
  * delete-after-download.
@@ -23068,10 +23616,42 @@ method(object({
23068
23616
  */
23069
23617
  /** Playback-speed multiplier for the render (1 = realtime). */
23070
23618
  var ExportSpeedSchema = number().min(.25).max(32);
23619
+ /**
23620
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23621
+ *
23622
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
23623
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23624
+ * playlist. Handing it absolute epochs would make every call site responsible
23625
+ * for the same subtraction, and the one that forgot would emit a filter that
23626
+ * selects nothing — silently, as a uniform timelapse.
23627
+ */
23628
+ var ExportDenseRangeSchema = object({
23629
+ fromSec: number().nonnegative(),
23630
+ toSec: number().nonnegative()
23631
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
23632
+ /**
23633
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
23634
+ * listed ranges and at the base `everyMs` everywhere else.
23635
+ *
23636
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
23637
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
23638
+ */
23639
+ var ExportDenseSchema = object({
23640
+ everyMs: number().int().positive(),
23641
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
23642
+ });
23071
23643
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
23072
23644
  var ExportTimelapseSchema = object({
23073
23645
  everyMs: number().int().positive(),
23074
- outputFps: number().int().min(1).max(60).optional()
23646
+ outputFps: number().int().min(1).max(60).optional(),
23647
+ /** Optional second, FASTER rate over the intervals that matter. */
23648
+ dense: ExportDenseSchema.optional()
23649
+ }).superRefine((v, ctx) => {
23650
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
23651
+ code: ZodIssueCode.custom,
23652
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
23653
+ path: ["dense", "everyMs"]
23654
+ });
23075
23655
  });
23076
23656
  /**
23077
23657
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -23129,6 +23709,19 @@ var ExportDownloadSchema = object({
23129
23709
  url: string(),
23130
23710
  endpoints: array(string())
23131
23711
  });
23712
+ /**
23713
+ * A finished export's bytes, inline.
23714
+ *
23715
+ * `bytes` is the DECODED length — the number the caller bounds and logs
23716
+ * against, so nobody has to infer it from the base64 length.
23717
+ */
23718
+ var ExportBytesSchema = object({
23719
+ base64: string(),
23720
+ contentType: string(),
23721
+ /** Suggested filename, extension included. */
23722
+ name: string(),
23723
+ bytes: number().int().nonnegative()
23724
+ });
23132
23725
  method(object({
23133
23726
  deviceId: number(),
23134
23727
  profile: string(),
@@ -23153,6 +23746,9 @@ method(object({
23153
23746
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
23154
23747
  kind: "query",
23155
23748
  auth: "protected"
23749
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
23750
+ kind: "query",
23751
+ auth: "protected"
23156
23752
  });
23157
23753
  /**
23158
23754
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -27170,6 +27766,12 @@ Object.freeze({
27170
27766
  addonId: null,
27171
27767
  access: "delete"
27172
27768
  },
27769
+ "osdManager.copyDeviceConfiguration": {
27770
+ capName: "osd-manager",
27771
+ capScope: "system",
27772
+ addonId: null,
27773
+ access: "create"
27774
+ },
27173
27775
  "osdManager.getConditionSupport": {
27174
27776
  capName: "osd-manager",
27175
27777
  capScope: "system",
@@ -27266,7 +27868,7 @@ Object.freeze({
27266
27868
  addonId: null,
27267
27869
  access: "create"
27268
27870
  },
27269
- "pipelineAnalytics.cancelMediaRelocate": {
27871
+ "pipelineAnalytics.cancelStorageMigrationMove": {
27270
27872
  capName: "pipeline-analytics",
27271
27873
  capScope: "device",
27272
27874
  addonId: null,
@@ -27338,12 +27940,6 @@ Object.freeze({
27338
27940
  addonId: null,
27339
27941
  access: "view"
27340
27942
  },
27341
- "pipelineAnalytics.getMediaRelocateStatus": {
27342
- capName: "pipeline-analytics",
27343
- capScope: "device",
27344
- addonId: null,
27345
- access: "view"
27346
- },
27347
27943
  "pipelineAnalytics.getMotionEvents": {
27348
27944
  capName: "pipeline-analytics",
27349
27945
  capScope: "device",
@@ -27380,6 +27976,12 @@ Object.freeze({
27380
27976
  addonId: null,
27381
27977
  access: "view"
27382
27978
  },
27979
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
27980
+ capName: "pipeline-analytics",
27981
+ capScope: "device",
27982
+ addonId: null,
27983
+ access: "view"
27984
+ },
27383
27985
  "pipelineAnalytics.getTrack": {
27384
27986
  capName: "pipeline-analytics",
27385
27987
  capScope: "device",
@@ -27458,6 +28060,12 @@ Object.freeze({
27458
28060
  addonId: null,
27459
28061
  access: "view"
27460
28062
  },
28063
+ "pipelineAnalytics.pauseForStorageMigration": {
28064
+ capName: "pipeline-analytics",
28065
+ capScope: "device",
28066
+ addonId: null,
28067
+ access: "create"
28068
+ },
27461
28069
  "pipelineAnalytics.proposeRetrainAnnotations": {
27462
28070
  capName: "pipeline-analytics",
27463
28071
  capScope: "device",
@@ -27488,7 +28096,7 @@ Object.freeze({
27488
28096
  addonId: null,
27489
28097
  access: "create"
27490
28098
  },
27491
- "pipelineAnalytics.relocateMedia": {
28099
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
27492
28100
  capName: "pipeline-analytics",
27493
28101
  capScope: "device",
27494
28102
  addonId: null,
@@ -27500,6 +28108,12 @@ Object.freeze({
27500
28108
  addonId: null,
27501
28109
  access: "create"
27502
28110
  },
28111
+ "pipelineAnalytics.resumeForStorageMigration": {
28112
+ capName: "pipeline-analytics",
28113
+ capScope: "device",
28114
+ addonId: null,
28115
+ access: "create"
28116
+ },
27503
28117
  "pipelineAnalytics.saveRetrainAnnotations": {
27504
28118
  capName: "pipeline-analytics",
27505
28119
  capScope: "device",
@@ -27524,6 +28138,12 @@ Object.freeze({
27524
28138
  addonId: null,
27525
28139
  access: "create"
27526
28140
  },
28141
+ "pipelineAnalytics.startStorageMigrationMove": {
28142
+ capName: "pipeline-analytics",
28143
+ capScope: "device",
28144
+ addonId: null,
28145
+ access: "create"
28146
+ },
27527
28147
  "pipelineAnalytics.wipeAllAnalytics": {
27528
28148
  capName: "pipeline-analytics",
27529
28149
  capScope: "device",
@@ -27890,6 +28510,12 @@ Object.freeze({
27890
28510
  addonId: null,
27891
28511
  access: "view"
27892
28512
  },
28513
+ "pipelineOrchestrator.pauseForStorageMigration": {
28514
+ capName: "pipeline-orchestrator",
28515
+ capScope: "system",
28516
+ addonId: null,
28517
+ access: "create"
28518
+ },
27893
28519
  "pipelineOrchestrator.rebalance": {
27894
28520
  capName: "pipeline-orchestrator",
27895
28521
  capScope: "system",
@@ -27914,6 +28540,12 @@ Object.freeze({
27914
28540
  addonId: null,
27915
28541
  access: "view"
27916
28542
  },
28543
+ "pipelineOrchestrator.resumeForStorageMigration": {
28544
+ capName: "pipeline-orchestrator",
28545
+ capScope: "system",
28546
+ addonId: null,
28547
+ access: "create"
28548
+ },
27917
28549
  "pipelineOrchestrator.saveTemplate": {
27918
28550
  capName: "pipeline-orchestrator",
27919
28551
  capScope: "system",
@@ -28310,7 +28942,13 @@ Object.freeze({
28310
28942
  addonId: null,
28311
28943
  access: "create"
28312
28944
  },
28313
- "recording.cancelRelocate": {
28945
+ "recording.cancelRelocateJob": {
28946
+ capName: "recording",
28947
+ capScope: "system",
28948
+ addonId: null,
28949
+ access: "create"
28950
+ },
28951
+ "recording.cancelStorageMigrationMove": {
28314
28952
  capName: "recording",
28315
28953
  capScope: "system",
28316
28954
  addonId: null,
@@ -28346,7 +28984,7 @@ Object.freeze({
28346
28984
  addonId: null,
28347
28985
  access: "view"
28348
28986
  },
28349
- "recording.getRelocateStatus": {
28987
+ "recording.getStorageMigrationMoveStatus": {
28350
28988
  capName: "recording",
28351
28989
  capScope: "system",
28352
28990
  addonId: null,
@@ -28364,12 +29002,30 @@ Object.freeze({
28364
29002
  addonId: null,
28365
29003
  access: "view"
28366
29004
  },
29005
+ "recording.listRelocateJobs": {
29006
+ capName: "recording",
29007
+ capScope: "system",
29008
+ addonId: null,
29009
+ access: "view"
29010
+ },
28367
29011
  "recording.locateSegment": {
28368
29012
  capName: "recording",
28369
29013
  capScope: "system",
28370
29014
  addonId: null,
28371
29015
  access: "view"
28372
29016
  },
29017
+ "recording.pauseForStorageMigration": {
29018
+ capName: "recording",
29019
+ capScope: "system",
29020
+ addonId: null,
29021
+ access: "create"
29022
+ },
29023
+ "recording.planStorageRebalance": {
29024
+ capName: "recording",
29025
+ capScope: "system",
29026
+ addonId: null,
29027
+ access: "view"
29028
+ },
28373
29029
  "recording.pruneFootage": {
28374
29030
  capName: "recording",
28375
29031
  capScope: "system",
@@ -28388,6 +29044,12 @@ Object.freeze({
28388
29044
  addonId: null,
28389
29045
  access: "view"
28390
29046
  },
29047
+ "recording.refreshStorageLocationsForMigration": {
29048
+ capName: "recording",
29049
+ capScope: "system",
29050
+ addonId: null,
29051
+ access: "create"
29052
+ },
28391
29053
  "recording.relocateFootage": {
28392
29054
  capName: "recording",
28393
29055
  capScope: "system",
@@ -28412,44 +29074,68 @@ Object.freeze({
28412
29074
  addonId: null,
28413
29075
  access: "create"
28414
29076
  },
29077
+ "recording.resumeForStorageMigration": {
29078
+ capName: "recording",
29079
+ capScope: "system",
29080
+ addonId: null,
29081
+ access: "create"
29082
+ },
28415
29083
  "recording.setDeviceConfig": {
28416
29084
  capName: "recording",
28417
29085
  capScope: "system",
28418
29086
  addonId: null,
28419
29087
  access: "create"
28420
29088
  },
29089
+ "recording.startStorageMigrationMove": {
29090
+ capName: "recording",
29091
+ capScope: "system",
29092
+ addonId: null,
29093
+ access: "create"
29094
+ },
29095
+ "recording.startStorageRebalance": {
29096
+ capName: "recording",
29097
+ capScope: "system",
29098
+ addonId: null,
29099
+ access: "create"
29100
+ },
28421
29101
  "recordingExport.cancelExport": {
28422
- capName: "recordingExport",
29102
+ capName: "recording-export",
28423
29103
  capScope: "system",
28424
29104
  addonId: null,
28425
29105
  access: "create"
28426
29106
  },
28427
29107
  "recordingExport.createExport": {
28428
- capName: "recordingExport",
29108
+ capName: "recording-export",
28429
29109
  capScope: "system",
28430
29110
  addonId: null,
28431
29111
  access: "create"
28432
29112
  },
28433
29113
  "recordingExport.deleteExport": {
28434
- capName: "recordingExport",
29114
+ capName: "recording-export",
28435
29115
  capScope: "system",
28436
29116
  addonId: null,
28437
29117
  access: "delete"
28438
29118
  },
28439
29119
  "recordingExport.getDownloadUrl": {
28440
- capName: "recordingExport",
29120
+ capName: "recording-export",
28441
29121
  capScope: "system",
28442
29122
  addonId: null,
28443
29123
  access: "view"
28444
29124
  },
28445
29125
  "recordingExport.getExport": {
28446
- capName: "recordingExport",
29126
+ capName: "recording-export",
28447
29127
  capScope: "system",
28448
29128
  addonId: null,
28449
29129
  access: "view"
28450
29130
  },
28451
29131
  "recordingExport.listExports": {
28452
- capName: "recordingExport",
29132
+ capName: "recording-export",
29133
+ capScope: "system",
29134
+ addonId: null,
29135
+ access: "view"
29136
+ },
29137
+ "recordingExport.readExportBytes": {
29138
+ capName: "recording-export",
28453
29139
  capScope: "system",
28454
29140
  addonId: null,
28455
29141
  access: "view"
@@ -28808,6 +29494,30 @@ Object.freeze({
28808
29494
  addonId: null,
28809
29495
  access: "view"
28810
29496
  },
29497
+ "storageMigration.cancel": {
29498
+ capName: "storage-migration",
29499
+ capScope: "system",
29500
+ addonId: null,
29501
+ access: "create"
29502
+ },
29503
+ "storageMigration.plan": {
29504
+ capName: "storage-migration",
29505
+ capScope: "system",
29506
+ addonId: null,
29507
+ access: "view"
29508
+ },
29509
+ "storageMigration.start": {
29510
+ capName: "storage-migration",
29511
+ capScope: "system",
29512
+ addonId: null,
29513
+ access: "create"
29514
+ },
29515
+ "storageMigration.status": {
29516
+ capName: "storage-migration",
29517
+ capScope: "system",
29518
+ addonId: null,
29519
+ access: "view"
29520
+ },
28811
29521
  "storageProvider.abortUpload": {
28812
29522
  capName: "storage-provider",
28813
29523
  capScope: "system",
@@ -29186,12 +29896,42 @@ Object.freeze({
29186
29896
  addonId: null,
29187
29897
  access: "create"
29188
29898
  },
29899
+ "terminalSession.adoptLegacyMonitor": {
29900
+ capName: "terminal-session",
29901
+ capScope: "system",
29902
+ addonId: null,
29903
+ access: "create"
29904
+ },
29189
29905
  "terminalSession.close": {
29190
29906
  capName: "terminal-session",
29191
29907
  capScope: "system",
29192
29908
  addonId: null,
29193
29909
  access: "create"
29194
29910
  },
29911
+ "terminalSession.createInstance": {
29912
+ capName: "terminal-session",
29913
+ capScope: "system",
29914
+ addonId: null,
29915
+ access: "create"
29916
+ },
29917
+ "terminalSession.deleteInstance": {
29918
+ capName: "terminal-session",
29919
+ capScope: "system",
29920
+ addonId: null,
29921
+ access: "delete"
29922
+ },
29923
+ "terminalSession.listInstances": {
29924
+ capName: "terminal-session",
29925
+ capScope: "system",
29926
+ addonId: null,
29927
+ access: "view"
29928
+ },
29929
+ "terminalSession.listLegacyCameras": {
29930
+ capName: "terminal-session",
29931
+ capScope: "system",
29932
+ addonId: null,
29933
+ access: "view"
29934
+ },
29195
29935
  "terminalSession.listProfiles": {
29196
29936
  capName: "terminal-session",
29197
29937
  capScope: "system",
@@ -29222,6 +29962,12 @@ Object.freeze({
29222
29962
  addonId: null,
29223
29963
  access: "create"
29224
29964
  },
29965
+ "terminalSession.setInstanceEnabled": {
29966
+ capName: "terminal-session",
29967
+ capScope: "system",
29968
+ addonId: null,
29969
+ access: "create"
29970
+ },
29225
29971
  "terminalSession.writeInput": {
29226
29972
  capName: "terminal-session",
29227
29973
  capScope: "system",
@@ -29766,6 +30512,104 @@ var FramerateField = number().int().min(1).max(60);
29766
30512
  var TargetsField = array(NcRuleTargetSchema).min(1);
29767
30513
  var PriorityField = number().int().min(1).max(5);
29768
30514
  /**
30515
+ * Explicit override of the DENSE sampling cadence, seconds.
30516
+ *
30517
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
30518
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
30519
+ * made that same base 3 s and rendered a person pass as two frames.)
30520
+ *
30521
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
30522
+ * `denseCadenceSec` and played at `framerate` occupies
30523
+ *
30524
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
30525
+ *
30526
+ * 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.
30527
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
30528
+ * and therefore the length of a quiet night, does not move.
30529
+ *
30530
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
30531
+ * the recording has them returns the same frames, requested twice. Must be
30532
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
30533
+ * a uniform video the operator believes is two-rate — and upsert refuses it
30534
+ * rather than letting the export cap reject the render hours after the window.
30535
+ */
30536
+ var DenseCadenceSecField = number().min(.1).max(3600);
30537
+ /**
30538
+ * Minimum seconds of OUTPUT video each detection range must occupy.
30539
+ *
30540
+ * The operator-facing form of the arithmetic above: instead of solving for a
30541
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
30542
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
30543
+ * that range every ~583 ms.
30544
+ *
30545
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
30546
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
30547
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
30548
+ * ranges are sampled denser than they need. Per-range cadences require a cap
30549
+ * schema change and are the tracked follow-up.
30550
+ *
30551
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
30552
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
30553
+ * by real footage, never met by duplicating frames into motion that never
30554
+ * happened.
30555
+ */
30556
+ var MinDwellSecField = number().min(0).max(60);
30557
+ /**
30558
+ * Caption burned into the notification's preview frame.
30559
+ *
30560
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
30561
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
30562
+ * templating dialect for one field would be a second thing to explain.
30563
+ *
30564
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
30565
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
30566
+ * the reason this is not `.min(1)`.
30567
+ */
30568
+ var PreviewTextField = string().max(200);
30569
+ /**
30570
+ * Whether the notification's preview is a STILL or a short animation.
30571
+ *
30572
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
30573
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
30574
+ * night reads better as three seconds of motion than as one frame of it. Both
30575
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
30576
+ * simply applies it to a dozen frames sampled across the render and assembles
30577
+ * them.
30578
+ *
30579
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
30580
+ * seeks and a palette pass, and no rule that never asked for one should start
30581
+ * paying that on the deploy that shipped it.
30582
+ *
30583
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
30584
+ */
30585
+ var PreviewModeField = _enum(["image", "gif"]);
30586
+ /**
30587
+ * Which detection classes the notification reports counts for.
30588
+ *
30589
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
30590
+ * plan — no second query — aggregated per class. Absent or empty means "every
30591
+ * class the window actually contained", which is what an operator who never
30592
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
30593
+ * counts cars all night).
30594
+ *
30595
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
30596
+ * …). An unknown name simply never matches and reports nothing — it is not an
30597
+ * error, because a rule may legitimately name a class this camera's model does
30598
+ * not emit.
30599
+ *
30600
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
30601
+ * - `{{detections}}` — total over the reported classes
30602
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
30603
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
30604
+ * one per class, `count_` + the class name
30605
+ *
30606
+ * With NO custom body template the summary is appended to the derived body, and
30607
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
30608
+ * reads. With a custom template the operator owns every word — nothing is
30609
+ * appended, so `{{detectionSummary}}` is how he asks for it.
30610
+ */
30611
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
30612
+ /**
29769
30613
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
29770
30614
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
29771
30615
  * here (see the ownership note above).
@@ -29785,9 +30629,30 @@ var TimelapseRuleInputSchema = object({
29785
30629
  cadenceSec: CadenceSecField.default(15),
29786
30630
  /** Output frames per second of the assembled mp4 (predecessor parity). */
29787
30631
  framerate: FramerateField.default(10),
30632
+ /**
30633
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
30634
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
30635
+ * field gets.
30636
+ */
30637
+ denseCadenceSec: DenseCadenceSecField.optional(),
30638
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
30639
+ minDwellSec: MinDwellSecField.optional(),
29788
30640
  /** `notification-output` targets the finished video/thumbnail is sent to. */
29789
30641
  targets: TargetsField,
29790
30642
  template: TimelapseTemplateSchema.optional(),
30643
+ /**
30644
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
30645
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
30646
+ *
30647
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
30648
+ * the notification's title/body, and clearing it (`template: null`) must not
30649
+ * silently clear the caption too.
30650
+ */
30651
+ previewText: PreviewTextField.optional(),
30652
+ /** Still or animation — see {@link PreviewModeField}. */
30653
+ previewMode: PreviewModeField.default("image"),
30654
+ /** Classes the notification counts — see {@link ReportClassesField}. */
30655
+ reportClasses: ReportClassesField.optional(),
29791
30656
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
29792
30657
  priority: PriorityField.default(3)
29793
30658
  });
@@ -29798,8 +30663,13 @@ object({
29798
30663
  schedule: NcScheduleSchema.optional(),
29799
30664
  cadenceSec: CadenceSecField.optional(),
29800
30665
  framerate: FramerateField.optional(),
30666
+ denseCadenceSec: DenseCadenceSecField.optional(),
30667
+ minDwellSec: MinDwellSecField.optional(),
29801
30668
  targets: TargetsField.optional(),
29802
30669
  template: TimelapseTemplateSchema.nullable().optional(),
30670
+ previewText: PreviewTextField.optional(),
30671
+ previewMode: PreviewModeField.optional(),
30672
+ reportClasses: ReportClassesField.optional(),
29803
30673
  priority: PriorityField.optional()
29804
30674
  });
29805
30675
  TimelapseRuleInputSchema.extend({
@@ -29811,10 +30681,28 @@ TimelapseRuleInputSchema.extend({
29811
30681
  */
29812
30682
  ownerUserId: string().optional(),
29813
30683
  /**
29814
- * Epoch-ms of the last successful generation the 1-hour re-generation
29815
- * guard's durable state (predecessor parity). Absent = never generated.
30684
+ * Epoch-ms of the NEWEST successful generation across every camera of this
30685
+ * rule. What a UI shows, and the compatibility floor for
30686
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
29816
30687
  */
29817
30688
  lastGeneratedAt: number().optional(),
30689
+ /**
30690
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
30691
+ * re-generation guard's real durable state.
30692
+ *
30693
+ * One rule covers several cameras and each renders its own video, so a rule
30694
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
30695
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
30696
+ * already done — and B's night is gone for good, because the window will not
30697
+ * come back.
30698
+ *
30699
+ * ADDITIVE, so the migration is free: a row written before this field simply
30700
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
30701
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
30702
+ * "never generated" would re-render and re-notify every camera of every rule
30703
+ * once, on the deploy that shipped the map.
30704
+ */
30705
+ generatedByDevice: record(string(), number()).optional(),
29818
30706
  /** userId of the caller who created the rule (server-stamped). */
29819
30707
  createdBy: string(),
29820
30708
  createdAt: number(),