@camstack/types 1.2.134 → 1.2.136

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.
@@ -41,6 +41,65 @@ export declare const RecordingDaysSchema: z.ZodObject<{
41
41
  days: z.ZodArray<z.ZodNumber>;
42
42
  }, z.core.$strip>;
43
43
  export type RecordingDays = z.infer<typeof RecordingDaysSchema>;
44
+ /**
45
+ * Most cameras one `getAvailabilityBatch` / `getDaysWithRecordingsBatch` may
46
+ * name.
47
+ *
48
+ * Matches the ceiling the per-camera batches elsewhere in the system carry
49
+ * (`pipelineAnalytics.getKeyEventsBatch`, `sceneMonitor.listScenesBatch`): a
50
+ * grid is tens of cameras, never hundreds, and each id costs the recorder one
51
+ * calendar walk whose answer crosses a process boundary.
52
+ *
53
+ * The ceiling is on the SCHEMA. An over-eager ask is REFUSED, never truncated
54
+ * to the first {@link RECORDING_TIMELINE_BATCH_MAX} ids — a truncated answer
55
+ * looks exactly like a complete one, and the caller would draw an empty
56
+ * timeline for the cameras it never learned were dropped.
57
+ */
58
+ export declare const RECORDING_TIMELINE_BATCH_MAX = 200;
59
+ /**
60
+ * One camera's row in a `getAvailabilityBatch` answer.
61
+ *
62
+ * `ranges` is EXACTLY what `getAvailability` returns for that camera — the
63
+ * batch collapses the transport, not the work — plus the one thing the singular
64
+ * method never had to say:
65
+ *
66
+ * - `read: 'read'` — answered. `ranges: []` means "read, and this camera has
67
+ * no footage in the window", which is a real claim.
68
+ * - `read: 'unreadable'` — the recorder could not answer for this camera (its
69
+ * calendar rung threw, its location is unmounted). `ranges` is empty and
70
+ * that emptiness means NOTHING.
71
+ *
72
+ * A timeline that renders the second as the first tells an operator there is no
73
+ * footage when the truth is that nobody looked.
74
+ */
75
+ export declare const RecordingAvailabilityForDeviceSchema: z.ZodObject<{
76
+ deviceId: z.ZodNumber;
77
+ read: z.ZodEnum<{
78
+ read: "read";
79
+ unreadable: "unreadable";
80
+ }>;
81
+ ranges: z.ZodReadonly<z.ZodArray<z.ZodObject<{
82
+ profile: z.ZodString;
83
+ startMs: z.ZodNumber;
84
+ endMs: z.ZodNumber;
85
+ }, z.core.$strip>>>;
86
+ }, z.core.$strip>;
87
+ export type RecordingAvailabilityForDevice = z.infer<typeof RecordingAvailabilityForDeviceSchema>;
88
+ /**
89
+ * One camera's row in a `getDaysWithRecordingsBatch` answer. Same rule as
90
+ * {@link RecordingAvailabilityForDeviceSchema}: `days: []` on a `'read'` row is
91
+ * "no footage in this month", `read: 'unreadable'` is "nobody could look", and
92
+ * the date-picker's day dots must not spell them the same.
93
+ */
94
+ export declare const RecordingDaysForDeviceSchema: z.ZodObject<{
95
+ deviceId: z.ZodNumber;
96
+ read: z.ZodEnum<{
97
+ read: "read";
98
+ unreadable: "unreadable";
99
+ }>;
100
+ days: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
101
+ }, z.core.$strip>;
102
+ export type RecordingDaysForDevice = z.infer<typeof RecordingDaysForDeviceSchema>;
44
103
  export declare const RecordingManifestSchema: z.ZodObject<{
45
104
  deviceId: z.ZodNumber;
46
105
  localMasterPath: z.ZodNullable<z.ZodString>;
@@ -298,6 +357,40 @@ export declare const recordingCapability: {
298
357
  endMs: z.ZodNumber;
299
358
  }, z.core.$strip>>;
300
359
  }, z.core.$strip>, "query">;
360
+ /**
361
+ * `getAvailability` for a SET of cameras, in one round trip.
362
+ *
363
+ * A multi-camera timeline re-asks availability for every camera in the grid
364
+ * on every day change; fanned out that is one request per camera for N
365
+ * independent calendar walks. The per-camera work is IDENTICAL (the same
366
+ * `availabilityProfileFor` + `rangesIn`, run concurrently inside the
367
+ * recorder) — only the transport collapses.
368
+ *
369
+ * `protected` for the same reason the singular method is: every id in
370
+ * `deviceIds` is a device reference, so the F1 #3 gate refuses any camera
371
+ * outside the caller's scope — one id out of scope refuses the CALL, it
372
+ * does not quietly drop a row.
373
+ *
374
+ * Every requested id gets a row, marked — see
375
+ * {@link RecordingAvailabilityForDeviceSchema}. `deviceIds` is capped at
376
+ * {@link RECORDING_TIMELINE_BATCH_MAX} and an over-cap ask is refused.
377
+ */
378
+ readonly getAvailabilityBatch: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
379
+ deviceIds: z.ZodArray<z.ZodNumber>;
380
+ fromMs: z.ZodNumber;
381
+ toMs: z.ZodNumber;
382
+ }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
383
+ deviceId: z.ZodNumber;
384
+ read: z.ZodEnum<{
385
+ read: "read";
386
+ unreadable: "unreadable";
387
+ }>;
388
+ ranges: z.ZodReadonly<z.ZodArray<z.ZodObject<{
389
+ profile: z.ZodString;
390
+ startMs: z.ZodNumber;
391
+ endMs: z.ZodNumber;
392
+ }, z.core.$strip>>>;
393
+ }, z.core.$strip>>>, "query">;
301
394
  /** Which calendar days in [fromMs,toMs) have ≥1 recorded segment, bucketed by
302
395
  * the client's local day (`tzOffsetMinutes` = minutes to add to UTC). Drives
303
396
  * the theater date-picker's day dots. */
@@ -310,6 +403,30 @@ export declare const recordingCapability: {
310
403
  deviceId: z.ZodNumber;
311
404
  days: z.ZodArray<z.ZodNumber>;
312
405
  }, z.core.$strip>, "query">;
406
+ /**
407
+ * `getDaysWithRecordings` for a SET of cameras, in one round trip.
408
+ *
409
+ * The cheapest question in the product, asked once per camera per month
410
+ * change. One directory read per day per camera at the owner, unchanged;
411
+ * what collapses is the N requests it took to ask.
412
+ *
413
+ * Every requested id gets a row, marked — see
414
+ * {@link RecordingDaysForDeviceSchema}. `deviceIds` is capped at
415
+ * {@link RECORDING_TIMELINE_BATCH_MAX} and an over-cap ask is refused.
416
+ */
417
+ readonly getDaysWithRecordingsBatch: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
418
+ deviceIds: z.ZodArray<z.ZodNumber>;
419
+ fromMs: z.ZodNumber;
420
+ toMs: z.ZodNumber;
421
+ tzOffsetMinutes: z.ZodNumber;
422
+ }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
423
+ deviceId: z.ZodNumber;
424
+ read: z.ZodEnum<{
425
+ read: "read";
426
+ unreadable: "unreadable";
427
+ }>;
428
+ days: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
429
+ }, z.core.$strip>>>, "query">;
313
430
  readonly getPlaybackManifest: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
314
431
  deviceId: z.ZodNumber;
315
432
  fromMs: z.ZodNumber;
@@ -546,6 +663,7 @@ export declare const recordingCapability: {
546
663
  retention: "retention";
547
664
  quota: "quota";
548
665
  maintenance: "maintenance";
666
+ "orphaned-device": "orphaned-device";
549
667
  }>>;
550
668
  }, z.core.$strip>, z.ZodObject<{
551
669
  floorMs: z.ZodNullable<z.ZodNumber>;
@@ -592,6 +710,7 @@ export declare const recordingCapability: {
592
710
  retention: "retention";
593
711
  quota: "quota";
594
712
  maintenance: "maintenance";
713
+ "orphaned-device": "orphaned-device";
595
714
  }>;
596
715
  deviceId: z.ZodNullable<z.ZodNumber>;
597
716
  nodeId: z.ZodString;
@@ -2040,6 +2040,13 @@ export type AppRouter = TrpcCoreRouter<{
2040
2040
  output: z.infer<typeof deviceManagerCapability.methods.allocateDeviceId.output>;
2041
2041
  meta: object;
2042
2042
  }>;
2043
+ migrateDevice: TRPCMutationProcedure<{
2044
+ input: {
2045
+ [x: string]: unknown;
2046
+ } & z.input<typeof deviceManagerCapability.methods.migrateDevice.input>;
2047
+ output: z.infer<typeof deviceManagerCapability.methods.migrateDevice.output>;
2048
+ meta: object;
2049
+ }>;
2043
2050
  registerDevice: TRPCMutationProcedure<{
2044
2051
  input: {
2045
2052
  [x: string]: unknown;
@@ -5009,6 +5016,13 @@ export type AppRouter = TrpcCoreRouter<{
5009
5016
  output: z.infer<typeof pipelineAnalyticsCapability.methods.getEventDensity.output>;
5010
5017
  meta: object;
5011
5018
  }>;
5019
+ getEventDensityBatch: TRPCQueryProcedure<{
5020
+ input: {
5021
+ [x: string]: unknown;
5022
+ } & z.input<typeof pipelineAnalyticsCapability.methods.getEventDensityBatch.input>;
5023
+ output: z.infer<typeof pipelineAnalyticsCapability.methods.getEventDensityBatch.output>;
5024
+ meta: object;
5025
+ }>;
5012
5026
  pruneEventsBefore: TRPCMutationProcedure<{
5013
5027
  input: {
5014
5028
  [x: string]: unknown;
@@ -6452,6 +6466,13 @@ export type AppRouter = TrpcCoreRouter<{
6452
6466
  output: z.infer<typeof recordingCapability.methods.getAvailability.output>;
6453
6467
  meta: object;
6454
6468
  }>;
6469
+ getAvailabilityBatch: TRPCQueryProcedure<{
6470
+ input: {
6471
+ [x: string]: unknown;
6472
+ } & z.input<typeof recordingCapability.methods.getAvailabilityBatch.input>;
6473
+ output: z.infer<typeof recordingCapability.methods.getAvailabilityBatch.output>;
6474
+ meta: object;
6475
+ }>;
6455
6476
  getDaysWithRecordings: TRPCQueryProcedure<{
6456
6477
  input: {
6457
6478
  [x: string]: unknown;
@@ -6459,6 +6480,13 @@ export type AppRouter = TrpcCoreRouter<{
6459
6480
  output: z.infer<typeof recordingCapability.methods.getDaysWithRecordings.output>;
6460
6481
  meta: object;
6461
6482
  }>;
6483
+ getDaysWithRecordingsBatch: TRPCQueryProcedure<{
6484
+ input: {
6485
+ [x: string]: unknown;
6486
+ } & z.input<typeof recordingCapability.methods.getDaysWithRecordingsBatch.input>;
6487
+ output: z.infer<typeof recordingCapability.methods.getDaysWithRecordingsBatch.output>;
6488
+ meta: object;
6489
+ }>;
6462
6490
  getPlaybackManifest: TRPCQueryProcedure<{
6463
6491
  input: {
6464
6492
  [x: string]: unknown;
@@ -9769,7 +9797,11 @@ export type AppRouter = TrpcCoreRouter<{
9769
9797
  nodeId: string;
9770
9798
  };
9771
9799
  output: {
9772
- success: boolean;
9800
+ forgotten: boolean;
9801
+ historyRemoved: boolean;
9802
+ registryRemoved: boolean;
9803
+ stillListed: boolean;
9804
+ message: string;
9773
9805
  };
9774
9806
  meta: object;
9775
9807
  }>;
@@ -9788,7 +9820,11 @@ export type AppRouter = TrpcCoreRouter<{
9788
9820
  nodeId: string;
9789
9821
  };
9790
9822
  output: {
9791
- success: boolean;
9823
+ forgotten: boolean;
9824
+ historyRemoved: boolean;
9825
+ registryRemoved: boolean;
9826
+ stillListed: boolean;
9827
+ message: string;
9792
9828
  };
9793
9829
  meta: object;
9794
9830
  }>;
@@ -6,7 +6,7 @@
6
6
  * scope+access check inside `protectedProcedure` (see
7
7
  * `server/backend/src/api/trpc/trpc.middleware.ts`).
8
8
  *
9
- * Coverage: 999 method paths across 126 capabilities.
9
+ * Coverage: 1003 method paths across 126 capabilities.
10
10
  */
11
11
  import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
12
12
  export interface MethodAccessRecord {
@@ -6,8 +6,8 @@
6
6
  * system-scope cap that takes a deviceId was previously never device-filtered
7
7
  * — see the generator header).
8
8
  *
9
- * Coverage: 351 methods carry a device reference, of which
10
- * 131 are on SYSTEM-scope caps.
9
+ * Coverage: 354 methods carry a device reference, of which
10
+ * 133 are on SYSTEM-scope caps.
11
11
  *
12
12
  * Top-level fields, number arrays, and one-level arrays of objects carrying
13
13
  * a numeric device field (targets[].deviceId) are all mapped; the matcher
@@ -68,7 +68,7 @@ export interface SystemProxy {
68
68
  readonly decoder: Pick<InferProvider<typeof decoderCapability>, 'supportsCodec' | 'getInfo' | 'createSession' | 'destroySession' | 'pushPacket' | 'openStream' | 'pullFrames' | 'pullHandles' | 'getFrame' | 'getShmStats' | 'updateConfig' | 'getStats' | 'listActiveSessions' | 'reprobeHwaccel'>;
69
69
  readonly deviceAdoption: Pick<InferProvider<typeof deviceAdoptionCapability>, 'listCandidateFilters' | 'listCandidates' | 'getCandidate' | 'refresh' | 'adopt' | 'release' | 'resync'>;
70
70
  readonly deviceExport: Pick<InferProvider<typeof deviceExportCapability>, 'getStatus' | 'listSupportedDeviceKinds' | 'listExposedDevices' | 'exposeDevice' | 'unexposeDevice'>;
71
- readonly deviceManager: Pick<InferProvider<typeof deviceManagerCapability>, 'allocateDeviceId' | 'registerDevice' | 'removeDevice' | 'persistConfig' | 'getRoleDisplayDefaults' | 'setRoleDisplayDefaults' | 'listLocations' | 'addLocation' | 'removeLocation' | 'renameLocation' | 'listPersistedByAddon' | 'listAll' | 'getChildren' | 'getChildrenBatch' | 'getLinkedDevicesBatch' | 'removeByIntegration' | 'getBindingsBatch' | 'getAllBindings' | 'listWrappersForCap' | 'listBindableCapsForDeviceType' | 'discoverDevices' | 'adoptDevice' | 'getCreationSchema' | 'createDevice' | 'testCreationField' | 'adoptionListCandidateFilters' | 'adoptionListCandidates' | 'adoptionRefresh' | 'adoptionAdopt' | 'adoptionRelease' | 'adoptionStartJob' | 'adoptionListJobs' | 'adoptionCancelJob' | 'adoptionResync' | 'discoveryProviders' | 'discoverAllProviders' | 'discoverProvider' | 'providerCreationType' | 'providerDiscoveryParamsSchema' | 'getDeviceStatusAggregateBatch'>;
71
+ readonly deviceManager: Pick<InferProvider<typeof deviceManagerCapability>, 'allocateDeviceId' | 'migrateDevice' | 'registerDevice' | 'removeDevice' | 'persistConfig' | 'getRoleDisplayDefaults' | 'setRoleDisplayDefaults' | 'listLocations' | 'addLocation' | 'removeLocation' | 'renameLocation' | 'listPersistedByAddon' | 'listAll' | 'getChildren' | 'getChildrenBatch' | 'getLinkedDevicesBatch' | 'removeByIntegration' | 'getBindingsBatch' | 'getAllBindings' | 'listWrappersForCap' | 'listBindableCapsForDeviceType' | 'discoverDevices' | 'adoptDevice' | 'getCreationSchema' | 'createDevice' | 'testCreationField' | 'adoptionListCandidateFilters' | 'adoptionListCandidates' | 'adoptionRefresh' | 'adoptionAdopt' | 'adoptionRelease' | 'adoptionStartJob' | 'adoptionListJobs' | 'adoptionCancelJob' | 'adoptionResync' | 'discoveryProviders' | 'discoverAllProviders' | 'discoverProvider' | 'providerCreationType' | 'providerDiscoveryParamsSchema' | 'getDeviceStatusAggregateBatch'>;
72
72
  readonly deviceProvider: Pick<InferProvider<typeof deviceProviderCapability>, 'start' | 'stop' | 'getStatus' | 'getDevices' | 'supportsDiscovery' | 'discoverDevices' | 'getDiscoveryParamsSchema' | 'getManualCreationType' | 'adoptDiscoveredDevice' | 'supportsManualCreation' | 'getChildCreationSchema' | 'createDevice' | 'testCreationField'>;
73
73
  readonly deviceState: Pick<InferProvider<typeof deviceStateCapability>, 'getAllSnapshots'>;
74
74
  readonly faceGallery: Pick<InferProvider<typeof faceGalleryCapability>, 'listIdentities' | 'createIdentity' | 'renameIdentity' | 'deleteIdentity' | 'listIdentitySamples' | 'removeSample' | 'getFaceMedia' | 'assignFace' | 'unassignFace' | 'deleteFace' | 'assignFaces' | 'unassignFaces' | 'suggestFaceClusters'>;
@@ -87,7 +87,7 @@ export interface SystemProxy {
87
87
  readonly pipelineOrchestrator: Pick<InferProvider<typeof pipelineOrchestratorCapability>, 'pauseForStorageMigration' | 'resumeForStorageMigration' | 'rebalance' | 'getPipelineAssignments' | 'getAgentLoad' | 'getGlobalMetrics' | 'getCapabilityBindings' | 'setCapabilityBinding' | 'getIngestOwner' | 'getAudioNodeLoad' | 'getAgentSettings' | 'listAgentSettings' | 'removeAgentSettings' | 'setAgentMaxCameras' | 'setAgentDetectWeight' | 'setAgentCapabilities' | 'setAgentReachableHost' | 'setAgentInferenceDevices' | 'getNodeInferenceDevices' | 'resetNodePipelineDefaults' | 'getCameraStatuses' | 'reconcileFromDisk' | 'getReconcileFromDiskStatus' | 'listTemplates' | 'saveTemplate' | 'updateTemplate' | 'deleteTemplate'>;
88
88
  readonly pipelineRunner: Pick<InferProvider<typeof pipelineRunnerCapability>, 'attachCamera' | 'reportMotion' | 'getLocalLoad' | 'getLocalMetrics' | 'getAllCameraMetrics' | 'getLocalCameras' | 'getNativeCrop' | 'runStatelessStep'>;
89
89
  readonly plateGallery: Pick<InferProvider<typeof plateGalleryCapability>, 'getPlateMedia' | 'searchPlates' | 'suggestPlateClusters' | 'correctPlateText' | 'deletePlate' | 'listVehicles' | 'createVehicle' | 'renameVehicle' | 'deleteVehicle' | 'listVehicleSamples' | 'removeVehicleSample' | 'assignPlate' | 'unassignPlate' | 'assignPlates' | 'unassignPlates'>;
90
- readonly recording: Pick<InferProvider<typeof recordingCapability>, 'getStorageUsage' | 'listOpsLog' | 'pauseForStorageMigration' | 'resumeForStorageMigration' | 'refreshStorageLocationsForMigration' | 'startStorageMigrationMove' | 'getStorageMigrationMoveStatus' | 'cancelStorageMigrationMove' | 'relocateFootage' | 'listRelocateJobs' | 'getRelocateResidue' | 'reconcileLedgerAgainstDisk' | 'cancelRelocateJob' | 'planStorageRebalance' | 'startStorageRebalance' | 'getPlacement' | 'setDevicePlacement'>;
90
+ readonly recording: Pick<InferProvider<typeof recordingCapability>, 'getAvailabilityBatch' | 'getDaysWithRecordingsBatch' | 'getStorageUsage' | 'listOpsLog' | 'pauseForStorageMigration' | 'resumeForStorageMigration' | 'refreshStorageLocationsForMigration' | 'startStorageMigrationMove' | 'getStorageMigrationMoveStatus' | 'cancelStorageMigrationMove' | 'relocateFootage' | 'listRelocateJobs' | 'getRelocateResidue' | 'reconcileLedgerAgainstDisk' | 'cancelRelocateJob' | 'planStorageRebalance' | 'startStorageRebalance' | 'getPlacement' | 'setDevicePlacement'>;
91
91
  readonly recordingExport: Pick<InferProvider<typeof recordingExportCapability>, 'createExport' | 'getExport' | 'cancelExport' | 'deleteExport' | 'getDownloadUrl' | 'readExportBytes'>;
92
92
  readonly serverManagement: Pick<InferProvider<typeof serverManagementCapability>, 'getServerPackageStatus' | 'checkServerUpdate' | 'applyServerUpdate' | 'rollbackServerUpdate' | 'restartServer'>;
93
93
  readonly settingsStore: Pick<InferProvider<typeof settingsStoreCapability>, 'get' | 'set' | 'query' | 'insert' | 'insertMany' | 'update' | 'delete' | 'deleteWhere' | 'updateWhere' | 'count' | 'aggregate' | 'histogram' | 'isEmpty' | 'declareCollection'>;