@awarevue/api-types 2.0.14 → 2.0.16

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.
@@ -18,6 +18,639 @@ export type CommandRun<TCommand extends AnyDeviceCommand = AnyDeviceCommand> = {
18
18
  senderId?: number;
19
19
  } & TCommand;
20
20
  export declare const commandSchemas: {
21
+ readonly 'server.run-macro': import("zod").ZodObject<{
22
+ command: import("zod").ZodLiteral<"server.run-macro">;
23
+ params: import("zod").ZodObject<{
24
+ macroId: import("zod").ZodString;
25
+ }, "strip", import("zod").ZodTypeAny, {
26
+ macroId: string;
27
+ }, {
28
+ macroId: string;
29
+ }>;
30
+ }, "strip", import("zod").ZodTypeAny, {
31
+ params: {
32
+ macroId: string;
33
+ };
34
+ command: "server.run-macro";
35
+ }, {
36
+ params: {
37
+ macroId: string;
38
+ };
39
+ command: "server.run-macro";
40
+ }>;
41
+ readonly 'server.notify': import("zod").ZodObject<{
42
+ command: import("zod").ZodLiteral<"server.notify">;
43
+ params: import("zod").ZodObject<{
44
+ source: import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodIntersection<import("zod").ZodObject<{
45
+ name: import("zod").ZodString;
46
+ foreignRef: import("zod").ZodString;
47
+ provider: import("zod").ZodString;
48
+ providerMetadata: import("zod").ZodObject<{}, "strip", import("zod").ZodUnknown, import("zod").objectOutputType<{}, import("zod").ZodUnknown, "strip">, import("zod").objectInputType<{}, import("zod").ZodUnknown, "strip">>;
49
+ }, "strip", import("zod").ZodTypeAny, {
50
+ name: string;
51
+ foreignRef: string;
52
+ provider: string;
53
+ providerMetadata: {} & {
54
+ [k: string]: unknown;
55
+ };
56
+ }, {
57
+ name: string;
58
+ foreignRef: string;
59
+ provider: string;
60
+ providerMetadata: {} & {
61
+ [k: string]: unknown;
62
+ };
63
+ }>, import("zod").ZodDiscriminatedUnion<"type", [import("zod").ZodObject<{
64
+ type: import("zod").ZodLiteral<"alarm">;
65
+ }, "strip", import("zod").ZodTypeAny, {
66
+ type: "alarm";
67
+ }, {
68
+ type: "alarm";
69
+ }>, import("zod").ZodObject<{
70
+ lensType: import("zod").ZodEnum<["flat", "fisheye"]>;
71
+ mountPoint: import("zod").ZodEnum<["wall", "ceiling", "floor"]>;
72
+ ptzCapable: import("zod").ZodBoolean;
73
+ ptzPanSpeed: import("zod").ZodNumber;
74
+ ptzTiltSpeed: import("zod").ZodNumber;
75
+ ptzZoomSpeed: import("zod").ZodNumber;
76
+ panMin: import("zod").ZodNumber;
77
+ panMax: import("zod").ZodNumber;
78
+ tiltMin: import("zod").ZodNumber;
79
+ tiltMax: import("zod").ZodNumber;
80
+ zoomMin: import("zod").ZodNumber;
81
+ zoomMax: import("zod").ZodNumber;
82
+ recordingCapable: import("zod").ZodBoolean;
83
+ webrtcPlaybackSource: import("zod").ZodNullable<import("zod").ZodIntersection<import("zod").ZodObject<{
84
+ kind: import("zod").ZodString;
85
+ }, "strip", import("zod").ZodTypeAny, {
86
+ kind: string;
87
+ }, {
88
+ kind: string;
89
+ }>, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>>;
90
+ streams: import("zod").ZodArray<import("zod").ZodObject<{
91
+ id: import("zod").ZodString;
92
+ displayName: import("zod").ZodString;
93
+ externalPlayerUrl: import("zod").ZodNullable<import("zod").ZodString>;
94
+ }, "strip", import("zod").ZodTypeAny, {
95
+ id: string;
96
+ displayName: string;
97
+ externalPlayerUrl: string | null;
98
+ }, {
99
+ id: string;
100
+ displayName: string;
101
+ externalPlayerUrl: string | null;
102
+ }>, "many">;
103
+ defaultStreamId: import("zod").ZodString;
104
+ } & {
105
+ type: import("zod").ZodLiteral<"camera">;
106
+ }, "strip", import("zod").ZodTypeAny, {
107
+ type: "camera";
108
+ streams: {
109
+ id: string;
110
+ displayName: string;
111
+ externalPlayerUrl: string | null;
112
+ }[];
113
+ lensType: "flat" | "fisheye";
114
+ mountPoint: "wall" | "ceiling" | "floor";
115
+ ptzCapable: boolean;
116
+ ptzPanSpeed: number;
117
+ ptzTiltSpeed: number;
118
+ ptzZoomSpeed: number;
119
+ panMin: number;
120
+ panMax: number;
121
+ tiltMin: number;
122
+ tiltMax: number;
123
+ zoomMin: number;
124
+ zoomMax: number;
125
+ recordingCapable: boolean;
126
+ webrtcPlaybackSource: ({
127
+ kind: string;
128
+ } & Record<string, unknown>) | null;
129
+ defaultStreamId: string;
130
+ }, {
131
+ type: "camera";
132
+ streams: {
133
+ id: string;
134
+ displayName: string;
135
+ externalPlayerUrl: string | null;
136
+ }[];
137
+ lensType: "flat" | "fisheye";
138
+ mountPoint: "wall" | "ceiling" | "floor";
139
+ ptzCapable: boolean;
140
+ ptzPanSpeed: number;
141
+ ptzTiltSpeed: number;
142
+ ptzZoomSpeed: number;
143
+ panMin: number;
144
+ panMax: number;
145
+ tiltMin: number;
146
+ tiltMax: number;
147
+ zoomMin: number;
148
+ zoomMax: number;
149
+ recordingCapable: boolean;
150
+ webrtcPlaybackSource: ({
151
+ kind: string;
152
+ } & Record<string, unknown>) | null;
153
+ defaultStreamId: string;
154
+ }>, import("zod").ZodObject<{
155
+ canReportOpenState: import("zod").ZodBoolean;
156
+ canReportLockState: import("zod").ZodBoolean;
157
+ canControlLock: import("zod").ZodBoolean;
158
+ canRelease: import("zod").ZodBoolean;
159
+ } & {
160
+ type: import("zod").ZodLiteral<"door">;
161
+ }, "strip", import("zod").ZodTypeAny, {
162
+ type: "door";
163
+ canReportOpenState: boolean;
164
+ canReportLockState: boolean;
165
+ canControlLock: boolean;
166
+ canRelease: boolean;
167
+ }, {
168
+ type: "door";
169
+ canReportOpenState: boolean;
170
+ canReportLockState: boolean;
171
+ canControlLock: boolean;
172
+ canRelease: boolean;
173
+ }>, import("zod").ZodObject<{
174
+ inputs: import("zod").ZodArray<import("zod").ZodString, "many">;
175
+ outputs: import("zod").ZodArray<import("zod").ZodString, "many">;
176
+ } & {
177
+ type: import("zod").ZodLiteral<"io-board">;
178
+ }, "strip", import("zod").ZodTypeAny, {
179
+ type: "io-board";
180
+ inputs: string[];
181
+ outputs: string[];
182
+ }, {
183
+ type: "io-board";
184
+ inputs: string[];
185
+ outputs: string[];
186
+ }>, import("zod").ZodObject<{
187
+ type: import("zod").ZodLiteral<"camera-lift">;
188
+ }, "strip", import("zod").ZodTypeAny, {
189
+ type: "camera-lift";
190
+ }, {
191
+ type: "camera-lift";
192
+ }>, import("zod").ZodObject<{
193
+ type: import("zod").ZodLiteral<"motion-sensor">;
194
+ }, "strip", import("zod").ZodTypeAny, {
195
+ type: "motion-sensor";
196
+ }, {
197
+ type: "motion-sensor";
198
+ }>, import("zod").ZodObject<{
199
+ type: import("zod").ZodLiteral<"panic-button">;
200
+ }, "strip", import("zod").ZodTypeAny, {
201
+ type: "panic-button";
202
+ }, {
203
+ type: "panic-button";
204
+ }>, import("zod").ZodObject<{
205
+ sipUri: import("zod").ZodString;
206
+ sipUser: import("zod").ZodString;
207
+ sipPassword: import("zod").ZodString;
208
+ sipRealm: import("zod").ZodString;
209
+ remoteExtension: import("zod").ZodString;
210
+ } & {
211
+ type: import("zod").ZodLiteral<"intercom-terminal">;
212
+ }, "strip", import("zod").ZodTypeAny, {
213
+ type: "intercom-terminal";
214
+ sipUri: string;
215
+ sipUser: string;
216
+ sipPassword: string;
217
+ sipRealm: string;
218
+ remoteExtension: string;
219
+ }, {
220
+ type: "intercom-terminal";
221
+ sipUri: string;
222
+ sipUser: string;
223
+ sipPassword: string;
224
+ sipRealm: string;
225
+ remoteExtension: string;
226
+ }>, import("zod").ZodObject<{
227
+ sipWsUrl: import("zod").ZodString;
228
+ } & {
229
+ type: import("zod").ZodLiteral<"pbx">;
230
+ }, "strip", import("zod").ZodTypeAny, {
231
+ type: "pbx";
232
+ sipWsUrl: string;
233
+ }, {
234
+ type: "pbx";
235
+ sipWsUrl: string;
236
+ }>, import("zod").ZodObject<{
237
+ type: import("zod").ZodLiteral<"server">;
238
+ }, "strip", import("zod").ZodTypeAny, {
239
+ type: "server";
240
+ }, {
241
+ type: "server";
242
+ }>, import("zod").ZodObject<{
243
+ type: import("zod").ZodLiteral<"intercom-operator">;
244
+ }, "strip", import("zod").ZodTypeAny, {
245
+ type: "intercom-operator";
246
+ }, {
247
+ type: "intercom-operator";
248
+ }>, import("zod").ZodObject<{
249
+ type: import("zod").ZodLiteral<"device-gateway">;
250
+ }, "strip", import("zod").ZodTypeAny, {
251
+ type: "device-gateway";
252
+ }, {
253
+ type: "device-gateway";
254
+ }>, import("zod").ZodObject<{
255
+ type: import("zod").ZodLiteral<"presence-tracker">;
256
+ }, "strip", import("zod").ZodTypeAny, {
257
+ type: "presence-tracker";
258
+ }, {
259
+ type: "presence-tracker";
260
+ }>, import("zod").ZodObject<{
261
+ type: import("zod").ZodLiteral<"reader">;
262
+ }, "strip", import("zod").ZodTypeAny, {
263
+ type: "reader";
264
+ }, {
265
+ type: "reader";
266
+ }>, import("zod").ZodObject<{
267
+ type: import("zod").ZodLiteral<"display">;
268
+ }, "strip", import("zod").ZodTypeAny, {
269
+ type: "display";
270
+ }, {
271
+ type: "display";
272
+ }>, import("zod").ZodObject<{
273
+ type: import("zod").ZodLiteral<"nvr-recorder">;
274
+ }, "strip", import("zod").ZodTypeAny, {
275
+ type: "nvr-recorder";
276
+ }, {
277
+ type: "nvr-recorder";
278
+ }>, import("zod").ZodObject<{
279
+ type: import("zod").ZodLiteral<"nvr-exporter">;
280
+ }, "strip", import("zod").ZodTypeAny, {
281
+ type: "nvr-exporter";
282
+ }, {
283
+ type: "nvr-exporter";
284
+ }>, import("zod").ZodObject<{
285
+ type: import("zod").ZodLiteral<"nvr-analytics-server">;
286
+ }, "strip", import("zod").ZodTypeAny, {
287
+ type: "nvr-analytics-server";
288
+ }, {
289
+ type: "nvr-analytics-server";
290
+ }>, import("zod").ZodObject<{
291
+ type: import("zod").ZodLiteral<"system">;
292
+ }, "strip", import("zod").ZodTypeAny, {
293
+ type: "system";
294
+ }, {
295
+ type: "system";
296
+ }>]>>]>, import("zod").ZodTuple<[import("zod").ZodString, import("zod").ZodString], null>]>;
297
+ message: import("zod").ZodString;
298
+ severity: import("zod").ZodEnum<["info", "warning", "critical"]>;
299
+ metadata: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
300
+ notificationRef: import("zod").ZodNullable<import("zod").ZodString>;
301
+ recipientId: import("zod").ZodNullable<import("zod").ZodString>;
302
+ }, "strip", import("zod").ZodTypeAny, {
303
+ message: string;
304
+ source: string | [string, string] | ({
305
+ name: string;
306
+ foreignRef: string;
307
+ provider: string;
308
+ providerMetadata: {} & {
309
+ [k: string]: unknown;
310
+ };
311
+ } & ({
312
+ type: "alarm";
313
+ } | {
314
+ type: "camera";
315
+ streams: {
316
+ id: string;
317
+ displayName: string;
318
+ externalPlayerUrl: string | null;
319
+ }[];
320
+ lensType: "flat" | "fisheye";
321
+ mountPoint: "wall" | "ceiling" | "floor";
322
+ ptzCapable: boolean;
323
+ ptzPanSpeed: number;
324
+ ptzTiltSpeed: number;
325
+ ptzZoomSpeed: number;
326
+ panMin: number;
327
+ panMax: number;
328
+ tiltMin: number;
329
+ tiltMax: number;
330
+ zoomMin: number;
331
+ zoomMax: number;
332
+ recordingCapable: boolean;
333
+ webrtcPlaybackSource: ({
334
+ kind: string;
335
+ } & Record<string, unknown>) | null;
336
+ defaultStreamId: string;
337
+ } | {
338
+ type: "door";
339
+ canReportOpenState: boolean;
340
+ canReportLockState: boolean;
341
+ canControlLock: boolean;
342
+ canRelease: boolean;
343
+ } | {
344
+ type: "io-board";
345
+ inputs: string[];
346
+ outputs: string[];
347
+ } | {
348
+ type: "camera-lift";
349
+ } | {
350
+ type: "motion-sensor";
351
+ } | {
352
+ type: "panic-button";
353
+ } | {
354
+ type: "intercom-terminal";
355
+ sipUri: string;
356
+ sipUser: string;
357
+ sipPassword: string;
358
+ sipRealm: string;
359
+ remoteExtension: string;
360
+ } | {
361
+ type: "pbx";
362
+ sipWsUrl: string;
363
+ } | {
364
+ type: "server";
365
+ } | {
366
+ type: "intercom-operator";
367
+ } | {
368
+ type: "device-gateway";
369
+ } | {
370
+ type: "presence-tracker";
371
+ } | {
372
+ type: "reader";
373
+ } | {
374
+ type: "display";
375
+ } | {
376
+ type: "nvr-recorder";
377
+ } | {
378
+ type: "nvr-exporter";
379
+ } | {
380
+ type: "nvr-analytics-server";
381
+ } | {
382
+ type: "system";
383
+ }));
384
+ metadata: Record<string, unknown>;
385
+ severity: "info" | "warning" | "critical";
386
+ notificationRef: string | null;
387
+ recipientId: string | null;
388
+ }, {
389
+ message: string;
390
+ source: string | [string, string] | ({
391
+ name: string;
392
+ foreignRef: string;
393
+ provider: string;
394
+ providerMetadata: {} & {
395
+ [k: string]: unknown;
396
+ };
397
+ } & ({
398
+ type: "alarm";
399
+ } | {
400
+ type: "camera";
401
+ streams: {
402
+ id: string;
403
+ displayName: string;
404
+ externalPlayerUrl: string | null;
405
+ }[];
406
+ lensType: "flat" | "fisheye";
407
+ mountPoint: "wall" | "ceiling" | "floor";
408
+ ptzCapable: boolean;
409
+ ptzPanSpeed: number;
410
+ ptzTiltSpeed: number;
411
+ ptzZoomSpeed: number;
412
+ panMin: number;
413
+ panMax: number;
414
+ tiltMin: number;
415
+ tiltMax: number;
416
+ zoomMin: number;
417
+ zoomMax: number;
418
+ recordingCapable: boolean;
419
+ webrtcPlaybackSource: ({
420
+ kind: string;
421
+ } & Record<string, unknown>) | null;
422
+ defaultStreamId: string;
423
+ } | {
424
+ type: "door";
425
+ canReportOpenState: boolean;
426
+ canReportLockState: boolean;
427
+ canControlLock: boolean;
428
+ canRelease: boolean;
429
+ } | {
430
+ type: "io-board";
431
+ inputs: string[];
432
+ outputs: string[];
433
+ } | {
434
+ type: "camera-lift";
435
+ } | {
436
+ type: "motion-sensor";
437
+ } | {
438
+ type: "panic-button";
439
+ } | {
440
+ type: "intercom-terminal";
441
+ sipUri: string;
442
+ sipUser: string;
443
+ sipPassword: string;
444
+ sipRealm: string;
445
+ remoteExtension: string;
446
+ } | {
447
+ type: "pbx";
448
+ sipWsUrl: string;
449
+ } | {
450
+ type: "server";
451
+ } | {
452
+ type: "intercom-operator";
453
+ } | {
454
+ type: "device-gateway";
455
+ } | {
456
+ type: "presence-tracker";
457
+ } | {
458
+ type: "reader";
459
+ } | {
460
+ type: "display";
461
+ } | {
462
+ type: "nvr-recorder";
463
+ } | {
464
+ type: "nvr-exporter";
465
+ } | {
466
+ type: "nvr-analytics-server";
467
+ } | {
468
+ type: "system";
469
+ }));
470
+ metadata: Record<string, unknown>;
471
+ severity: "info" | "warning" | "critical";
472
+ notificationRef: string | null;
473
+ recipientId: string | null;
474
+ }>;
475
+ }, "strip", import("zod").ZodTypeAny, {
476
+ params: {
477
+ message: string;
478
+ source: string | [string, string] | ({
479
+ name: string;
480
+ foreignRef: string;
481
+ provider: string;
482
+ providerMetadata: {} & {
483
+ [k: string]: unknown;
484
+ };
485
+ } & ({
486
+ type: "alarm";
487
+ } | {
488
+ type: "camera";
489
+ streams: {
490
+ id: string;
491
+ displayName: string;
492
+ externalPlayerUrl: string | null;
493
+ }[];
494
+ lensType: "flat" | "fisheye";
495
+ mountPoint: "wall" | "ceiling" | "floor";
496
+ ptzCapable: boolean;
497
+ ptzPanSpeed: number;
498
+ ptzTiltSpeed: number;
499
+ ptzZoomSpeed: number;
500
+ panMin: number;
501
+ panMax: number;
502
+ tiltMin: number;
503
+ tiltMax: number;
504
+ zoomMin: number;
505
+ zoomMax: number;
506
+ recordingCapable: boolean;
507
+ webrtcPlaybackSource: ({
508
+ kind: string;
509
+ } & Record<string, unknown>) | null;
510
+ defaultStreamId: string;
511
+ } | {
512
+ type: "door";
513
+ canReportOpenState: boolean;
514
+ canReportLockState: boolean;
515
+ canControlLock: boolean;
516
+ canRelease: boolean;
517
+ } | {
518
+ type: "io-board";
519
+ inputs: string[];
520
+ outputs: string[];
521
+ } | {
522
+ type: "camera-lift";
523
+ } | {
524
+ type: "motion-sensor";
525
+ } | {
526
+ type: "panic-button";
527
+ } | {
528
+ type: "intercom-terminal";
529
+ sipUri: string;
530
+ sipUser: string;
531
+ sipPassword: string;
532
+ sipRealm: string;
533
+ remoteExtension: string;
534
+ } | {
535
+ type: "pbx";
536
+ sipWsUrl: string;
537
+ } | {
538
+ type: "server";
539
+ } | {
540
+ type: "intercom-operator";
541
+ } | {
542
+ type: "device-gateway";
543
+ } | {
544
+ type: "presence-tracker";
545
+ } | {
546
+ type: "reader";
547
+ } | {
548
+ type: "display";
549
+ } | {
550
+ type: "nvr-recorder";
551
+ } | {
552
+ type: "nvr-exporter";
553
+ } | {
554
+ type: "nvr-analytics-server";
555
+ } | {
556
+ type: "system";
557
+ }));
558
+ metadata: Record<string, unknown>;
559
+ severity: "info" | "warning" | "critical";
560
+ notificationRef: string | null;
561
+ recipientId: string | null;
562
+ };
563
+ command: "server.notify";
564
+ }, {
565
+ params: {
566
+ message: string;
567
+ source: string | [string, string] | ({
568
+ name: string;
569
+ foreignRef: string;
570
+ provider: string;
571
+ providerMetadata: {} & {
572
+ [k: string]: unknown;
573
+ };
574
+ } & ({
575
+ type: "alarm";
576
+ } | {
577
+ type: "camera";
578
+ streams: {
579
+ id: string;
580
+ displayName: string;
581
+ externalPlayerUrl: string | null;
582
+ }[];
583
+ lensType: "flat" | "fisheye";
584
+ mountPoint: "wall" | "ceiling" | "floor";
585
+ ptzCapable: boolean;
586
+ ptzPanSpeed: number;
587
+ ptzTiltSpeed: number;
588
+ ptzZoomSpeed: number;
589
+ panMin: number;
590
+ panMax: number;
591
+ tiltMin: number;
592
+ tiltMax: number;
593
+ zoomMin: number;
594
+ zoomMax: number;
595
+ recordingCapable: boolean;
596
+ webrtcPlaybackSource: ({
597
+ kind: string;
598
+ } & Record<string, unknown>) | null;
599
+ defaultStreamId: string;
600
+ } | {
601
+ type: "door";
602
+ canReportOpenState: boolean;
603
+ canReportLockState: boolean;
604
+ canControlLock: boolean;
605
+ canRelease: boolean;
606
+ } | {
607
+ type: "io-board";
608
+ inputs: string[];
609
+ outputs: string[];
610
+ } | {
611
+ type: "camera-lift";
612
+ } | {
613
+ type: "motion-sensor";
614
+ } | {
615
+ type: "panic-button";
616
+ } | {
617
+ type: "intercom-terminal";
618
+ sipUri: string;
619
+ sipUser: string;
620
+ sipPassword: string;
621
+ sipRealm: string;
622
+ remoteExtension: string;
623
+ } | {
624
+ type: "pbx";
625
+ sipWsUrl: string;
626
+ } | {
627
+ type: "server";
628
+ } | {
629
+ type: "intercom-operator";
630
+ } | {
631
+ type: "device-gateway";
632
+ } | {
633
+ type: "presence-tracker";
634
+ } | {
635
+ type: "reader";
636
+ } | {
637
+ type: "display";
638
+ } | {
639
+ type: "nvr-recorder";
640
+ } | {
641
+ type: "nvr-exporter";
642
+ } | {
643
+ type: "nvr-analytics-server";
644
+ } | {
645
+ type: "system";
646
+ }));
647
+ metadata: Record<string, unknown>;
648
+ severity: "info" | "warning" | "critical";
649
+ notificationRef: string | null;
650
+ recipientId: string | null;
651
+ };
652
+ command: "server.notify";
653
+ }>;
21
654
  readonly 'nvr-exporter.start-export': import("zod").ZodObject<{
22
655
  command: import("zod").ZodLiteral<"nvr-exporter.start-export">;
23
656
  params: import("zod").ZodObject<{
@@ -10,6 +10,7 @@ const io_board_1 = require("./io-board");
10
10
  const nvr_exporter_1 = require("./nvr-exporter");
11
11
  const pbx_1 = require("./pbx");
12
12
  const presence_tracker_1 = require("./presence-tracker");
13
+ const server_1 = require("./server");
13
14
  exports.commandSchemas = {
14
15
  ...alarm_1.alarmCommandSchemas,
15
16
  ...camera_1.cameraCommands,
@@ -20,6 +21,7 @@ exports.commandSchemas = {
20
21
  ...presence_tracker_1.presenceTrackerCommands,
21
22
  ...display_1.displayCommands,
22
23
  ...nvr_exporter_1.nvrExporterCommandSchemas,
24
+ ...server_1.serverCommands,
23
25
  };
24
26
  exports.commandDescriptions = {
25
27
  'camera.ptz-set': { description: 'PTZ Set', permission: 'camera:ptz' },
@@ -10,12 +10,24 @@ import { ReaderEvent } from './reader';
10
10
  import { ServerEvent } from './server';
11
11
  import { NvrExporterEvent } from './nvr-exporter';
12
12
  import { DeviceType } from '../device';
13
- export interface DeviceCommandTriggered {
14
- kind: 'device-command';
15
- userId?: string;
13
+ import { NotificationSeverity } from 'src/primitives';
14
+ export declare const sDeviceCommandTriggered: z.ZodObject<{
15
+ kind: z.ZodLiteral<"device-command">;
16
+ userId: z.ZodOptional<z.ZodString>;
17
+ command: z.ZodString;
18
+ args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ args: Record<string, unknown>;
21
+ kind: "device-command";
16
22
  command: string;
17
- args: object;
18
- }
23
+ userId?: string | undefined;
24
+ }, {
25
+ args: Record<string, unknown>;
26
+ kind: "device-command";
27
+ command: string;
28
+ userId?: string | undefined;
29
+ }>;
30
+ export type DeviceCommandTriggered = z.infer<typeof sDeviceCommandTriggered>;
19
31
  export declare const sMotionDetected: z.ZodObject<{
20
32
  kind: z.ZodLiteral<"motion-detected">;
21
33
  }, "strip", z.ZodTypeAny, {
@@ -24,15 +36,42 @@ export declare const sMotionDetected: z.ZodObject<{
24
36
  kind: "motion-detected";
25
37
  }>;
26
38
  export type MotionDetectedEvent = z.infer<typeof sMotionDetected>;
27
- export interface DeviceConnectedEvent {
28
- kind: 'device-connected';
29
- clientId?: number;
39
+ export declare const sDeviceConnectedEvent: z.ZodObject<{
40
+ kind: z.ZodLiteral<"device-connected">;
41
+ clientId: z.ZodOptional<z.ZodNumber>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ kind: "device-connected";
44
+ clientId?: number | undefined;
45
+ }, {
46
+ kind: "device-connected";
47
+ clientId?: number | undefined;
48
+ }>;
49
+ export type DeviceConnectedEvent = z.infer<typeof sDeviceConnectedEvent>;
50
+ export declare const sDeviceDisconnectedEvent: z.ZodObject<{
51
+ kind: z.ZodLiteral<"device-disconnected">;
52
+ clientId: z.ZodOptional<z.ZodNumber>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ kind: "device-disconnected";
55
+ clientId?: number | undefined;
56
+ }, {
57
+ kind: "device-disconnected";
58
+ clientId?: number | undefined;
59
+ }>;
60
+ export type DeviceDisconnectedEvent = z.infer<typeof sDeviceDisconnectedEvent>;
61
+ export interface NotificationCreatedEvent {
62
+ kind: 'notification-created';
63
+ notificationId: string;
64
+ message: string;
65
+ severity: NotificationSeverity;
66
+ metadata: Record<string, unknown>;
67
+ notificationRef: string | null;
68
+ recipientId: string | null;
30
69
  }
31
- export interface DeviceDisconnectedEvent {
32
- kind: 'device-disconnected';
33
- clientId?: number;
70
+ export interface NotificationAcknowledgedEvent {
71
+ kind: 'notification-acknowledged';
72
+ notificationId: string;
34
73
  }
35
- export type AnyDeviceEvent = DeviceCommandTriggered | CameraEvent | DoorEvent | AlarmEvent | MotionDetectedEvent | ReaderEvent | PanicButtonEvent | DeviceConnectedEvent | DeviceDisconnectedEvent | IntercomTerminalEvent | ServerEvent | PresenceTrackerEvent | IoBoardEvent | NvrExporterEvent;
74
+ export type AnyDeviceEvent = DeviceCommandTriggered | CameraEvent | DoorEvent | AlarmEvent | MotionDetectedEvent | ReaderEvent | PanicButtonEvent | DeviceConnectedEvent | DeviceDisconnectedEvent | NotificationCreatedEvent | NotificationAcknowledgedEvent | IntercomTerminalEvent | ServerEvent | PresenceTrackerEvent | IoBoardEvent | NvrExporterEvent;
36
75
  export declare const sEventHeader: z.ZodObject<{
37
76
  id: z.ZodString;
38
77
  timestamp: z.ZodNumber;
@@ -60,6 +99,42 @@ export declare const eventSchemaByKind: {
60
99
  }, {
61
100
  kind: "motion-detected";
62
101
  }>;
102
+ 'device-command': z.ZodObject<{
103
+ kind: z.ZodLiteral<"device-command">;
104
+ userId: z.ZodOptional<z.ZodString>;
105
+ command: z.ZodString;
106
+ args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ args: Record<string, unknown>;
109
+ kind: "device-command";
110
+ command: string;
111
+ userId?: string | undefined;
112
+ }, {
113
+ args: Record<string, unknown>;
114
+ kind: "device-command";
115
+ command: string;
116
+ userId?: string | undefined;
117
+ }>;
118
+ 'device-connected': z.ZodObject<{
119
+ kind: z.ZodLiteral<"device-connected">;
120
+ clientId: z.ZodOptional<z.ZodNumber>;
121
+ }, "strip", z.ZodTypeAny, {
122
+ kind: "device-connected";
123
+ clientId?: number | undefined;
124
+ }, {
125
+ kind: "device-connected";
126
+ clientId?: number | undefined;
127
+ }>;
128
+ 'device-disconnected': z.ZodObject<{
129
+ kind: z.ZodLiteral<"device-disconnected">;
130
+ clientId: z.ZodOptional<z.ZodNumber>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ kind: "device-disconnected";
133
+ clientId?: number | undefined;
134
+ }, {
135
+ kind: "device-disconnected";
136
+ clientId?: number | undefined;
137
+ }>;
63
138
  'nvr-export-started': z.ZodObject<{
64
139
  kind: z.ZodLiteral<"nvr-export-started">;
65
140
  exportId: z.ZodString;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isDeviceEvent = exports.eventsByDeviceType = exports.eventSchemaByKind = exports.eventKindLabels = exports.sEventHeader = exports.sMotionDetected = void 0;
3
+ exports.isDeviceEvent = exports.eventsByDeviceType = exports.eventSchemaByKind = exports.eventKindLabels = exports.sEventHeader = exports.sDeviceDisconnectedEvent = exports.sDeviceConnectedEvent = exports.sMotionDetected = exports.sDeviceCommandTriggered = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const alarm_1 = require("./alarm");
6
6
  const camera_1 = require("./camera");
@@ -11,9 +11,23 @@ const panic_button_1 = require("./panic-button");
11
11
  const presence_tracker_1 = require("./presence-tracker");
12
12
  const reader_1 = require("./reader");
13
13
  const nvr_exporter_1 = require("./nvr-exporter");
14
+ exports.sDeviceCommandTriggered = zod_1.z.object({
15
+ kind: zod_1.z.literal('device-command'),
16
+ userId: zod_1.z.string().nonempty().optional(),
17
+ command: zod_1.z.string().nonempty(),
18
+ args: zod_1.z.record(zod_1.z.unknown()),
19
+ });
14
20
  exports.sMotionDetected = zod_1.z.object({
15
21
  kind: zod_1.z.literal('motion-detected'),
16
22
  });
23
+ exports.sDeviceConnectedEvent = zod_1.z.object({
24
+ kind: zod_1.z.literal('device-connected'),
25
+ clientId: zod_1.z.number().int().positive().optional(),
26
+ });
27
+ exports.sDeviceDisconnectedEvent = zod_1.z.object({
28
+ kind: zod_1.z.literal('device-disconnected'),
29
+ clientId: zod_1.z.number().int().positive().optional(),
30
+ });
17
31
  exports.sEventHeader = zod_1.z.object({
18
32
  id: zod_1.z.string().nonempty(),
19
33
  timestamp: zod_1.z.number().int().positive(),
@@ -65,6 +79,8 @@ exports.eventKindLabels = {
65
79
  'door-closed': 'Door Closed',
66
80
  'nvr-export-started': 'NVR Export Started',
67
81
  'nvr-export-deleted': 'NVR Export Deleted',
82
+ 'notification-created': 'Notification Created',
83
+ 'notification-acknowledged': 'Notification Acknowledged',
68
84
  };
69
85
  exports.eventSchemaByKind = {
70
86
  ...alarm_1.alarmEventSchemasByKind,
@@ -77,6 +93,9 @@ exports.eventSchemaByKind = {
77
93
  ...reader_1.readerEventSchemaByKind,
78
94
  ...nvr_exporter_1.nvrExporterEventSchemasByKind,
79
95
  'motion-detected': exports.sMotionDetected,
96
+ 'device-command': exports.sDeviceCommandTriggered,
97
+ 'device-connected': exports.sDeviceConnectedEvent,
98
+ 'device-disconnected': exports.sDeviceDisconnectedEvent,
80
99
  };
81
100
  exports.eventsByDeviceType = {
82
101
  camera: [
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awarevue/api-types",
3
- "version": "2.0.14",
3
+ "version": "2.0.16",
4
4
  "description": "Common types between backend, agent(s) and frontend(s)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awarevue/api-types",
3
- "version": "2.0.14",
3
+ "version": "2.0.16",
4
4
  "description": "Common types between backend, agent(s) and frontend(s)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",