@awarevue/api-types 2.0.122 → 2.0.124

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.
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.alarmEventVariants = exports.resolveAlarmExclusivityGroup = exports.createAlarmRuleBody = exports.parseAlarmAutomationCode = exports.isByTypeAutomationCode = exports.isByDeviceAutomationCode = exports.formatByTypeAutomationCode = exports.formatByDeviceAutomationCode = exports.isAlarmAutomationMetadata = exports.sAlarmAutomationMetadata = exports.sAlarmAutomationCriteria = exports.sAlarmAutomationLevel = exports.sAlarmBehavior = void 0;
4
4
  const zod_1 = require("zod");
5
- const world_object_1 = require("./objects/world-object");
6
5
  exports.sAlarmBehavior = zod_1.z.enum([
7
6
  'ignore',
8
7
  'trigger-always',
@@ -130,6 +129,36 @@ exports.resolveAlarmExclusivityGroup = resolveAlarmExclusivityGroup;
130
129
  const sorted = (specs) => {
131
130
  return specs.sort((a, b) => a.label.localeCompare(b.label));
132
131
  };
132
+ const worldObjects = [
133
+ {
134
+ id: 'person',
135
+ label: 'Person',
136
+ },
137
+ {
138
+ id: 'backpack',
139
+ label: 'Backpack',
140
+ },
141
+ {
142
+ id: 'cell-phone',
143
+ label: 'Cell Phone',
144
+ },
145
+ {
146
+ id: 'handbag',
147
+ label: 'Handbag',
148
+ },
149
+ {
150
+ id: 'laptop',
151
+ label: 'Laptop',
152
+ },
153
+ {
154
+ id: 'bicycle',
155
+ label: 'Bicycle',
156
+ },
157
+ {
158
+ id: 'car',
159
+ label: 'Car',
160
+ },
161
+ ];
133
162
  exports.alarmEventVariants = {
134
163
  'door-access': sorted([
135
164
  {
@@ -145,7 +174,7 @@ exports.alarmEventVariants = {
145
174
  ]),
146
175
  'object-detection-started': sorted([
147
176
  // TODO - add criteria for object detection started
148
- ...world_object_1.worldObjects.map((object) => ({
177
+ ...worldObjects.map((object) => ({
149
178
  name: object.id,
150
179
  label: `${object.label} Detected`,
151
180
  criteria: [{ field: 'objectKind', value: object.id }],
@@ -196,6 +196,130 @@ export declare const requestSchemasByType: {
196
196
  timeFrom: z.ZodNumber;
197
197
  timeTo: z.ZodNumber;
198
198
  }, z.core.$strip>;
199
+ readonly "cctv:motion-stats-by-time-range": z.ZodObject<{
200
+ device: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
201
+ name: z.ZodString;
202
+ foreignRef: z.ZodString;
203
+ provider: z.ZodString;
204
+ providerMetadata: z.ZodObject<{}, z.core.$catchall<z.ZodUnknown>>;
205
+ presets: z.ZodArray<z.ZodObject<{
206
+ id: z.ZodString;
207
+ name: z.ZodString;
208
+ params: z.ZodUnknown;
209
+ isDefault: z.ZodBoolean;
210
+ assignedRef: z.ZodNullable<z.ZodString>;
211
+ createdOn: z.ZodString;
212
+ lastModifiedOn: z.ZodString;
213
+ }, z.core.$strip>>;
214
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
215
+ type: z.ZodLiteral<"alarm">;
216
+ }, z.core.$strip>, z.ZodObject<{
217
+ ptzCapable: z.ZodBoolean;
218
+ ptzPanSpeed: z.ZodNumber;
219
+ ptzTiltSpeed: z.ZodNumber;
220
+ ptzZoomSpeed: z.ZodNumber;
221
+ panMin: z.ZodNumber;
222
+ panMax: z.ZodNumber;
223
+ tiltMin: z.ZodNumber;
224
+ tiltMax: z.ZodNumber;
225
+ zoomMin: z.ZodNumber;
226
+ zoomMax: z.ZodNumber;
227
+ streams: z.ZodArray<z.ZodObject<{
228
+ id: z.ZodString;
229
+ displayName: z.ZodString;
230
+ externalPlayerUrl: z.ZodNullable<z.ZodString>;
231
+ rtspUrl: z.ZodNullable<z.ZodString>;
232
+ width: z.ZodNullable<z.ZodNumber>;
233
+ height: z.ZodNullable<z.ZodNumber>;
234
+ lensType: z.ZodEnum<{
235
+ flat: "flat";
236
+ fisheye: "fisheye";
237
+ }>;
238
+ mountPoint: z.ZodEnum<{
239
+ wall: "wall";
240
+ ceiling: "ceiling";
241
+ floor: "floor";
242
+ }>;
243
+ webrtcPlaybackSource: z.ZodNullable<z.ZodIntersection<z.ZodObject<{
244
+ kind: z.ZodString;
245
+ }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
246
+ }, z.core.$strip>>;
247
+ defaultStreamId: z.ZodString;
248
+ autoSwitchStreams: z.ZodBoolean;
249
+ streamNaming: z.ZodEnum<{
250
+ cameraStreamNo: "cameraStreamNo";
251
+ cameraStream: "cameraStream";
252
+ stream: "stream";
253
+ }>;
254
+ type: z.ZodLiteral<"camera">;
255
+ }, z.core.$strip>, z.ZodObject<{
256
+ canReportOpenState: z.ZodBoolean;
257
+ canReportLockState: z.ZodBoolean;
258
+ canControlLock: z.ZodBoolean;
259
+ canRelease: z.ZodBoolean;
260
+ type: z.ZodLiteral<"door">;
261
+ }, z.core.$strip>, z.ZodObject<{
262
+ inputs: z.ZodArray<z.ZodString>;
263
+ outputs: z.ZodArray<z.ZodString>;
264
+ type: z.ZodLiteral<"io-board">;
265
+ }, z.core.$strip>, z.ZodObject<{
266
+ type: z.ZodLiteral<"camera-lift">;
267
+ }, z.core.$strip>, z.ZodObject<{
268
+ type: z.ZodLiteral<"motion-sensor">;
269
+ }, z.core.$strip>, z.ZodObject<{
270
+ type: z.ZodLiteral<"generic-sensor">;
271
+ }, z.core.$strip>, z.ZodObject<{
272
+ type: z.ZodLiteral<"panic-button">;
273
+ }, z.core.$strip>, z.ZodObject<{
274
+ sipUri: z.ZodString;
275
+ sipUser: z.ZodString;
276
+ sipPassword: z.ZodString;
277
+ sipRealm: z.ZodString;
278
+ remoteExtension: z.ZodString;
279
+ type: z.ZodLiteral<"intercom-terminal">;
280
+ }, z.core.$strip>, z.ZodObject<{
281
+ sipWsUrl: z.ZodString;
282
+ type: z.ZodLiteral<"pbx">;
283
+ }, z.core.$strip>, z.ZodObject<{
284
+ type: z.ZodLiteral<"server">;
285
+ }, z.core.$strip>, z.ZodObject<{
286
+ type: z.ZodLiteral<"intercom-operator">;
287
+ }, z.core.$strip>, z.ZodObject<{
288
+ type: z.ZodLiteral<"device-gateway">;
289
+ }, z.core.$strip>, z.ZodObject<{
290
+ type: z.ZodLiteral<"presence-tracker">;
291
+ }, z.core.$strip>, z.ZodObject<{
292
+ credentialTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
293
+ card: "card";
294
+ pin: "pin";
295
+ fingerprint: "fingerprint";
296
+ face: "face";
297
+ retina: "retina";
298
+ }>>>;
299
+ type: z.ZodLiteral<"reader">;
300
+ }, z.core.$strip>, z.ZodObject<{
301
+ type: z.ZodLiteral<"display">;
302
+ }, z.core.$strip>, z.ZodObject<{
303
+ type: z.ZodLiteral<"nvr-recorder">;
304
+ }, z.core.$strip>, z.ZodObject<{
305
+ type: z.ZodLiteral<"nvr-exporter">;
306
+ }, z.core.$strip>, z.ZodObject<{
307
+ capabilities: z.ZodArray<z.ZodEnum<{
308
+ motionDetection: "motionDetection";
309
+ labelDetection: "labelDetection";
310
+ faceRecognition: "faceRecognition";
311
+ semanticSearch: "semanticSearch";
312
+ }>>;
313
+ type: z.ZodLiteral<"nvr-analytics-server">;
314
+ }, z.core.$strip>, z.ZodObject<{
315
+ type: z.ZodLiteral<"system">;
316
+ }, z.core.$strip>, z.ZodObject<{
317
+ type: z.ZodLiteral<"position-tracker">;
318
+ }, z.core.$strip>], "type">>]>, z.ZodTuple<[z.ZodString, z.ZodString], null>]>;
319
+ streamId: z.ZodString;
320
+ timeFrom: z.ZodNumber;
321
+ timeTo: z.ZodNumber;
322
+ }, z.core.$strip>;
199
323
  readonly "cctv:preview-image": z.ZodObject<{
200
324
  device: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
201
325
  name: z.ZodString;
@@ -518,6 +642,23 @@ export declare const responseSchemasByType: {
518
642
  motion: z.ZodOptional<z.ZodNumber>;
519
643
  objects: z.ZodOptional<z.ZodNumber>;
520
644
  }, z.core.$strip>>;
645
+ readonly "cctv:motion-stats-by-time-range": z.ZodObject<{
646
+ streamId: z.ZodString;
647
+ from: z.ZodNumber;
648
+ to: z.ZodNumber;
649
+ bucketMs: z.ZodNumber;
650
+ baseline: z.ZodObject<{
651
+ floor: z.ZodNumber;
652
+ ceiling: z.ZodNumber;
653
+ }, z.core.$strip>;
654
+ samples: z.ZodArray<z.ZodObject<{
655
+ t: z.ZodNumber;
656
+ avg: z.ZodNumber;
657
+ max: z.ZodNumber;
658
+ rms: z.ZodNumber;
659
+ n: z.ZodNumber;
660
+ }, z.core.$strip>>;
661
+ }, z.core.$strip>;
521
662
  readonly "cctv:preview-image": z.ZodNullable<z.ZodObject<{
522
663
  mimeType: z.ZodString;
523
664
  data: z.ZodString;
@@ -132,6 +132,150 @@ export declare const sRecordingsResponse: z.ZodArray<z.ZodObject<{
132
132
  }, z.core.$strip>>;
133
133
  export type RecordingsByTimeRangeArgs = z.infer<typeof sRecordingsByTimeRangeArgs>;
134
134
  export type RecordingsResponse = z.infer<typeof sRecordingsResponse>;
135
+ export declare const QUERY_MOTION_STATS_BY_TIME_RANGE = "cctv:motion-stats-by-time-range";
136
+ export declare const sMotionStatsByTimeRangeArgs: z.ZodObject<{
137
+ device: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
138
+ name: z.ZodString;
139
+ foreignRef: z.ZodString;
140
+ provider: z.ZodString;
141
+ providerMetadata: z.ZodObject<{}, z.core.$catchall<z.ZodUnknown>>;
142
+ presets: z.ZodArray<z.ZodObject<{
143
+ id: z.ZodString;
144
+ name: z.ZodString;
145
+ params: z.ZodUnknown;
146
+ isDefault: z.ZodBoolean;
147
+ assignedRef: z.ZodNullable<z.ZodString>;
148
+ createdOn: z.ZodString;
149
+ lastModifiedOn: z.ZodString;
150
+ }, z.core.$strip>>;
151
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
152
+ type: z.ZodLiteral<"alarm">;
153
+ }, z.core.$strip>, z.ZodObject<{
154
+ ptzCapable: z.ZodBoolean;
155
+ ptzPanSpeed: z.ZodNumber;
156
+ ptzTiltSpeed: z.ZodNumber;
157
+ ptzZoomSpeed: z.ZodNumber;
158
+ panMin: z.ZodNumber;
159
+ panMax: z.ZodNumber;
160
+ tiltMin: z.ZodNumber;
161
+ tiltMax: z.ZodNumber;
162
+ zoomMin: z.ZodNumber;
163
+ zoomMax: z.ZodNumber;
164
+ streams: z.ZodArray<z.ZodObject<{
165
+ id: z.ZodString;
166
+ displayName: z.ZodString;
167
+ externalPlayerUrl: z.ZodNullable<z.ZodString>;
168
+ rtspUrl: z.ZodNullable<z.ZodString>;
169
+ width: z.ZodNullable<z.ZodNumber>;
170
+ height: z.ZodNullable<z.ZodNumber>;
171
+ lensType: z.ZodEnum<{
172
+ flat: "flat";
173
+ fisheye: "fisheye";
174
+ }>;
175
+ mountPoint: z.ZodEnum<{
176
+ wall: "wall";
177
+ ceiling: "ceiling";
178
+ floor: "floor";
179
+ }>;
180
+ webrtcPlaybackSource: z.ZodNullable<z.ZodIntersection<z.ZodObject<{
181
+ kind: z.ZodString;
182
+ }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
183
+ }, z.core.$strip>>;
184
+ defaultStreamId: z.ZodString;
185
+ autoSwitchStreams: z.ZodBoolean;
186
+ streamNaming: z.ZodEnum<{
187
+ cameraStreamNo: "cameraStreamNo";
188
+ cameraStream: "cameraStream";
189
+ stream: "stream";
190
+ }>;
191
+ type: z.ZodLiteral<"camera">;
192
+ }, z.core.$strip>, z.ZodObject<{
193
+ canReportOpenState: z.ZodBoolean;
194
+ canReportLockState: z.ZodBoolean;
195
+ canControlLock: z.ZodBoolean;
196
+ canRelease: z.ZodBoolean;
197
+ type: z.ZodLiteral<"door">;
198
+ }, z.core.$strip>, z.ZodObject<{
199
+ inputs: z.ZodArray<z.ZodString>;
200
+ outputs: z.ZodArray<z.ZodString>;
201
+ type: z.ZodLiteral<"io-board">;
202
+ }, z.core.$strip>, z.ZodObject<{
203
+ type: z.ZodLiteral<"camera-lift">;
204
+ }, z.core.$strip>, z.ZodObject<{
205
+ type: z.ZodLiteral<"motion-sensor">;
206
+ }, z.core.$strip>, z.ZodObject<{
207
+ type: z.ZodLiteral<"generic-sensor">;
208
+ }, z.core.$strip>, z.ZodObject<{
209
+ type: z.ZodLiteral<"panic-button">;
210
+ }, z.core.$strip>, z.ZodObject<{
211
+ sipUri: z.ZodString;
212
+ sipUser: z.ZodString;
213
+ sipPassword: z.ZodString;
214
+ sipRealm: z.ZodString;
215
+ remoteExtension: z.ZodString;
216
+ type: z.ZodLiteral<"intercom-terminal">;
217
+ }, z.core.$strip>, z.ZodObject<{
218
+ sipWsUrl: z.ZodString;
219
+ type: z.ZodLiteral<"pbx">;
220
+ }, z.core.$strip>, z.ZodObject<{
221
+ type: z.ZodLiteral<"server">;
222
+ }, z.core.$strip>, z.ZodObject<{
223
+ type: z.ZodLiteral<"intercom-operator">;
224
+ }, z.core.$strip>, z.ZodObject<{
225
+ type: z.ZodLiteral<"device-gateway">;
226
+ }, z.core.$strip>, z.ZodObject<{
227
+ type: z.ZodLiteral<"presence-tracker">;
228
+ }, z.core.$strip>, z.ZodObject<{
229
+ credentialTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
230
+ card: "card";
231
+ pin: "pin";
232
+ fingerprint: "fingerprint";
233
+ face: "face";
234
+ retina: "retina";
235
+ }>>>;
236
+ type: z.ZodLiteral<"reader">;
237
+ }, z.core.$strip>, z.ZodObject<{
238
+ type: z.ZodLiteral<"display">;
239
+ }, z.core.$strip>, z.ZodObject<{
240
+ type: z.ZodLiteral<"nvr-recorder">;
241
+ }, z.core.$strip>, z.ZodObject<{
242
+ type: z.ZodLiteral<"nvr-exporter">;
243
+ }, z.core.$strip>, z.ZodObject<{
244
+ capabilities: z.ZodArray<z.ZodEnum<{
245
+ motionDetection: "motionDetection";
246
+ labelDetection: "labelDetection";
247
+ faceRecognition: "faceRecognition";
248
+ semanticSearch: "semanticSearch";
249
+ }>>;
250
+ type: z.ZodLiteral<"nvr-analytics-server">;
251
+ }, z.core.$strip>, z.ZodObject<{
252
+ type: z.ZodLiteral<"system">;
253
+ }, z.core.$strip>, z.ZodObject<{
254
+ type: z.ZodLiteral<"position-tracker">;
255
+ }, z.core.$strip>], "type">>]>, z.ZodTuple<[z.ZodString, z.ZodString], null>]>;
256
+ streamId: z.ZodString;
257
+ timeFrom: z.ZodNumber;
258
+ timeTo: z.ZodNumber;
259
+ }, z.core.$strip>;
260
+ export declare const sMotionStatsResponse: z.ZodObject<{
261
+ streamId: z.ZodString;
262
+ from: z.ZodNumber;
263
+ to: z.ZodNumber;
264
+ bucketMs: z.ZodNumber;
265
+ baseline: z.ZodObject<{
266
+ floor: z.ZodNumber;
267
+ ceiling: z.ZodNumber;
268
+ }, z.core.$strip>;
269
+ samples: z.ZodArray<z.ZodObject<{
270
+ t: z.ZodNumber;
271
+ avg: z.ZodNumber;
272
+ max: z.ZodNumber;
273
+ rms: z.ZodNumber;
274
+ n: z.ZodNumber;
275
+ }, z.core.$strip>>;
276
+ }, z.core.$strip>;
277
+ export type MotionStatsByTimeRangeArgs = z.infer<typeof sMotionStatsByTimeRangeArgs>;
278
+ export type MotionStatsResponse = z.infer<typeof sMotionStatsResponse>;
135
279
  export declare const QUERY_PREVIEW_IMAGE = "cctv:preview-image";
136
280
  export declare const sPreviewImageArgs: z.ZodObject<{
137
281
  device: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
@@ -519,6 +663,130 @@ export declare const nvrRecorderRequestSchemas: {
519
663
  timeFrom: z.ZodNumber;
520
664
  timeTo: z.ZodNumber;
521
665
  }, z.core.$strip>;
666
+ readonly "cctv:motion-stats-by-time-range": z.ZodObject<{
667
+ device: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
668
+ name: z.ZodString;
669
+ foreignRef: z.ZodString;
670
+ provider: z.ZodString;
671
+ providerMetadata: z.ZodObject<{}, z.core.$catchall<z.ZodUnknown>>;
672
+ presets: z.ZodArray<z.ZodObject<{
673
+ id: z.ZodString;
674
+ name: z.ZodString;
675
+ params: z.ZodUnknown;
676
+ isDefault: z.ZodBoolean;
677
+ assignedRef: z.ZodNullable<z.ZodString>;
678
+ createdOn: z.ZodString;
679
+ lastModifiedOn: z.ZodString;
680
+ }, z.core.$strip>>;
681
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
682
+ type: z.ZodLiteral<"alarm">;
683
+ }, z.core.$strip>, z.ZodObject<{
684
+ ptzCapable: z.ZodBoolean;
685
+ ptzPanSpeed: z.ZodNumber;
686
+ ptzTiltSpeed: z.ZodNumber;
687
+ ptzZoomSpeed: z.ZodNumber;
688
+ panMin: z.ZodNumber;
689
+ panMax: z.ZodNumber;
690
+ tiltMin: z.ZodNumber;
691
+ tiltMax: z.ZodNumber;
692
+ zoomMin: z.ZodNumber;
693
+ zoomMax: z.ZodNumber;
694
+ streams: z.ZodArray<z.ZodObject<{
695
+ id: z.ZodString;
696
+ displayName: z.ZodString;
697
+ externalPlayerUrl: z.ZodNullable<z.ZodString>;
698
+ rtspUrl: z.ZodNullable<z.ZodString>;
699
+ width: z.ZodNullable<z.ZodNumber>;
700
+ height: z.ZodNullable<z.ZodNumber>;
701
+ lensType: z.ZodEnum<{
702
+ flat: "flat";
703
+ fisheye: "fisheye";
704
+ }>;
705
+ mountPoint: z.ZodEnum<{
706
+ wall: "wall";
707
+ ceiling: "ceiling";
708
+ floor: "floor";
709
+ }>;
710
+ webrtcPlaybackSource: z.ZodNullable<z.ZodIntersection<z.ZodObject<{
711
+ kind: z.ZodString;
712
+ }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
713
+ }, z.core.$strip>>;
714
+ defaultStreamId: z.ZodString;
715
+ autoSwitchStreams: z.ZodBoolean;
716
+ streamNaming: z.ZodEnum<{
717
+ cameraStreamNo: "cameraStreamNo";
718
+ cameraStream: "cameraStream";
719
+ stream: "stream";
720
+ }>;
721
+ type: z.ZodLiteral<"camera">;
722
+ }, z.core.$strip>, z.ZodObject<{
723
+ canReportOpenState: z.ZodBoolean;
724
+ canReportLockState: z.ZodBoolean;
725
+ canControlLock: z.ZodBoolean;
726
+ canRelease: z.ZodBoolean;
727
+ type: z.ZodLiteral<"door">;
728
+ }, z.core.$strip>, z.ZodObject<{
729
+ inputs: z.ZodArray<z.ZodString>;
730
+ outputs: z.ZodArray<z.ZodString>;
731
+ type: z.ZodLiteral<"io-board">;
732
+ }, z.core.$strip>, z.ZodObject<{
733
+ type: z.ZodLiteral<"camera-lift">;
734
+ }, z.core.$strip>, z.ZodObject<{
735
+ type: z.ZodLiteral<"motion-sensor">;
736
+ }, z.core.$strip>, z.ZodObject<{
737
+ type: z.ZodLiteral<"generic-sensor">;
738
+ }, z.core.$strip>, z.ZodObject<{
739
+ type: z.ZodLiteral<"panic-button">;
740
+ }, z.core.$strip>, z.ZodObject<{
741
+ sipUri: z.ZodString;
742
+ sipUser: z.ZodString;
743
+ sipPassword: z.ZodString;
744
+ sipRealm: z.ZodString;
745
+ remoteExtension: z.ZodString;
746
+ type: z.ZodLiteral<"intercom-terminal">;
747
+ }, z.core.$strip>, z.ZodObject<{
748
+ sipWsUrl: z.ZodString;
749
+ type: z.ZodLiteral<"pbx">;
750
+ }, z.core.$strip>, z.ZodObject<{
751
+ type: z.ZodLiteral<"server">;
752
+ }, z.core.$strip>, z.ZodObject<{
753
+ type: z.ZodLiteral<"intercom-operator">;
754
+ }, z.core.$strip>, z.ZodObject<{
755
+ type: z.ZodLiteral<"device-gateway">;
756
+ }, z.core.$strip>, z.ZodObject<{
757
+ type: z.ZodLiteral<"presence-tracker">;
758
+ }, z.core.$strip>, z.ZodObject<{
759
+ credentialTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
760
+ card: "card";
761
+ pin: "pin";
762
+ fingerprint: "fingerprint";
763
+ face: "face";
764
+ retina: "retina";
765
+ }>>>;
766
+ type: z.ZodLiteral<"reader">;
767
+ }, z.core.$strip>, z.ZodObject<{
768
+ type: z.ZodLiteral<"display">;
769
+ }, z.core.$strip>, z.ZodObject<{
770
+ type: z.ZodLiteral<"nvr-recorder">;
771
+ }, z.core.$strip>, z.ZodObject<{
772
+ type: z.ZodLiteral<"nvr-exporter">;
773
+ }, z.core.$strip>, z.ZodObject<{
774
+ capabilities: z.ZodArray<z.ZodEnum<{
775
+ motionDetection: "motionDetection";
776
+ labelDetection: "labelDetection";
777
+ faceRecognition: "faceRecognition";
778
+ semanticSearch: "semanticSearch";
779
+ }>>;
780
+ type: z.ZodLiteral<"nvr-analytics-server">;
781
+ }, z.core.$strip>, z.ZodObject<{
782
+ type: z.ZodLiteral<"system">;
783
+ }, z.core.$strip>, z.ZodObject<{
784
+ type: z.ZodLiteral<"position-tracker">;
785
+ }, z.core.$strip>], "type">>]>, z.ZodTuple<[z.ZodString, z.ZodString], null>]>;
786
+ streamId: z.ZodString;
787
+ timeFrom: z.ZodNumber;
788
+ timeTo: z.ZodNumber;
789
+ }, z.core.$strip>;
522
790
  readonly "cctv:preview-image": z.ZodObject<{
523
791
  device: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
524
792
  name: z.ZodString;
@@ -775,6 +1043,23 @@ export declare const nvrRecorderResponseSchemas: {
775
1043
  motion: z.ZodOptional<z.ZodNumber>;
776
1044
  objects: z.ZodOptional<z.ZodNumber>;
777
1045
  }, z.core.$strip>>;
1046
+ readonly "cctv:motion-stats-by-time-range": z.ZodObject<{
1047
+ streamId: z.ZodString;
1048
+ from: z.ZodNumber;
1049
+ to: z.ZodNumber;
1050
+ bucketMs: z.ZodNumber;
1051
+ baseline: z.ZodObject<{
1052
+ floor: z.ZodNumber;
1053
+ ceiling: z.ZodNumber;
1054
+ }, z.core.$strip>;
1055
+ samples: z.ZodArray<z.ZodObject<{
1056
+ t: z.ZodNumber;
1057
+ avg: z.ZodNumber;
1058
+ max: z.ZodNumber;
1059
+ rms: z.ZodNumber;
1060
+ n: z.ZodNumber;
1061
+ }, z.core.$strip>>;
1062
+ }, z.core.$strip>;
778
1063
  readonly "cctv:preview-image": z.ZodNullable<z.ZodObject<{
779
1064
  mimeType: z.ZodString;
780
1065
  data: z.ZodString;
@@ -786,11 +1071,13 @@ export declare const nvrRecorderResponseSchemas: {
786
1071
  };
787
1072
  export type NvrRecorderQueryRequestMap = {
788
1073
  [QUERY_RECORDINGS_BY_TIME_RANGE]: RecordingsByTimeRangeArgs;
1074
+ [QUERY_MOTION_STATS_BY_TIME_RANGE]: MotionStatsByTimeRangeArgs;
789
1075
  [QUERY_PREVIEW_IMAGE]: PreviewImageArgs;
790
1076
  [QUERY_CAMERA_LATEST_FRAME]: CameraLatestFrameArgs;
791
1077
  };
792
1078
  export type NvrRecorderQueryResponseMap = {
793
1079
  [QUERY_RECORDINGS_BY_TIME_RANGE]: RecordingsResponse;
1080
+ [QUERY_MOTION_STATS_BY_TIME_RANGE]: MotionStatsResponse;
794
1081
  [QUERY_PREVIEW_IMAGE]: PreviewImageResponse;
795
1082
  [QUERY_CAMERA_LATEST_FRAME]: CameraLatestFrameResponse;
796
1083
  };
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.nvrRecorderResponseSchemas = exports.nvrRecorderRequestSchemas = exports.sCameraLatestFrameResponse = exports.sCameraLatestFrameArgs = exports.QUERY_CAMERA_LATEST_FRAME = exports.sPreviewImageResponse = exports.sPreviewImageArgs = exports.QUERY_PREVIEW_IMAGE = exports.sRecordingsResponse = exports.sRecordingsByTimeRangeArgs = exports.QUERY_RECORDINGS_BY_TIME_RANGE = void 0;
3
+ exports.nvrRecorderResponseSchemas = exports.nvrRecorderRequestSchemas = exports.sCameraLatestFrameResponse = exports.sCameraLatestFrameArgs = exports.QUERY_CAMERA_LATEST_FRAME = exports.sPreviewImageResponse = exports.sPreviewImageArgs = exports.QUERY_PREVIEW_IMAGE = exports.sMotionStatsResponse = exports.sMotionStatsByTimeRangeArgs = exports.QUERY_MOTION_STATS_BY_TIME_RANGE = exports.sRecordingsResponse = exports.sRecordingsByTimeRangeArgs = exports.QUERY_RECORDINGS_BY_TIME_RANGE = void 0;
4
4
  const primitives_1 = require("../../primitives");
5
5
  const zod_1 = require("zod");
6
6
  const media_1 = require("../rest/media");
7
+ const motion_1 = require("../../motion");
7
8
  // QUERIES
8
9
  // -- Recordings by Time Range
9
10
  exports.QUERY_RECORDINGS_BY_TIME_RANGE = 'cctv:recordings-by-time-range';
@@ -14,6 +15,15 @@ exports.sRecordingsByTimeRangeArgs = zod_1.z.object({
14
15
  timeTo: zod_1.z.number(),
15
16
  });
16
17
  exports.sRecordingsResponse = zod_1.z.array(media_1.sRecordingSequence);
18
+ // -- Motion Stats by Time Range
19
+ exports.QUERY_MOTION_STATS_BY_TIME_RANGE = 'cctv:motion-stats-by-time-range';
20
+ exports.sMotionStatsByTimeRangeArgs = zod_1.z.object({
21
+ device: primitives_1.sDeviceParam,
22
+ streamId: zod_1.z.string().nonempty(),
23
+ timeFrom: zod_1.z.number(),
24
+ timeTo: zod_1.z.number(),
25
+ });
26
+ exports.sMotionStatsResponse = motion_1.sStreamMotionStats;
17
27
  // -- Preview Image
18
28
  exports.QUERY_PREVIEW_IMAGE = 'cctv:preview-image';
19
29
  exports.sPreviewImageArgs = zod_1.z.object({
@@ -34,12 +44,14 @@ exports.sCameraLatestFrameArgs = zod_1.z.object({
34
44
  exports.sCameraLatestFrameResponse = primitives_1.sFileResponse;
35
45
  exports.nvrRecorderRequestSchemas = {
36
46
  [exports.QUERY_RECORDINGS_BY_TIME_RANGE]: exports.sRecordingsByTimeRangeArgs,
47
+ [exports.QUERY_MOTION_STATS_BY_TIME_RANGE]: exports.sMotionStatsByTimeRangeArgs,
37
48
  [exports.QUERY_PREVIEW_IMAGE]: exports.sPreviewImageArgs,
38
49
  [exports.QUERY_CAMERA_LATEST_FRAME]: exports.sCameraLatestFrameArgs,
39
50
  };
40
51
  // Dictionary of response schemas by query type
41
52
  exports.nvrRecorderResponseSchemas = {
42
53
  [exports.QUERY_RECORDINGS_BY_TIME_RANGE]: exports.sRecordingsResponse,
54
+ [exports.QUERY_MOTION_STATS_BY_TIME_RANGE]: exports.sMotionStatsResponse,
43
55
  [exports.QUERY_PREVIEW_IMAGE]: exports.sPreviewImageResponse,
44
56
  [exports.QUERY_CAMERA_LATEST_FRAME]: exports.sCameraLatestFrameResponse,
45
57
  };
@@ -30,6 +30,29 @@ export declare const sGetRecordingsResponse: z.ZodObject<{
30
30
  }, z.core.$strip>>;
31
31
  total: z.ZodNumber;
32
32
  }, z.core.$strip>;
33
+ export declare const sGetMotionStatsRequest: z.ZodObject<{
34
+ deviceId: z.ZodString;
35
+ streamId: z.ZodString;
36
+ timeFrom: z.ZodNumber;
37
+ timeTo: z.ZodNumber;
38
+ }, z.core.$strip>;
39
+ export declare const sGetMotionStatsResponse: z.ZodObject<{
40
+ streamId: z.ZodString;
41
+ from: z.ZodNumber;
42
+ to: z.ZodNumber;
43
+ bucketMs: z.ZodNumber;
44
+ baseline: z.ZodObject<{
45
+ floor: z.ZodNumber;
46
+ ceiling: z.ZodNumber;
47
+ }, z.core.$strip>;
48
+ samples: z.ZodArray<z.ZodObject<{
49
+ t: z.ZodNumber;
50
+ avg: z.ZodNumber;
51
+ max: z.ZodNumber;
52
+ rms: z.ZodNumber;
53
+ n: z.ZodNumber;
54
+ }, z.core.$strip>>;
55
+ }, z.core.$strip>;
33
56
  export declare const sGetPreviewImageRequest: z.ZodObject<{
34
57
  deviceId: z.ZodString;
35
58
  time: z.ZodNumber;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sGetLatestFrameRequest = exports.sMediaSearchQueryDto = exports.sSortOptions = exports.sGetObjectThumbnailRequest = exports.sGetObjectSnapshotRequest = exports.sGetScenePreviewClipRequest = exports.sGetPreviewImageRequest = exports.sGetRecordingsResponse = exports.sGetRecordingsRequest = exports.sRecordingSequence = exports.sCreateExportResponse = exports.sCreateExportRequest = void 0;
3
+ exports.sGetLatestFrameRequest = exports.sMediaSearchQueryDto = exports.sSortOptions = exports.sGetObjectThumbnailRequest = exports.sGetObjectSnapshotRequest = exports.sGetScenePreviewClipRequest = exports.sGetPreviewImageRequest = exports.sGetMotionStatsResponse = exports.sGetMotionStatsRequest = exports.sGetRecordingsResponse = exports.sGetRecordingsRequest = exports.sRecordingSequence = exports.sCreateExportResponse = exports.sCreateExportRequest = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const query_1 = require("./query");
6
+ const motion_1 = require("../../motion");
6
7
  exports.sCreateExportRequest = zod_1.z.object({
7
8
  name: zod_1.z.string().nonempty(),
8
9
  deviceId: zod_1.z.string().nonempty(),
@@ -26,6 +27,13 @@ exports.sGetRecordingsRequest = zod_1.z.object({
26
27
  timeTo: zod_1.z.number().nonnegative(),
27
28
  });
28
29
  exports.sGetRecordingsResponse = (0, query_1.sPaginatedQueryResponseOf)(exports.sRecordingSequence);
30
+ exports.sGetMotionStatsRequest = zod_1.z.object({
31
+ deviceId: zod_1.z.string().nonempty(),
32
+ streamId: zod_1.z.string().nonempty(),
33
+ timeFrom: zod_1.z.number().nonnegative(),
34
+ timeTo: zod_1.z.number().nonnegative(),
35
+ });
36
+ exports.sGetMotionStatsResponse = motion_1.sStreamMotionStats;
29
37
  exports.sGetPreviewImageRequest = zod_1.z.object({
30
38
  deviceId: zod_1.z.string().nonempty(),
31
39
  time: zod_1.z.number().nonnegative(),
package/dist/index.d.ts CHANGED
@@ -5,3 +5,4 @@ export * from './objects';
5
5
  export * from './primitives';
6
6
  export * from './primitives/credential-type';
7
7
  export * from './_legacy';
8
+ export * from './motion';
package/dist/index.js CHANGED
@@ -21,3 +21,4 @@ __exportStar(require("./objects"), exports);
21
21
  __exportStar(require("./primitives"), exports);
22
22
  __exportStar(require("./primitives/credential-type"), exports);
23
23
  __exportStar(require("./_legacy"), exports);
24
+ __exportStar(require("./motion"), exports);
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ export declare const sStreamMotionStatsSample: z.ZodObject<{
3
+ t: z.ZodNumber;
4
+ avg: z.ZodNumber;
5
+ max: z.ZodNumber;
6
+ rms: z.ZodNumber;
7
+ n: z.ZodNumber;
8
+ }, z.core.$strip>;
9
+ export declare const sStreamMotionStats: z.ZodObject<{
10
+ streamId: z.ZodString;
11
+ from: z.ZodNumber;
12
+ to: z.ZodNumber;
13
+ bucketMs: z.ZodNumber;
14
+ baseline: z.ZodObject<{
15
+ floor: z.ZodNumber;
16
+ ceiling: z.ZodNumber;
17
+ }, z.core.$strip>;
18
+ samples: z.ZodArray<z.ZodObject<{
19
+ t: z.ZodNumber;
20
+ avg: z.ZodNumber;
21
+ max: z.ZodNumber;
22
+ rms: z.ZodNumber;
23
+ n: z.ZodNumber;
24
+ }, z.core.$strip>>;
25
+ }, z.core.$strip>;
26
+ export type StreamMotionStatsSample = z.infer<typeof sStreamMotionStatsSample>;
27
+ export type StreamMotionStats = z.infer<typeof sStreamMotionStats>;
package/dist/motion.js ADDED
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ // {
3
+ // "streamId": "60d0d4ba-a90b-4a00-9ceb-b05838f81651-3632e728-5481-4f2f-8bb8-0e78dfff1a22",
4
+ // "from": 1786355101000,
5
+ // "to": 1786527901000,
6
+ // "bucketMs": 34560,
7
+ // "baseline": {
8
+ // "floor": 0.93,
9
+ // "ceiling": 3.04
10
+ // },
11
+ // "samples": [
12
+ // {
13
+ // "t": 1786447284480,
14
+ // "avg": 0.37579882,
15
+ // "max": 2.23,
16
+ // "rms": 0.27923077,
17
+ // "n": 169
18
+ // },
19
+ // {
20
+ // "t": 1786447319040,
21
+ // "avg": 0.8835294,
22
+ // "max": 1.84,
23
+ // "rms": 0.4920588,
24
+ // "n": 34
25
+ // }
26
+ // ]
27
+ // }
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.sStreamMotionStats = exports.sStreamMotionStatsSample = void 0;
30
+ const zod_1 = require("zod");
31
+ exports.sStreamMotionStatsSample = zod_1.z.object({
32
+ t: zod_1.z.number().int().nonnegative(),
33
+ avg: zod_1.z.number(),
34
+ max: zod_1.z.number(),
35
+ rms: zod_1.z.number(),
36
+ n: zod_1.z.number().int().nonnegative(),
37
+ });
38
+ exports.sStreamMotionStats = zod_1.z.object({
39
+ streamId: zod_1.z.string(),
40
+ from: zod_1.z.number().int().nonnegative(),
41
+ to: zod_1.z.number().int().nonnegative(),
42
+ bucketMs: zod_1.z.number().int().nonnegative(),
43
+ baseline: zod_1.z.object({
44
+ floor: zod_1.z.number(),
45
+ ceiling: zod_1.z.number(),
46
+ }),
47
+ samples: zod_1.z.array(exports.sStreamMotionStatsSample),
48
+ });
@@ -4,4 +4,10 @@ export declare const sWorldObject: z.ZodObject<{
4
4
  label: z.ZodString;
5
5
  }, z.core.$strip>;
6
6
  export type WorldObject = z.infer<typeof sWorldObject>;
7
- export declare const worldObjects: WorldObject[];
7
+ export declare const sWorldObjectDto: z.ZodObject<{
8
+ id: z.ZodString;
9
+ label: z.ZodString;
10
+ createdOn: z.ZodString;
11
+ lastModifiedOn: z.ZodString;
12
+ }, z.core.$strip>;
13
+ export type WorldObjectDto = z.infer<typeof sWorldObjectDto>;
@@ -1,38 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.worldObjects = exports.sWorldObject = void 0;
3
+ exports.sWorldObjectDto = exports.sWorldObject = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.sWorldObject = zod_1.z.object({
6
6
  id: zod_1.z.string().describe('The unique identifier of the world object'),
7
7
  label: zod_1.z.string().describe('The label of the world object'),
8
8
  });
9
- exports.worldObjects = [
10
- {
11
- id: 'person',
12
- label: 'Person',
13
- },
14
- {
15
- id: 'backpack',
16
- label: 'Backpack',
17
- },
18
- {
19
- id: 'cell-phone',
20
- label: 'Cell Phone',
21
- },
22
- {
23
- id: 'handbag',
24
- label: 'Handbag',
25
- },
26
- {
27
- id: 'laptop',
28
- label: 'Laptop',
29
- },
30
- {
31
- id: 'bicycle',
32
- label: 'Bicycle',
33
- },
34
- {
35
- id: 'car',
36
- label: 'Car',
37
- },
38
- ];
9
+ exports.sWorldObjectDto = exports.sWorldObject.extend({
10
+ createdOn: zod_1.z
11
+ .string()
12
+ .describe('The date and time when the world object was created'),
13
+ lastModifiedOn: zod_1.z
14
+ .string()
15
+ .describe('The date and time when the world object was last modified'),
16
+ });
package/dist/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/Linc-Security-Systems/aware-essentials.git"
6
6
  },
7
- "version": "2.0.122",
7
+ "version": "2.0.124",
8
8
  "description": "Common types between backend, agent(s) and frontend(s)",
9
9
  "main": "dist/index.js",
10
10
  "types": "dist/index.d.ts",
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/Linc-Security-Systems/aware-essentials.git"
6
6
  },
7
- "version": "2.0.122",
7
+ "version": "2.0.124",
8
8
  "description": "Common types between backend, agent(s) and frontend(s)",
9
9
  "main": "dist/index.js",
10
10
  "types": "dist/index.d.ts",