@camstack/types 1.2.131 → 1.2.132

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2345,6 +2345,13 @@ var MediaRelocateModeSchema = zod.z.enum([
2345
2345
  ]);
2346
2346
  var RelocateMediaInputSchema = zod.z.object({
2347
2347
  toLocationId: zod.z.string(),
2348
+ /**
2349
+ * Restrict the pass to rows currently on this location. Omitted / `'*'` =
2350
+ * every row that is not already on `toLocationId` (the historical
2351
+ * behaviour). A named source is what a from→to migration needs: without it
2352
+ * "move events off disk 2" also emptied disk 1.
2353
+ */
2354
+ fromLocationId: zod.z.string().optional(),
2348
2355
  throttleMbps: zod.z.number().min(1).max(1e3).optional(),
2349
2356
  /** Omitted = `move`, the pre-existing behaviour. */
2350
2357
  mode: MediaRelocateModeSchema.optional()
@@ -2412,6 +2419,19 @@ var StorageMigrationDestinationsSchema = zod.z.object({
2412
2419
  galleryMedia: zod.z.string().min(1).optional()
2413
2420
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
2414
2421
  /**
2422
+ * Optional named source per class. Omitted = the class's current default
2423
+ * (the historical behaviour). A named source that is NOT the default is a
2424
+ * drain of that disk: bytes move, the default stays, and the source is
2425
+ * disabled when the move finishes.
2426
+ */
2427
+ var StorageMigrationSourcesSchema = zod.z.object({
2428
+ recordings: zod.z.string().min(1).optional(),
2429
+ recordingsLow: zod.z.string().min(1).optional(),
2430
+ eventMedia: zod.z.string().min(1).optional(),
2431
+ backups: zod.z.string().min(1).optional(),
2432
+ galleryMedia: zod.z.string().min(1).optional()
2433
+ }).optional();
2434
+ /**
2415
2435
  * How a migration sequences the cutover against the byte move.
2416
2436
  *
2417
2437
  * - `blocking` — the historical order: pause, move every byte, repoint,
@@ -2433,6 +2453,8 @@ var StorageMigrationModeSchema = zod.z.enum(["blocking", "nonBlocking"]);
2433
2453
  /** Shared input for planning and starting an orchestrated storage migration. */
2434
2454
  var StorageMigrationInputSchema = zod.z.object({
2435
2455
  destinations: StorageMigrationDestinationsSchema,
2456
+ /** Omitted = each class's current default. */
2457
+ sources: StorageMigrationSourcesSchema,
2436
2458
  throttleMbps: zod.z.number().min(1).max(1e3).optional(),
2437
2459
  /** Omitted = `blocking`, which stays the default. */
2438
2460
  mode: StorageMigrationModeSchema.optional()
@@ -2512,6 +2534,13 @@ var StorageMigrationMoveSchema = zod.z.object({
2512
2534
  storageClass: StorageMigrationClassSchema,
2513
2535
  fromLocationId: zod.z.string(),
2514
2536
  toLocationId: zod.z.string(),
2537
+ /**
2538
+ * True when `from` was NOT the class default at plan time. The move still
2539
+ * copies bytes, but the default is left alone and the source is disabled
2540
+ * once the copy verifies. Absent on jobs planned before this field existed
2541
+ * — those jobs always repointed, which is `false`.
2542
+ */
2543
+ freezeSource: zod.z.boolean().optional(),
2515
2544
  moverJobId: zod.z.string().nullable(),
2516
2545
  state: RelocateJobStateSchema.nullable(),
2517
2546
  error: zod.z.string().nullable(),
@@ -2525,6 +2554,7 @@ var StorageMigrationJobSchema = zod.z.object({
2525
2554
  * can tell a seconds-long cutover from a thirty-hour one. */
2526
2555
  mode: StorageMigrationModeSchema,
2527
2556
  destinations: StorageMigrationDestinationsSchema,
2557
+ sources: StorageMigrationSourcesSchema,
2528
2558
  throttleMbps: zod.z.number(),
2529
2559
  moves: zod.z.array(StorageMigrationMoveSchema),
2530
2560
  pauseLeaseId: zod.z.string().nullable(),
@@ -2574,6 +2604,7 @@ var StorageMigrationFindingSchema = zod.z.object({
2574
2604
  });
2575
2605
  var StorageMigrationPlanSchema = zod.z.object({
2576
2606
  destinations: StorageMigrationDestinationsSchema,
2607
+ sources: StorageMigrationSourcesSchema,
2577
2608
  /** The mode this plan was built for. A plan is only valid for its mode: the
2578
2609
  * `eventMedia` seal gate and the single-cardinality refusal both depend on
2579
2610
  * it. */
@@ -2581,7 +2612,8 @@ var StorageMigrationPlanSchema = zod.z.object({
2581
2612
  moves: zod.z.array(zod.z.object({
2582
2613
  storageClass: StorageMigrationClassSchema,
2583
2614
  fromLocationId: zod.z.string(),
2584
- toLocationId: zod.z.string()
2615
+ toLocationId: zod.z.string(),
2616
+ freezeSource: zod.z.boolean().optional()
2585
2617
  })),
2586
2618
  findings: zod.z.array(StorageMigrationFindingSchema)
2587
2619
  });
@@ -2768,9 +2800,50 @@ var LedgerWalkReportSchema = zod.z.object({
2768
2800
  var RelocatableMediaCountSchema = zod.z.object({ rows: zod.z.number().int().nonnegative() }).nullable();
2769
2801
  var RelocatableMediaCountInputSchema = zod.z.object({
2770
2802
  toLocationId: zod.z.string().min(1),
2803
+ /** Restrict the count to one source; omitted / `'*'` = every non-target row. */
2804
+ fromLocationId: zod.z.string().optional(),
2771
2805
  /** Omitted = `move`. */
2772
2806
  mode: MediaRelocateModeSchema.optional()
2773
2807
  });
2808
+ /**
2809
+ * Operator cleanup of leftover analytics rows, optional debug media, and
2810
+ * ghost ledger entries on frozen footage locations.
2811
+ *
2812
+ * A pass is tens of minutes on a standing backlog. The hub method RETURNS
2813
+ * `{ jobId }` immediately; progress is `cleanupStatus`. Awaiting the work
2814
+ * is how `addons.custom` hit the 60 s UDS deadline while reclaim continued
2815
+ * with no operator-visible status.
2816
+ */
2817
+ var StorageCleanupPhaseSchema = zod.z.enum([
2818
+ "orphans",
2819
+ "debug-media",
2820
+ "ghost-ledger",
2821
+ "done",
2822
+ "failed",
2823
+ "cancelled"
2824
+ ]);
2825
+ var StorageCleanupInputSchema = zod.z.object({
2826
+ /** Also walk motion stills / track filmstrips. Off by default. */
2827
+ includeDebugMedia: zod.z.boolean().optional() });
2828
+ var StorageCleanupJobSchema = zod.z.object({
2829
+ jobId: zod.z.string(),
2830
+ phase: StorageCleanupPhaseSchema,
2831
+ includeDebugMedia: zod.z.boolean(),
2832
+ orphansReclaimed: zod.z.number().int().nonnegative(),
2833
+ orphanBytesReclaimed: zod.z.number().int().nonnegative(),
2834
+ debugMediaReclaimed: zod.z.number().int().nonnegative(),
2835
+ debugMediaBytesReclaimed: zod.z.number().int().nonnegative(),
2836
+ ghostsForgotten: zod.z.number().int().nonnegative(),
2837
+ ghostBytesForgotten: zod.z.number().int().nonnegative(),
2838
+ /** Short operator-facing line: current collection, pass, or location. */
2839
+ detail: zod.z.string().nullable(),
2840
+ cancelRequested: zod.z.boolean(),
2841
+ startedAt: zod.z.number(),
2842
+ updatedAt: zod.z.number(),
2843
+ finishedAt: zod.z.number().nullable(),
2844
+ error: zod.z.string().nullable()
2845
+ });
2846
+ var StorageCleanupStatusInputSchema = zod.z.object({ jobId: zod.z.string().optional() });
2774
2847
  //#endregion
2775
2848
  //#region src/interfaces/server-analysis.ts
2776
2849
  var SUB_DETECTION_TYPES = ["face", "plate"];
@@ -2810,11 +2883,10 @@ var StorageLocationTypeSchema = zod.z.string().regex(/^[a-z][a-zA-Z0-9-]*$/);
2810
2883
  * The default location for a type uses `id === <type>:default` by
2811
2884
  * convention (the bare type ref like `'backups'` resolves to it).
2812
2885
  *
2813
- * `isSystem: true` marks a location as orchestrator-seeded and
2814
- * undeletable. The bootstrap-installed defaults (one per type) carry
2815
- * this flag; operator-added locations don't. Editing the config of
2816
- * a system location is allowed (path migration, provider swap) but
2817
- * deleting it is rejected at the cap level.
2886
+ * `isSystem` is a legacy persisted flag. Seed still creates the initial
2887
+ * `<type>:default` locations; the flag is no longer a lock, a badge, or a
2888
+ * prune selector. New writes leave it false. Deletion is gated on uniqueness
2889
+ * / last-enabled, not on this bit.
2818
2890
  */
2819
2891
  var StorageLocationSchema = zod.z.object({
2820
2892
  id: zod.z.string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
@@ -22648,7 +22720,23 @@ var storageMigrationCapability = {
22648
22720
  drain: require_sleep.method(StorageMigrationDrainInputSchema, zod.z.object({ jobId: zod.z.string() }), {
22649
22721
  kind: "mutation",
22650
22722
  auth: "admin"
22651
- })
22723
+ }),
22724
+ /**
22725
+ * One operator cleanup of leftover analytics (DB + blobs) and ghost
22726
+ * ledger rows on frozen footage locations. Optional debug-media sweep.
22727
+ * Returns immediately; poll {@link cleanupStatus}.
22728
+ */
22729
+ cleanupStart: require_sleep.method(StorageCleanupInputSchema, zod.z.object({ jobId: zod.z.string() }), {
22730
+ kind: "mutation",
22731
+ auth: "admin"
22732
+ }),
22733
+ cleanupStatus: require_sleep.method(StorageCleanupStatusInputSchema, StorageCleanupJobSchema.nullable(), { auth: "admin" }),
22734
+ cleanupCancel: require_sleep.method(zod.z.object({ jobId: zod.z.string() }), zod.z.object({ cancelled: zod.z.boolean() }), {
22735
+ kind: "mutation",
22736
+ auth: "admin"
22737
+ }),
22738
+ /** Recent finished migration jobs, newest first. The live job is `status`. */
22739
+ history: require_sleep.method(zod.z.object({}), zod.z.array(StorageMigrationJobSchema).readonly(), { auth: "admin" })
22652
22740
  }
22653
22741
  };
22654
22742
  //#endregion
@@ -31185,6 +31273,33 @@ var RecordingRebalanceInputSchema = zod.z.object({
31185
31273
  minMoveGb: zod.z.number().min(0).optional()
31186
31274
  });
31187
31275
  /**
31276
+ * Operator-facing placement of one camera onto a recordings location.
31277
+ *
31278
+ * `pinLocationId` is the operator instruction: a location id, or `null` for
31279
+ * Auto (the planner may move this camera). `locationId` is where high/mid
31280
+ * currently write — the plan, which may disagree with the pin when Auto.
31281
+ */
31282
+ var RecordingDevicePlacementSchema = zod.z.object({
31283
+ deviceId: zod.z.number().int(),
31284
+ profile: zod.z.string(),
31285
+ locationId: zod.z.string()
31286
+ });
31287
+ var RecordingDevicePinSchema = zod.z.object({
31288
+ deviceId: zod.z.number().int(),
31289
+ /** Recordings-class location this camera is pinned to. */
31290
+ locationId: zod.z.string()
31291
+ });
31292
+ var RecordingPlacementViewSchema = zod.z.object({
31293
+ assignments: zod.z.array(RecordingDevicePlacementSchema),
31294
+ pins: zod.z.array(RecordingDevicePinSchema),
31295
+ defaultLocations: zod.z.record(zod.z.string(), zod.z.string())
31296
+ });
31297
+ var RecordingSetDevicePlacementInputSchema = zod.z.object({
31298
+ deviceId: zod.z.number().int(),
31299
+ /** `null` = Auto. Otherwise a `recordings:*` location id. */
31300
+ locationId: zod.z.string().nullable()
31301
+ });
31302
+ /**
31188
31303
  * Result of locating footage at a wall-clock instant for one device/profile.
31189
31304
  * `segment` carries the covering segment's window; `gap` reports the forward
31190
31305
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -31537,6 +31652,22 @@ var recordingCapability = {
31537
31652
  startStorageRebalance: require_sleep.method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
31538
31653
  kind: "mutation",
31539
31654
  auth: "admin"
31655
+ }),
31656
+ /**
31657
+ * The placement plan in force plus operator pins. Drives the Locations
31658
+ * admin page: Auto vs a named recordings location, per camera.
31659
+ */
31660
+ getPlacement: require_sleep.method(zod.z.object({}), RecordingPlacementViewSchema, {
31661
+ kind: "query",
31662
+ auth: "admin"
31663
+ }),
31664
+ /**
31665
+ * Pin a camera to a recordings location, or clear the pin (Auto). High and
31666
+ * mid follow the pin; low stays with the recordingsLow planner.
31667
+ */
31668
+ setDevicePlacement: require_sleep.method(RecordingSetDevicePlacementInputSchema, zod.z.object({ ok: zod.z.literal(true) }), {
31669
+ kind: "mutation",
31670
+ auth: "admin"
31540
31671
  })
31541
31672
  }
31542
31673
  };
@@ -43020,6 +43151,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
43020
43151
  addonId: null,
43021
43152
  access: "view"
43022
43153
  },
43154
+ "recording.getPlacement": {
43155
+ capName: "recording",
43156
+ capScope: "system",
43157
+ addonId: null,
43158
+ access: "view"
43159
+ },
43023
43160
  "recording.getPlaybackManifest": {
43024
43161
  capName: "recording",
43025
43162
  capScope: "system",
@@ -43146,6 +43283,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
43146
43283
  addonId: null,
43147
43284
  access: "create"
43148
43285
  },
43286
+ "recording.setDevicePlacement": {
43287
+ capName: "recording",
43288
+ capScope: "system",
43289
+ addonId: null,
43290
+ access: "create"
43291
+ },
43149
43292
  "recording.startStorageMigrationMove": {
43150
43293
  capName: "recording",
43151
43294
  capScope: "system",
@@ -43590,12 +43733,36 @@ var METHOD_ACCESS_MAP = Object.freeze({
43590
43733
  addonId: null,
43591
43734
  access: "create"
43592
43735
  },
43736
+ "storageMigration.cleanupCancel": {
43737
+ capName: "storage-migration",
43738
+ capScope: "system",
43739
+ addonId: null,
43740
+ access: "create"
43741
+ },
43742
+ "storageMigration.cleanupStart": {
43743
+ capName: "storage-migration",
43744
+ capScope: "system",
43745
+ addonId: null,
43746
+ access: "create"
43747
+ },
43748
+ "storageMigration.cleanupStatus": {
43749
+ capName: "storage-migration",
43750
+ capScope: "system",
43751
+ addonId: null,
43752
+ access: "view"
43753
+ },
43593
43754
  "storageMigration.drain": {
43594
43755
  capName: "storage-migration",
43595
43756
  capScope: "system",
43596
43757
  addonId: null,
43597
43758
  access: "create"
43598
43759
  },
43760
+ "storageMigration.history": {
43761
+ capName: "storage-migration",
43762
+ capScope: "system",
43763
+ addonId: null,
43764
+ access: "view"
43765
+ },
43599
43766
  "storageMigration.movers": {
43600
43767
  capName: "storage-migration",
43601
43768
  capScope: "system",
@@ -46345,6 +46512,11 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
46345
46512
  form: "single",
46346
46513
  optional: false
46347
46514
  }],
46515
+ "recording.setDevicePlacement": [{
46516
+ name: "deviceId",
46517
+ form: "single",
46518
+ optional: false
46519
+ }],
46348
46520
  "recording.startStorageMigrationMove": [{
46349
46521
  name: "deviceId",
46350
46522
  form: "single",
@@ -46816,6 +46988,7 @@ var SYSTEM_SCOPE_DEVICE_METHODS = [
46816
46988
  "recording.renderGif",
46817
46989
  "recording.rescanStorage",
46818
46990
  "recording.setDeviceConfig",
46991
+ "recording.setDevicePlacement",
46819
46992
  "recording.startStorageMigrationMove",
46820
46993
  "recordingExport.createExport",
46821
46994
  "recordingExport.listExports",
@@ -47744,7 +47917,9 @@ function createSystemProxy(api) {
47744
47917
  reconcileLedgerAgainstDisk: (input) => dispatch("recording", "reconcileLedgerAgainstDisk", "mutation", input),
47745
47918
  cancelRelocateJob: (input) => dispatch("recording", "cancelRelocateJob", "mutation", input),
47746
47919
  planStorageRebalance: (input) => dispatch("recording", "planStorageRebalance", "query", input),
47747
- startStorageRebalance: (input) => dispatch("recording", "startStorageRebalance", "mutation", input)
47920
+ startStorageRebalance: (input) => dispatch("recording", "startStorageRebalance", "mutation", input),
47921
+ getPlacement: (input) => dispatch("recording", "getPlacement", "query", input),
47922
+ setDevicePlacement: (input) => dispatch("recording", "setDevicePlacement", "mutation", input)
47748
47923
  },
47749
47924
  recordingExport: {
47750
47925
  createExport: (input) => dispatch("recordingExport", "createExport", "mutation", input),
@@ -47808,7 +47983,11 @@ function createSystemProxy(api) {
47808
47983
  cancel: (input) => dispatch("storageMigration", "cancel", "mutation", input),
47809
47984
  movers: (input) => dispatch("storageMigration", "movers", "query", input),
47810
47985
  residue: (input) => dispatch("storageMigration", "residue", "query", input),
47811
- drain: (input) => dispatch("storageMigration", "drain", "mutation", input)
47986
+ drain: (input) => dispatch("storageMigration", "drain", "mutation", input),
47987
+ cleanupStart: (input) => dispatch("storageMigration", "cleanupStart", "mutation", input),
47988
+ cleanupStatus: (input) => dispatch("storageMigration", "cleanupStatus", "query", input),
47989
+ cleanupCancel: (input) => dispatch("storageMigration", "cleanupCancel", "mutation", input),
47990
+ history: (input) => dispatch("storageMigration", "history", "query", input)
47812
47991
  },
47813
47992
  streamBroker: {
47814
47993
  fetchEventMedia: (input) => dispatch("streamBroker", "fetchEventMedia", "mutation", input),
@@ -52715,6 +52894,10 @@ exports.StorageBeginDownloadInputSchema = BeginDownloadInputSchema;
52715
52894
  exports.StorageBeginDownloadResultSchema = BeginDownloadResultSchema;
52716
52895
  exports.StorageBeginUploadInputSchema = BeginUploadInputSchema;
52717
52896
  exports.StorageBeginUploadResultSchema = BeginUploadResultSchema;
52897
+ exports.StorageCleanupInputSchema = StorageCleanupInputSchema;
52898
+ exports.StorageCleanupJobSchema = StorageCleanupJobSchema;
52899
+ exports.StorageCleanupPhaseSchema = StorageCleanupPhaseSchema;
52900
+ exports.StorageCleanupStatusInputSchema = StorageCleanupStatusInputSchema;
52718
52901
  exports.StorageEndDownloadInputSchema = EndDownloadInputSchema;
52719
52902
  exports.StorageFinalizeUploadInputSchema = FinalizeUploadInputSchema;
52720
52903
  exports.StorageLocationDeclarationSchema = StorageLocationDeclarationSchema;
@@ -52740,6 +52923,7 @@ exports.StorageMigrationParticipantSchema = StorageMigrationParticipantSchema;
52740
52923
  exports.StorageMigrationPhaseSchema = StorageMigrationPhaseSchema;
52741
52924
  exports.StorageMigrationPlanSchema = StorageMigrationPlanSchema;
52742
52925
  exports.StorageMigrationResidueSchema = StorageMigrationResidueSchema;
52926
+ exports.StorageMigrationSourcesSchema = StorageMigrationSourcesSchema;
52743
52927
  exports.StorageProviderInfoSchema = ProviderInfoSchema;
52744
52928
  exports.StorageReadChunkInputSchema = ReadChunkInputSchema;
52745
52929
  exports.StorageTestLocationResultSchema = TestLocationResultSchema;