@camstack/types 1.2.129 → 1.2.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +4 -2
- package/dist/addon.mjs +4 -2
- package/dist/capabilities/index.d.ts +3 -3
- package/dist/capabilities/pipeline-analytics.cap.d.ts +151 -0
- package/dist/capabilities/recording.cap.d.ts +64 -0
- package/dist/capabilities/scene-monitor.cap.d.ts +233 -0
- package/dist/capabilities/storage-migration.cap.d.ts +1 -0
- package/dist/capabilities/zone-analytics.cap.d.ts +122 -2
- package/dist/generated/addon-api.d.ts +42 -0
- package/dist/generated/cap-input-defaults.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +2 -2
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.js +358 -2
- package/dist/index.mjs +351 -3
- package/dist/interfaces/relocate.d.ts +109 -0
- package/dist/{sleep-BS40IUZZ.mjs → sleep-BBI0PDUc.mjs} +5 -0
- package/dist/{sleep-D5821NGq.js → sleep-CqVyhcl-.js} +5 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type InferProvider } from './capability-definition.js';
|
|
3
2
|
import { DeviceType } from '../device/device-type.js';
|
|
3
|
+
import { type InferProvider } from './capability-definition.js';
|
|
4
4
|
/**
|
|
5
5
|
* Per-zone occupancy aggregation produced by the analytics frame
|
|
6
6
|
* processor on every inference result. Covers the full combinatorial
|
|
@@ -93,6 +93,67 @@ export declare const CameraOccupancySnapshotSchema: z.ZodObject<{
|
|
|
93
93
|
}, z.core.$strip>>>>;
|
|
94
94
|
}, z.core.$strip>;
|
|
95
95
|
export type CameraOccupancySnapshot = z.infer<typeof CameraOccupancySnapshotSchema>;
|
|
96
|
+
/**
|
|
97
|
+
* One camera's row in a `getCurrentSnapshotBatch` answer.
|
|
98
|
+
*
|
|
99
|
+
* THREE outcomes, and the single-camera method could only express two of them
|
|
100
|
+
* because `snapshot: null` was already spoken for:
|
|
101
|
+
*
|
|
102
|
+
* - `read: 'read'`, `snapshot` present — the live occupancy reading.
|
|
103
|
+
* - `read: 'read'`, `snapshot: null` — read, and this camera has no reading
|
|
104
|
+
* yet: no frame since boot, and no parked-object registry to hydrate from.
|
|
105
|
+
* - `read: 'unreadable'` — the owner could not answer for this
|
|
106
|
+
* camera. `snapshot` is null, and it does NOT mean "nothing parked here".
|
|
107
|
+
*
|
|
108
|
+
* Collapsing the last two is the failure this field exists to prevent: a
|
|
109
|
+
* hydration that threw would otherwise render as an empty Stationary section,
|
|
110
|
+
* which is a definite claim about a camera nobody could read.
|
|
111
|
+
*/
|
|
112
|
+
export declare const CameraOccupancySnapshotForDeviceSchema: z.ZodObject<{
|
|
113
|
+
deviceId: z.ZodNumber;
|
|
114
|
+
read: z.ZodEnum<{
|
|
115
|
+
read: "read";
|
|
116
|
+
unreadable: "unreadable";
|
|
117
|
+
}>;
|
|
118
|
+
snapshot: z.ZodNullable<z.ZodObject<{
|
|
119
|
+
ts: z.ZodNumber;
|
|
120
|
+
frameWidth: z.ZodNumber;
|
|
121
|
+
frameHeight: z.ZodNumber;
|
|
122
|
+
zones: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
123
|
+
totalObjects: z.ZodNumber;
|
|
124
|
+
byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
125
|
+
zoneId: z.ZodString;
|
|
126
|
+
zoneName: z.ZodString;
|
|
127
|
+
trackIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
128
|
+
}, z.core.$strip>>>;
|
|
129
|
+
frame: z.ZodObject<{
|
|
130
|
+
totalObjects: z.ZodNumber;
|
|
131
|
+
byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
unzoned: z.ZodObject<{
|
|
134
|
+
totalObjects: z.ZodNumber;
|
|
135
|
+
byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
stationaryObjects: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
138
|
+
id: z.ZodString;
|
|
139
|
+
className: z.ZodString;
|
|
140
|
+
bbox: z.ZodObject<{
|
|
141
|
+
x: z.ZodNumber;
|
|
142
|
+
y: z.ZodNumber;
|
|
143
|
+
w: z.ZodNumber;
|
|
144
|
+
h: z.ZodNumber;
|
|
145
|
+
}, z.core.$strip>;
|
|
146
|
+
frameWidth: z.ZodNumber;
|
|
147
|
+
frameHeight: z.ZodNumber;
|
|
148
|
+
firstSeenAt: z.ZodNumber;
|
|
149
|
+
becameStationaryAt: z.ZodNumber;
|
|
150
|
+
lastConfirmedAt: z.ZodNumber;
|
|
151
|
+
label: z.ZodOptional<z.ZodString>;
|
|
152
|
+
keyFrameMediaKey: z.ZodOptional<z.ZodString>;
|
|
153
|
+
}, z.core.$strip>>>>;
|
|
154
|
+
}, z.core.$strip>>;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
export type CameraOccupancySnapshotForDevice = z.infer<typeof CameraOccupancySnapshotForDeviceSchema>;
|
|
96
157
|
export type ZoneScopeBreakdown = z.infer<typeof ZoneScopeBreakdownSchema>;
|
|
97
158
|
export type PerScopeBreakdown = z.infer<typeof PerScopeBreakdownSchema>;
|
|
98
159
|
/**
|
|
@@ -192,6 +253,65 @@ export declare const zoneAnalyticsCapability: {
|
|
|
192
253
|
keyFrameMediaKey: z.ZodOptional<z.ZodString>;
|
|
193
254
|
}, z.core.$strip>>>>;
|
|
194
255
|
}, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
256
|
+
/**
|
|
257
|
+
* The same snapshot, for a SET of cameras, in one round trip.
|
|
258
|
+
*
|
|
259
|
+
* The Events page's Stationary section polls this every 15s for every
|
|
260
|
+
* selected camera. Fanned out client-side that is one query per camera to
|
|
261
|
+
* read a `Map.get` at the owner — the answer costs nothing, the round trip
|
|
262
|
+
* costs everything. Batched, N transports become one and the per-device
|
|
263
|
+
* work is unchanged.
|
|
264
|
+
*
|
|
265
|
+
* Every requested deviceId gets a row, tagged `read` — see
|
|
266
|
+
* {@link CameraOccupancySnapshotForDeviceSchema}. A camera the owner could
|
|
267
|
+
* not answer for is `'unreadable'`, never an empty reading.
|
|
268
|
+
*/
|
|
269
|
+
readonly getCurrentSnapshotBatch: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
270
|
+
deviceIds: z.ZodArray<z.ZodNumber>;
|
|
271
|
+
}, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
272
|
+
deviceId: z.ZodNumber;
|
|
273
|
+
read: z.ZodEnum<{
|
|
274
|
+
read: "read";
|
|
275
|
+
unreadable: "unreadable";
|
|
276
|
+
}>;
|
|
277
|
+
snapshot: z.ZodNullable<z.ZodObject<{
|
|
278
|
+
ts: z.ZodNumber;
|
|
279
|
+
frameWidth: z.ZodNumber;
|
|
280
|
+
frameHeight: z.ZodNumber;
|
|
281
|
+
zones: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
282
|
+
totalObjects: z.ZodNumber;
|
|
283
|
+
byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
284
|
+
zoneId: z.ZodString;
|
|
285
|
+
zoneName: z.ZodString;
|
|
286
|
+
trackIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
287
|
+
}, z.core.$strip>>>;
|
|
288
|
+
frame: z.ZodObject<{
|
|
289
|
+
totalObjects: z.ZodNumber;
|
|
290
|
+
byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
291
|
+
}, z.core.$strip>;
|
|
292
|
+
unzoned: z.ZodObject<{
|
|
293
|
+
totalObjects: z.ZodNumber;
|
|
294
|
+
byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
295
|
+
}, z.core.$strip>;
|
|
296
|
+
stationaryObjects: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
297
|
+
id: z.ZodString;
|
|
298
|
+
className: z.ZodString;
|
|
299
|
+
bbox: z.ZodObject<{
|
|
300
|
+
x: z.ZodNumber;
|
|
301
|
+
y: z.ZodNumber;
|
|
302
|
+
w: z.ZodNumber;
|
|
303
|
+
h: z.ZodNumber;
|
|
304
|
+
}, z.core.$strip>;
|
|
305
|
+
frameWidth: z.ZodNumber;
|
|
306
|
+
frameHeight: z.ZodNumber;
|
|
307
|
+
firstSeenAt: z.ZodNumber;
|
|
308
|
+
becameStationaryAt: z.ZodNumber;
|
|
309
|
+
lastConfirmedAt: z.ZodNumber;
|
|
310
|
+
label: z.ZodOptional<z.ZodString>;
|
|
311
|
+
keyFrameMediaKey: z.ZodOptional<z.ZodString>;
|
|
312
|
+
}, z.core.$strip>>>>;
|
|
313
|
+
}, z.core.$strip>>;
|
|
314
|
+
}, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
195
315
|
/** Time-series object count inside one zone. `className` optional —
|
|
196
316
|
* omit to count every class in the zone. */
|
|
197
317
|
readonly getZoneHistory: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
@@ -293,4 +413,4 @@ export declare const zoneAnalyticsCapability: {
|
|
|
293
413
|
readonly durability: "session";
|
|
294
414
|
};
|
|
295
415
|
export type IZoneAnalyticsProvider = InferProvider<typeof zoneAnalyticsCapability>;
|
|
296
|
-
export { CameraOccupancySnapshotSchema as _CameraOccupancySnapshotSchema,
|
|
416
|
+
export { CameraOccupancySnapshotSchema as _CameraOccupancySnapshotSchema, HistoryPointSchema, HistoryRangeSchema, HistoryResolutionEnum, PerScopeBreakdownSchema, StationaryObjectSchema, ZoneScopeBreakdownSchema, };
|
|
@@ -5002,6 +5002,13 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
5002
5002
|
output: z.infer<typeof pipelineAnalyticsCapability.methods.getKeyEvents.output>;
|
|
5003
5003
|
meta: object;
|
|
5004
5004
|
}>;
|
|
5005
|
+
getKeyEventsBatch: TRPCQueryProcedure<{
|
|
5006
|
+
input: {
|
|
5007
|
+
[x: string]: unknown;
|
|
5008
|
+
} & z.input<typeof pipelineAnalyticsCapability.methods.getKeyEventsBatch.input>;
|
|
5009
|
+
output: z.infer<typeof pipelineAnalyticsCapability.methods.getKeyEventsBatch.output>;
|
|
5010
|
+
meta: object;
|
|
5011
|
+
}>;
|
|
5005
5012
|
getEventDensity: TRPCQueryProcedure<{
|
|
5006
5013
|
input: {
|
|
5007
5014
|
[x: string]: unknown;
|
|
@@ -5163,6 +5170,20 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
5163
5170
|
output: z.infer<typeof pipelineAnalyticsCapability.methods.listOpsLog.output>;
|
|
5164
5171
|
meta: object;
|
|
5165
5172
|
}>;
|
|
5173
|
+
reclaimDebugMedia: TRPCMutationProcedure<{
|
|
5174
|
+
input: {
|
|
5175
|
+
[x: string]: unknown;
|
|
5176
|
+
} & z.input<typeof pipelineAnalyticsCapability.methods.reclaimDebugMedia.input>;
|
|
5177
|
+
output: z.infer<typeof pipelineAnalyticsCapability.methods.reclaimDebugMedia.output>;
|
|
5178
|
+
meta: object;
|
|
5179
|
+
}>;
|
|
5180
|
+
getMediaReclaimStatus: TRPCQueryProcedure<{
|
|
5181
|
+
input: {
|
|
5182
|
+
[x: string]: unknown;
|
|
5183
|
+
} & z.input<typeof pipelineAnalyticsCapability.methods.getMediaReclaimStatus.input>;
|
|
5184
|
+
output: z.infer<typeof pipelineAnalyticsCapability.methods.getMediaReclaimStatus.output>;
|
|
5185
|
+
meta: object;
|
|
5186
|
+
}>;
|
|
5166
5187
|
getTrainingExportSummary: TRPCQueryProcedure<{
|
|
5167
5188
|
input: {
|
|
5168
5189
|
[x: string]: unknown;
|
|
@@ -6606,6 +6627,13 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
6606
6627
|
output: z.infer<typeof recordingCapability.methods.getRelocateResidue.output>;
|
|
6607
6628
|
meta: object;
|
|
6608
6629
|
}>;
|
|
6630
|
+
reconcileLedgerAgainstDisk: TRPCMutationProcedure<{
|
|
6631
|
+
input: {
|
|
6632
|
+
[x: string]: unknown;
|
|
6633
|
+
} & z.input<typeof recordingCapability.methods.reconcileLedgerAgainstDisk.input>;
|
|
6634
|
+
output: z.infer<typeof recordingCapability.methods.reconcileLedgerAgainstDisk.output>;
|
|
6635
|
+
meta: object;
|
|
6636
|
+
}>;
|
|
6609
6637
|
cancelRelocateJob: TRPCMutationProcedure<{
|
|
6610
6638
|
input: {
|
|
6611
6639
|
[x: string]: unknown;
|
|
@@ -6704,6 +6732,13 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
6704
6732
|
output: z.infer<typeof sceneMonitorCapability.methods.listScenes.output>;
|
|
6705
6733
|
meta: object;
|
|
6706
6734
|
}>;
|
|
6735
|
+
listScenesBatch: TRPCQueryProcedure<{
|
|
6736
|
+
input: {
|
|
6737
|
+
[x: string]: unknown;
|
|
6738
|
+
} & z.input<typeof sceneMonitorCapability.methods.listScenesBatch.input>;
|
|
6739
|
+
output: z.infer<typeof sceneMonitorCapability.methods.listScenesBatch.output>;
|
|
6740
|
+
meta: object;
|
|
6741
|
+
}>;
|
|
6707
6742
|
createScene: TRPCMutationProcedure<{
|
|
6708
6743
|
input: {
|
|
6709
6744
|
[x: string]: unknown;
|
|
@@ -8676,6 +8711,13 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
8676
8711
|
output: z.infer<typeof zoneAnalyticsCapability.methods.getCurrentSnapshot.output>;
|
|
8677
8712
|
meta: object;
|
|
8678
8713
|
}>;
|
|
8714
|
+
getCurrentSnapshotBatch: TRPCQueryProcedure<{
|
|
8715
|
+
input: {
|
|
8716
|
+
[x: string]: unknown;
|
|
8717
|
+
} & z.input<typeof zoneAnalyticsCapability.methods.getCurrentSnapshotBatch.input>;
|
|
8718
|
+
output: z.infer<typeof zoneAnalyticsCapability.methods.getCurrentSnapshotBatch.output>;
|
|
8719
|
+
meta: object;
|
|
8720
|
+
}>;
|
|
8679
8721
|
getZoneHistory: TRPCQueryProcedure<{
|
|
8680
8722
|
input: {
|
|
8681
8723
|
[x: string]: unknown;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Plain data, zero Zod: a forked runner must not import the schema barrel
|
|
12
12
|
* (~144MB RSS per runner — D28).
|
|
13
13
|
*
|
|
14
|
-
* Coverage: 24 caps,
|
|
14
|
+
* Coverage: 24 caps, 56 methods with defaults.
|
|
15
15
|
*/
|
|
16
16
|
export declare const CAP_INPUT_DEFAULTS: Readonly<Record<string, Readonly<Record<string, Readonly<Record<string, unknown>>>>>>;
|
|
17
17
|
/**
|
|
@@ -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:
|
|
9
|
+
* Coverage: 994 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:
|
|
10
|
-
*
|
|
9
|
+
* Coverage: 352 methods carry a device reference, of which
|
|
10
|
+
* 130 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
|
|
@@ -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' | 'cancelRelocateJob' | 'planStorageRebalance' | 'startStorageRebalance'>;
|
|
90
|
+
readonly recording: Pick<InferProvider<typeof recordingCapability>, 'getStorageUsage' | 'listOpsLog' | 'pauseForStorageMigration' | 'resumeForStorageMigration' | 'refreshStorageLocationsForMigration' | 'startStorageMigrationMove' | 'getStorageMigrationMoveStatus' | 'cancelStorageMigrationMove' | 'relocateFootage' | 'listRelocateJobs' | 'getRelocateResidue' | 'reconcileLedgerAgainstDisk' | 'cancelRelocateJob' | 'planStorageRebalance' | 'startStorageRebalance'>;
|
|
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'>;
|