@awarevue/api-types 2.0.13 → 2.0.15

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.
Files changed (135) hide show
  1. package/dist/access-control/access-rule.d.ts +6 -6
  2. package/dist/access-control/person.d.ts +6 -6
  3. package/dist/access-control/schedule.d.ts +2 -2
  4. package/dist/access-control/zone.d.ts +4 -4
  5. package/dist/agent-communication/index.d.ts +0 -1
  6. package/dist/agent-communication/index.js +0 -1
  7. package/dist/agent-communication/protocol.d.ts +170 -170
  8. package/dist/alarm-automation.d.ts +1 -1
  9. package/dist/api/alarm.d.ts +1 -1
  10. package/dist/api/media.d.ts +8 -8
  11. package/dist/bookmarks.d.ts +2 -2
  12. package/dist/cast.d.ts +2 -2
  13. package/dist/commands/alarm.d.ts +312 -0
  14. package/dist/commands/alarm.js +62 -0
  15. package/dist/{device-command.d.ts → commands/all.d.ts} +650 -19
  16. package/dist/{device-command.js → commands/all.js} +11 -9
  17. package/dist/commands/camera-lift.d.ts +46 -0
  18. package/dist/commands/camera-lift.js +17 -0
  19. package/dist/commands/camera.d.ts +478 -0
  20. package/dist/commands/camera.js +97 -0
  21. package/dist/commands/display.d.ts +431 -0
  22. package/dist/commands/display.js +37 -0
  23. package/dist/commands/door.d.ts +88 -0
  24. package/dist/commands/door.js +27 -0
  25. package/dist/commands/index.d.ts +12 -0
  26. package/dist/commands/index.js +28 -0
  27. package/dist/commands/intercom-terminal.d.ts +40 -0
  28. package/dist/{device/reader/commands.js → commands/intercom-terminal.js} +1 -0
  29. package/dist/commands/io-board.d.ts +55 -0
  30. package/dist/commands/io-board.js +15 -0
  31. package/dist/commands/nvr-exporter.d.ts +1262 -0
  32. package/dist/commands/nvr-exporter.js +26 -0
  33. package/dist/commands/pbx.d.ts +75 -0
  34. package/dist/commands/pbx.js +17 -0
  35. package/dist/commands/presence-tracker.d.ts +167 -0
  36. package/dist/commands/presence-tracker.js +33 -0
  37. package/dist/commands/server.d.ts +1272 -0
  38. package/dist/commands/server.js +27 -0
  39. package/dist/device/alarm.d.ts +0 -530
  40. package/dist/device/alarm.js +1 -110
  41. package/dist/device/any-device.d.ts +88 -88
  42. package/dist/device/camera-lift.d.ts +0 -45
  43. package/dist/device/camera-lift.js +1 -14
  44. package/dist/device/camera.d.ts +0 -1248
  45. package/dist/device/camera.js +1 -204
  46. package/dist/device/device-gateway.d.ts +0 -2
  47. package/dist/device/device-gateway.js +1 -0
  48. package/dist/device/display.d.ts +0 -438
  49. package/dist/device/display.js +1 -39
  50. package/dist/device/door.d.ts +0 -306
  51. package/dist/device/door.js +1 -82
  52. package/dist/device/index.d.ts +1 -1
  53. package/dist/device/index.js +1 -1
  54. package/dist/device/intercom-operator.js +0 -1
  55. package/dist/device/intercom-terminal.d.ts +0 -101
  56. package/dist/device/intercom-terminal.js +3 -55
  57. package/dist/device/io-board.d.ts +0 -84
  58. package/dist/device/io-board.js +1 -21
  59. package/dist/device/motion-sensor.js +0 -1
  60. package/dist/device/nvr-analytics-server.d.ts +0 -295
  61. package/dist/device/nvr-analytics-server.js +1 -65
  62. package/dist/device/nvr-exporter.d.ts +0 -1436
  63. package/dist/device/nvr-exporter.js +1 -72
  64. package/dist/device/nvr-recorder.d.ts +0 -2633
  65. package/dist/device/nvr-recorder.js +1 -39
  66. package/dist/device/panic-button.d.ts +0 -18
  67. package/dist/device/panic-button.js +1 -8
  68. package/dist/device/pbx.d.ts +0 -74
  69. package/dist/device/pbx.js +1 -16
  70. package/dist/device/presence-tracker.d.ts +0 -302
  71. package/dist/device/presence-tracker.js +1 -59
  72. package/dist/device/server.d.ts +0 -1336
  73. package/dist/device/server.js +1 -37
  74. package/dist/device/system.d.ts +0 -42
  75. package/dist/device/system.js +1 -13
  76. package/dist/device-event.d.ts +1 -721
  77. package/dist/device-event.js +0 -110
  78. package/dist/device-group.d.ts +2 -2
  79. package/dist/device-import.d.ts +8 -8
  80. package/dist/events/alarm.d.ts +220 -0
  81. package/dist/events/alarm.js +55 -0
  82. package/dist/events/all.d.ts +700 -0
  83. package/dist/events/all.js +109 -0
  84. package/dist/events/camera.d.ts +661 -0
  85. package/dist/events/camera.js +87 -0
  86. package/dist/events/display.d.ts +9 -0
  87. package/dist/events/display.js +9 -0
  88. package/dist/events/door.d.ts +220 -0
  89. package/dist/events/door.js +62 -0
  90. package/dist/events/index.d.ts +12 -0
  91. package/dist/events/index.js +28 -0
  92. package/dist/events/intercom-terminal.d.ts +61 -0
  93. package/dist/events/intercom-terminal.js +19 -0
  94. package/dist/events/io-board.d.ts +31 -0
  95. package/dist/events/io-board.js +13 -0
  96. package/dist/events/nvr-exporter.d.ts +52 -0
  97. package/dist/events/nvr-exporter.js +21 -0
  98. package/dist/events/panic-button.d.ts +19 -0
  99. package/dist/events/panic-button.js +11 -0
  100. package/dist/events/presence-tracker.d.ts +136 -0
  101. package/dist/events/presence-tracker.js +33 -0
  102. package/dist/events/server.d.ts +65 -0
  103. package/dist/events/server.js +15 -0
  104. package/dist/index.d.ts +4 -1
  105. package/dist/index.js +4 -1
  106. package/dist/layout.d.ts +8 -8
  107. package/dist/macros.d.ts +14 -14
  108. package/dist/messages/device-communication.d.ts +2 -2
  109. package/dist/messages/notifications.d.ts +2 -2
  110. package/dist/messages/web-rtc-signaling.d.ts +10 -10
  111. package/dist/notifications.d.ts +4 -4
  112. package/dist/package.json +1 -1
  113. package/dist/primitives.d.ts +16 -0
  114. package/dist/primitives.js +13 -1
  115. package/dist/{agent-communication/queries.d.ts → queries/all.d.ts} +12 -10
  116. package/dist/queries/all.js +21 -0
  117. package/dist/queries/camera.d.ts +98 -0
  118. package/dist/queries/camera.js +27 -0
  119. package/dist/queries/index.d.ts +5 -0
  120. package/dist/{device/reader → queries}/index.js +5 -3
  121. package/dist/queries/nvr-analytics-server.d.ts +296 -0
  122. package/dist/queries/nvr-analytics-server.js +68 -0
  123. package/dist/queries/nvr-exporter.d.ts +125 -0
  124. package/dist/queries/nvr-exporter.js +36 -0
  125. package/dist/queries/nvr-recorder.d.ts +2634 -0
  126. package/dist/queries/nvr-recorder.js +42 -0
  127. package/dist/user.d.ts +4 -4
  128. package/package.json +1 -1
  129. package/dist/agent-communication/queries.js +0 -19
  130. package/dist/device/reader/commands.d.ts +0 -1
  131. package/dist/device/reader/index.d.ts +0 -3
  132. /package/dist/device/{reader/specs.d.ts → reader.d.ts} +0 -0
  133. /package/dist/device/{reader/specs.js → reader.js} +0 -0
  134. /package/dist/{device/reader/events.d.ts → events/reader.d.ts} +0 -0
  135. /package/dist/{device/reader/events.js → events/reader.js} +0 -0
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serverCommands = exports.sNotify = exports.sRunMacroCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const primitives_1 = require("../primitives");
6
+ // COMMANDS
7
+ exports.sRunMacroCommand = zod_1.z.object({
8
+ command: zod_1.z.literal('server.run-macro'),
9
+ params: zod_1.z.object({
10
+ macroId: primitives_1.sMacroId,
11
+ }),
12
+ });
13
+ exports.sNotify = zod_1.z.object({
14
+ command: zod_1.z.literal('server.notify'),
15
+ params: zod_1.z.object({
16
+ source: primitives_1.sDeviceParam,
17
+ message: zod_1.z.string().nonempty(),
18
+ severity: primitives_1.sNotificationSeverity,
19
+ metadata: zod_1.z.record(zod_1.z.unknown()),
20
+ notificationRef: zod_1.z.string().nonempty().nullable(),
21
+ recipientId: zod_1.z.string().nonempty().nullable(),
22
+ }),
23
+ });
24
+ exports.serverCommands = {
25
+ 'server.run-macro': exports.sRunMacroCommand,
26
+ 'server.notify': exports.sNotify,
27
+ };
@@ -2,317 +2,6 @@ import { z } from 'zod';
2
2
  export declare const ALARM: "alarm";
3
3
  export declare const sAlarmSpecs: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
4
4
  export type AlarmSpecs = z.infer<typeof sAlarmSpecs>;
5
- export declare const sArmCommand: z.ZodObject<{
6
- command: z.ZodLiteral<"alarm.arm">;
7
- params: z.ZodObject<{
8
- deviceId: z.ZodString;
9
- }, "strip", z.ZodTypeAny, {
10
- deviceId: string;
11
- }, {
12
- deviceId: string;
13
- }>;
14
- }, "strip", z.ZodTypeAny, {
15
- params: {
16
- deviceId: string;
17
- };
18
- command: "alarm.arm";
19
- }, {
20
- params: {
21
- deviceId: string;
22
- };
23
- command: "alarm.arm";
24
- }>;
25
- export type ArmCommand = z.infer<typeof sArmCommand>;
26
- export declare const sDisarmCommand: z.ZodObject<{
27
- command: z.ZodLiteral<"alarm.disarm">;
28
- params: z.ZodObject<{
29
- deviceId: z.ZodString;
30
- duration: z.ZodOptional<z.ZodNumber>;
31
- }, "strip", z.ZodTypeAny, {
32
- deviceId: string;
33
- duration?: number | undefined;
34
- }, {
35
- deviceId: string;
36
- duration?: number | undefined;
37
- }>;
38
- }, "strip", z.ZodTypeAny, {
39
- params: {
40
- deviceId: string;
41
- duration?: number | undefined;
42
- };
43
- command: "alarm.disarm";
44
- }, {
45
- params: {
46
- deviceId: string;
47
- duration?: number | undefined;
48
- };
49
- command: "alarm.disarm";
50
- }>;
51
- export type DisarmCommand = z.infer<typeof sDisarmCommand>;
52
- export declare const sBypassCommand: z.ZodObject<{
53
- command: z.ZodLiteral<"alarm.bypass">;
54
- params: z.ZodObject<{
55
- deviceId: z.ZodString;
56
- }, "strip", z.ZodTypeAny, {
57
- deviceId: string;
58
- }, {
59
- deviceId: string;
60
- }>;
61
- }, "strip", z.ZodTypeAny, {
62
- params: {
63
- deviceId: string;
64
- };
65
- command: "alarm.bypass";
66
- }, {
67
- params: {
68
- deviceId: string;
69
- };
70
- command: "alarm.bypass";
71
- }>;
72
- export type BypassCommand = z.infer<typeof sBypassCommand>;
73
- export declare const sUnbypassCommand: z.ZodObject<{
74
- command: z.ZodLiteral<"alarm.unbypass">;
75
- params: z.ZodObject<{
76
- deviceId: z.ZodString;
77
- }, "strip", z.ZodTypeAny, {
78
- deviceId: string;
79
- }, {
80
- deviceId: string;
81
- }>;
82
- }, "strip", z.ZodTypeAny, {
83
- params: {
84
- deviceId: string;
85
- };
86
- command: "alarm.unbypass";
87
- }, {
88
- params: {
89
- deviceId: string;
90
- };
91
- command: "alarm.unbypass";
92
- }>;
93
- export type UnbypassCommand = z.infer<typeof sUnbypassCommand>;
94
- export declare const sArmAllCommand: z.ZodObject<{
95
- command: z.ZodLiteral<"alarm.arm-all">;
96
- params: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
97
- }, "strip", z.ZodTypeAny, {
98
- params: {};
99
- command: "alarm.arm-all";
100
- }, {
101
- params: {};
102
- command: "alarm.arm-all";
103
- }>;
104
- export type ArmAllCommand = z.infer<typeof sArmAllCommand>;
105
- export declare const sDisarmAllCommand: z.ZodObject<{
106
- command: z.ZodLiteral<"alarm.disarm-all">;
107
- params: z.ZodObject<{
108
- duration: z.ZodOptional<z.ZodNumber>;
109
- }, "strip", z.ZodTypeAny, {
110
- duration?: number | undefined;
111
- }, {
112
- duration?: number | undefined;
113
- }>;
114
- }, "strip", z.ZodTypeAny, {
115
- params: {
116
- duration?: number | undefined;
117
- };
118
- command: "alarm.disarm-all";
119
- }, {
120
- params: {
121
- duration?: number | undefined;
122
- };
123
- command: "alarm.disarm-all";
124
- }>;
125
- export type DisarmAllCommand = z.infer<typeof sDisarmAllCommand>;
126
- export declare const sAcknowledgeCommand: z.ZodObject<{
127
- command: z.ZodLiteral<"alarm.acknowledge">;
128
- params: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
129
- }, "strip", z.ZodTypeAny, {
130
- params: {};
131
- command: "alarm.acknowledge";
132
- }, {
133
- params: {};
134
- command: "alarm.acknowledge";
135
- }>;
136
- export type AcknowledgeCommand = z.infer<typeof sAcknowledgeCommand>;
137
- export declare const sSetTriggerCommand: z.ZodObject<{
138
- command: z.ZodLiteral<"alarm.set-trigger">;
139
- params: z.ZodObject<{
140
- event: z.ZodRecord<z.ZodString, z.ZodUnknown>;
141
- onlyIfArmed: z.ZodBoolean;
142
- }, "strip", z.ZodTypeAny, {
143
- event: Record<string, unknown>;
144
- onlyIfArmed: boolean;
145
- }, {
146
- event: Record<string, unknown>;
147
- onlyIfArmed: boolean;
148
- }>;
149
- }, "strip", z.ZodTypeAny, {
150
- params: {
151
- event: Record<string, unknown>;
152
- onlyIfArmed: boolean;
153
- };
154
- command: "alarm.set-trigger";
155
- }, {
156
- params: {
157
- event: Record<string, unknown>;
158
- onlyIfArmed: boolean;
159
- };
160
- command: "alarm.set-trigger";
161
- }>;
162
- export type SetTriggerCommand = z.infer<typeof sSetTriggerCommand>;
163
- export type AlarmCommand = ArmCommand | DisarmCommand | ArmAllCommand | DisarmAllCommand | AcknowledgeCommand | SetTriggerCommand | BypassCommand | UnbypassCommand;
164
- export declare const alarmCommandSchemas: {
165
- readonly 'alarm.arm': z.ZodObject<{
166
- command: z.ZodLiteral<"alarm.arm">;
167
- params: z.ZodObject<{
168
- deviceId: z.ZodString;
169
- }, "strip", z.ZodTypeAny, {
170
- deviceId: string;
171
- }, {
172
- deviceId: string;
173
- }>;
174
- }, "strip", z.ZodTypeAny, {
175
- params: {
176
- deviceId: string;
177
- };
178
- command: "alarm.arm";
179
- }, {
180
- params: {
181
- deviceId: string;
182
- };
183
- command: "alarm.arm";
184
- }>;
185
- readonly 'alarm.disarm': z.ZodObject<{
186
- command: z.ZodLiteral<"alarm.disarm">;
187
- params: z.ZodObject<{
188
- deviceId: z.ZodString;
189
- duration: z.ZodOptional<z.ZodNumber>;
190
- }, "strip", z.ZodTypeAny, {
191
- deviceId: string;
192
- duration?: number | undefined;
193
- }, {
194
- deviceId: string;
195
- duration?: number | undefined;
196
- }>;
197
- }, "strip", z.ZodTypeAny, {
198
- params: {
199
- deviceId: string;
200
- duration?: number | undefined;
201
- };
202
- command: "alarm.disarm";
203
- }, {
204
- params: {
205
- deviceId: string;
206
- duration?: number | undefined;
207
- };
208
- command: "alarm.disarm";
209
- }>;
210
- readonly 'alarm.arm-all': z.ZodObject<{
211
- command: z.ZodLiteral<"alarm.arm-all">;
212
- params: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
213
- }, "strip", z.ZodTypeAny, {
214
- params: {};
215
- command: "alarm.arm-all";
216
- }, {
217
- params: {};
218
- command: "alarm.arm-all";
219
- }>;
220
- readonly 'alarm.disarm-all': z.ZodObject<{
221
- command: z.ZodLiteral<"alarm.disarm-all">;
222
- params: z.ZodObject<{
223
- duration: z.ZodOptional<z.ZodNumber>;
224
- }, "strip", z.ZodTypeAny, {
225
- duration?: number | undefined;
226
- }, {
227
- duration?: number | undefined;
228
- }>;
229
- }, "strip", z.ZodTypeAny, {
230
- params: {
231
- duration?: number | undefined;
232
- };
233
- command: "alarm.disarm-all";
234
- }, {
235
- params: {
236
- duration?: number | undefined;
237
- };
238
- command: "alarm.disarm-all";
239
- }>;
240
- readonly 'alarm.acknowledge': z.ZodObject<{
241
- command: z.ZodLiteral<"alarm.acknowledge">;
242
- params: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
243
- }, "strip", z.ZodTypeAny, {
244
- params: {};
245
- command: "alarm.acknowledge";
246
- }, {
247
- params: {};
248
- command: "alarm.acknowledge";
249
- }>;
250
- readonly 'alarm.set-trigger': z.ZodObject<{
251
- command: z.ZodLiteral<"alarm.set-trigger">;
252
- params: z.ZodObject<{
253
- event: z.ZodRecord<z.ZodString, z.ZodUnknown>;
254
- onlyIfArmed: z.ZodBoolean;
255
- }, "strip", z.ZodTypeAny, {
256
- event: Record<string, unknown>;
257
- onlyIfArmed: boolean;
258
- }, {
259
- event: Record<string, unknown>;
260
- onlyIfArmed: boolean;
261
- }>;
262
- }, "strip", z.ZodTypeAny, {
263
- params: {
264
- event: Record<string, unknown>;
265
- onlyIfArmed: boolean;
266
- };
267
- command: "alarm.set-trigger";
268
- }, {
269
- params: {
270
- event: Record<string, unknown>;
271
- onlyIfArmed: boolean;
272
- };
273
- command: "alarm.set-trigger";
274
- }>;
275
- readonly 'alarm.bypass': z.ZodObject<{
276
- command: z.ZodLiteral<"alarm.bypass">;
277
- params: z.ZodObject<{
278
- deviceId: z.ZodString;
279
- }, "strip", z.ZodTypeAny, {
280
- deviceId: string;
281
- }, {
282
- deviceId: string;
283
- }>;
284
- }, "strip", z.ZodTypeAny, {
285
- params: {
286
- deviceId: string;
287
- };
288
- command: "alarm.bypass";
289
- }, {
290
- params: {
291
- deviceId: string;
292
- };
293
- command: "alarm.bypass";
294
- }>;
295
- readonly 'alarm.unbypass': z.ZodObject<{
296
- command: z.ZodLiteral<"alarm.unbypass">;
297
- params: z.ZodObject<{
298
- deviceId: z.ZodString;
299
- }, "strip", z.ZodTypeAny, {
300
- deviceId: string;
301
- }, {
302
- deviceId: string;
303
- }>;
304
- }, "strip", z.ZodTypeAny, {
305
- params: {
306
- deviceId: string;
307
- };
308
- command: "alarm.unbypass";
309
- }, {
310
- params: {
311
- deviceId: string;
312
- };
313
- command: "alarm.unbypass";
314
- }>;
315
- };
316
5
  export type AlarmStateDto = {
317
6
  activeAlarmId: string | null;
318
7
  triggeredOn: number | null;
@@ -320,222 +9,3 @@ export type AlarmStateDto = {
320
9
  armed: Record<string, boolean>;
321
10
  bypassList: string[];
322
11
  };
323
- export declare const sAlarmTriggeredEvent: z.ZodObject<{
324
- kind: z.ZodLiteral<"alarm-triggered">;
325
- alarmId: z.ZodString;
326
- }, "strip", z.ZodTypeAny, {
327
- kind: "alarm-triggered";
328
- alarmId: string;
329
- }, {
330
- kind: "alarm-triggered";
331
- alarmId: string;
332
- }>;
333
- export declare const sAlarmAcknowledgedEvent: z.ZodObject<{
334
- kind: z.ZodLiteral<"alarm-acknowledged">;
335
- alarmId: z.ZodString;
336
- userId: z.ZodOptional<z.ZodString>;
337
- personId: z.ZodOptional<z.ZodString>;
338
- }, "strip", z.ZodTypeAny, {
339
- kind: "alarm-acknowledged";
340
- alarmId: string;
341
- personId?: string | undefined;
342
- userId?: string | undefined;
343
- }, {
344
- kind: "alarm-acknowledged";
345
- alarmId: string;
346
- personId?: string | undefined;
347
- userId?: string | undefined;
348
- }>;
349
- export declare const sAlarmArmedAllEvent: z.ZodObject<{
350
- kind: z.ZodLiteral<"alarm-armed-all">;
351
- userId: z.ZodOptional<z.ZodString>;
352
- personId: z.ZodOptional<z.ZodString>;
353
- }, "strip", z.ZodTypeAny, {
354
- kind: "alarm-armed-all";
355
- personId?: string | undefined;
356
- userId?: string | undefined;
357
- }, {
358
- kind: "alarm-armed-all";
359
- personId?: string | undefined;
360
- userId?: string | undefined;
361
- }>;
362
- export declare const sAlarmDisarmedAllEvent: z.ZodObject<{
363
- kind: z.ZodLiteral<"alarm-disarmed-all">;
364
- userId: z.ZodOptional<z.ZodString>;
365
- personId: z.ZodOptional<z.ZodString>;
366
- }, "strip", z.ZodTypeAny, {
367
- kind: "alarm-disarmed-all";
368
- personId?: string | undefined;
369
- userId?: string | undefined;
370
- }, {
371
- kind: "alarm-disarmed-all";
372
- personId?: string | undefined;
373
- userId?: string | undefined;
374
- }>;
375
- export declare const sAlarmArmedEvent: z.ZodObject<{
376
- kind: z.ZodLiteral<"alarm-armed">;
377
- subjects: z.ZodArray<z.ZodString, "many">;
378
- userId: z.ZodOptional<z.ZodString>;
379
- personId: z.ZodOptional<z.ZodString>;
380
- }, "strip", z.ZodTypeAny, {
381
- kind: "alarm-armed";
382
- subjects: string[];
383
- personId?: string | undefined;
384
- userId?: string | undefined;
385
- }, {
386
- kind: "alarm-armed";
387
- subjects: string[];
388
- personId?: string | undefined;
389
- userId?: string | undefined;
390
- }>;
391
- export declare const sAlarmDisarmedEvent: z.ZodObject<{
392
- kind: z.ZodLiteral<"alarm-disarmed">;
393
- subjects: z.ZodArray<z.ZodString, "many">;
394
- userId: z.ZodOptional<z.ZodString>;
395
- personId: z.ZodOptional<z.ZodString>;
396
- }, "strip", z.ZodTypeAny, {
397
- kind: "alarm-disarmed";
398
- subjects: string[];
399
- personId?: string | undefined;
400
- userId?: string | undefined;
401
- }, {
402
- kind: "alarm-disarmed";
403
- subjects: string[];
404
- personId?: string | undefined;
405
- userId?: string | undefined;
406
- }>;
407
- export declare const sAlarmArmReleasedEvent: z.ZodObject<{
408
- kind: z.ZodLiteral<"alarm-arm-released">;
409
- userId: z.ZodOptional<z.ZodString>;
410
- personId: z.ZodOptional<z.ZodString>;
411
- }, "strip", z.ZodTypeAny, {
412
- kind: "alarm-arm-released";
413
- personId?: string | undefined;
414
- userId?: string | undefined;
415
- }, {
416
- kind: "alarm-arm-released";
417
- personId?: string | undefined;
418
- userId?: string | undefined;
419
- }>;
420
- export declare const sAlarmRearmedEvent: z.ZodObject<{
421
- kind: z.ZodLiteral<"alarm-rearmed">;
422
- }, "strip", z.ZodTypeAny, {
423
- kind: "alarm-rearmed";
424
- }, {
425
- kind: "alarm-rearmed";
426
- }>;
427
- export declare const alarmEventSchemasByKind: {
428
- readonly 'alarm-triggered': z.ZodObject<{
429
- kind: z.ZodLiteral<"alarm-triggered">;
430
- alarmId: z.ZodString;
431
- }, "strip", z.ZodTypeAny, {
432
- kind: "alarm-triggered";
433
- alarmId: string;
434
- }, {
435
- kind: "alarm-triggered";
436
- alarmId: string;
437
- }>;
438
- readonly 'alarm-acknowledged': z.ZodObject<{
439
- kind: z.ZodLiteral<"alarm-acknowledged">;
440
- alarmId: z.ZodString;
441
- userId: z.ZodOptional<z.ZodString>;
442
- personId: z.ZodOptional<z.ZodString>;
443
- }, "strip", z.ZodTypeAny, {
444
- kind: "alarm-acknowledged";
445
- alarmId: string;
446
- personId?: string | undefined;
447
- userId?: string | undefined;
448
- }, {
449
- kind: "alarm-acknowledged";
450
- alarmId: string;
451
- personId?: string | undefined;
452
- userId?: string | undefined;
453
- }>;
454
- readonly 'alarm-armed-all': z.ZodObject<{
455
- kind: z.ZodLiteral<"alarm-armed-all">;
456
- userId: z.ZodOptional<z.ZodString>;
457
- personId: z.ZodOptional<z.ZodString>;
458
- }, "strip", z.ZodTypeAny, {
459
- kind: "alarm-armed-all";
460
- personId?: string | undefined;
461
- userId?: string | undefined;
462
- }, {
463
- kind: "alarm-armed-all";
464
- personId?: string | undefined;
465
- userId?: string | undefined;
466
- }>;
467
- readonly 'alarm-disarmed-all': z.ZodObject<{
468
- kind: z.ZodLiteral<"alarm-disarmed-all">;
469
- userId: z.ZodOptional<z.ZodString>;
470
- personId: z.ZodOptional<z.ZodString>;
471
- }, "strip", z.ZodTypeAny, {
472
- kind: "alarm-disarmed-all";
473
- personId?: string | undefined;
474
- userId?: string | undefined;
475
- }, {
476
- kind: "alarm-disarmed-all";
477
- personId?: string | undefined;
478
- userId?: string | undefined;
479
- }>;
480
- readonly 'alarm-armed': z.ZodObject<{
481
- kind: z.ZodLiteral<"alarm-armed">;
482
- subjects: z.ZodArray<z.ZodString, "many">;
483
- userId: z.ZodOptional<z.ZodString>;
484
- personId: z.ZodOptional<z.ZodString>;
485
- }, "strip", z.ZodTypeAny, {
486
- kind: "alarm-armed";
487
- subjects: string[];
488
- personId?: string | undefined;
489
- userId?: string | undefined;
490
- }, {
491
- kind: "alarm-armed";
492
- subjects: string[];
493
- personId?: string | undefined;
494
- userId?: string | undefined;
495
- }>;
496
- readonly 'alarm-disarmed': z.ZodObject<{
497
- kind: z.ZodLiteral<"alarm-disarmed">;
498
- subjects: z.ZodArray<z.ZodString, "many">;
499
- userId: z.ZodOptional<z.ZodString>;
500
- personId: z.ZodOptional<z.ZodString>;
501
- }, "strip", z.ZodTypeAny, {
502
- kind: "alarm-disarmed";
503
- subjects: string[];
504
- personId?: string | undefined;
505
- userId?: string | undefined;
506
- }, {
507
- kind: "alarm-disarmed";
508
- subjects: string[];
509
- personId?: string | undefined;
510
- userId?: string | undefined;
511
- }>;
512
- readonly 'alarm-arm-released': z.ZodObject<{
513
- kind: z.ZodLiteral<"alarm-arm-released">;
514
- userId: z.ZodOptional<z.ZodString>;
515
- personId: z.ZodOptional<z.ZodString>;
516
- }, "strip", z.ZodTypeAny, {
517
- kind: "alarm-arm-released";
518
- personId?: string | undefined;
519
- userId?: string | undefined;
520
- }, {
521
- kind: "alarm-arm-released";
522
- personId?: string | undefined;
523
- userId?: string | undefined;
524
- }>;
525
- readonly 'alarm-rearmed': z.ZodObject<{
526
- kind: z.ZodLiteral<"alarm-rearmed">;
527
- }, "strip", z.ZodTypeAny, {
528
- kind: "alarm-rearmed";
529
- }, {
530
- kind: "alarm-rearmed";
531
- }>;
532
- };
533
- export type AlarmTriggeredEvent = z.infer<typeof sAlarmTriggeredEvent>;
534
- export type AlarmAcknowledgedEvent = z.infer<typeof sAlarmAcknowledgedEvent>;
535
- export type AlarmArmedAllEvent = z.infer<typeof sAlarmArmedAllEvent>;
536
- export type AlarmDisarmedAllEvent = z.infer<typeof sAlarmDisarmedAllEvent>;
537
- export type AlarmArmedEvent = z.infer<typeof sAlarmArmedEvent>;
538
- export type AlarmDisarmedEvent = z.infer<typeof sAlarmDisarmedEvent>;
539
- export type AlarmArmReleasedEvent = z.infer<typeof sAlarmArmReleasedEvent>;
540
- export type AlarmRearmedEvent = z.infer<typeof sAlarmRearmedEvent>;
541
- export type AlarmEvent = AlarmTriggeredEvent | AlarmAcknowledgedEvent | AlarmArmedAllEvent | AlarmDisarmedAllEvent | AlarmArmedEvent | AlarmDisarmedEvent | AlarmArmReleasedEvent | AlarmRearmedEvent;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.alarmEventSchemasByKind = exports.sAlarmRearmedEvent = exports.sAlarmArmReleasedEvent = exports.sAlarmDisarmedEvent = exports.sAlarmArmedEvent = exports.sAlarmDisarmedAllEvent = exports.sAlarmArmedAllEvent = exports.sAlarmAcknowledgedEvent = exports.sAlarmTriggeredEvent = exports.alarmCommandSchemas = exports.sSetTriggerCommand = exports.sAcknowledgeCommand = exports.sDisarmAllCommand = exports.sArmAllCommand = exports.sUnbypassCommand = exports.sBypassCommand = exports.sDisarmCommand = exports.sArmCommand = exports.sAlarmSpecs = exports.ALARM = void 0;
4
- const primitives_1 = require("../primitives");
3
+ exports.sAlarmSpecs = exports.ALARM = void 0;
5
4
  const zod_1 = require("zod");
6
5
  /*
7
6
  - only one alarm is active at the same time. If a new alarm-causing event takes place, the already existing alarm will be amended with the new event rather than creating a new alarm
@@ -14,111 +13,3 @@ const zod_1 = require("zod");
14
13
  exports.ALARM = 'alarm';
15
14
  // SPECS
16
15
  exports.sAlarmSpecs = zod_1.z.object({});
17
- // COMMANDS
18
- exports.sArmCommand = zod_1.z.object({
19
- command: zod_1.z.literal('alarm.arm'),
20
- params: zod_1.z.object({
21
- deviceId: primitives_1.sDeviceId,
22
- }),
23
- });
24
- exports.sDisarmCommand = zod_1.z.object({
25
- command: zod_1.z.literal('alarm.disarm'),
26
- params: zod_1.z.object({
27
- deviceId: primitives_1.sDeviceId,
28
- duration: primitives_1.sDuration.optional().describe('Duration in milliseconds'),
29
- }),
30
- });
31
- exports.sBypassCommand = zod_1.z.object({
32
- command: zod_1.z.literal('alarm.bypass'),
33
- params: zod_1.z.object({
34
- deviceId: primitives_1.sDeviceId,
35
- }),
36
- });
37
- exports.sUnbypassCommand = zod_1.z.object({
38
- command: zod_1.z.literal('alarm.unbypass'),
39
- params: zod_1.z.object({
40
- deviceId: primitives_1.sDeviceId,
41
- }),
42
- });
43
- exports.sArmAllCommand = zod_1.z.object({
44
- command: zod_1.z.literal('alarm.arm-all'),
45
- params: zod_1.z.object({}),
46
- });
47
- exports.sDisarmAllCommand = zod_1.z.object({
48
- command: zod_1.z.literal('alarm.disarm-all'),
49
- params: zod_1.z.object({
50
- duration: primitives_1.sDuration.optional().describe('Duration in milliseconds'),
51
- }),
52
- });
53
- exports.sAcknowledgeCommand = zod_1.z.object({
54
- command: zod_1.z.literal('alarm.acknowledge'),
55
- params: zod_1.z.object({}),
56
- });
57
- exports.sSetTriggerCommand = zod_1.z.object({
58
- command: zod_1.z.literal('alarm.set-trigger'),
59
- params: zod_1.z.object({
60
- event: primitives_1.sDeviceEvent,
61
- onlyIfArmed: zod_1.z.boolean().describe('Set only if the device is armed'),
62
- }),
63
- });
64
- exports.alarmCommandSchemas = {
65
- 'alarm.arm': exports.sArmCommand,
66
- 'alarm.disarm': exports.sDisarmCommand,
67
- 'alarm.arm-all': exports.sArmAllCommand,
68
- 'alarm.disarm-all': exports.sDisarmAllCommand,
69
- 'alarm.acknowledge': exports.sAcknowledgeCommand,
70
- 'alarm.set-trigger': exports.sSetTriggerCommand,
71
- 'alarm.bypass': exports.sBypassCommand,
72
- 'alarm.unbypass': exports.sUnbypassCommand,
73
- };
74
- // EVENTS
75
- exports.sAlarmTriggeredEvent = zod_1.z.object({
76
- kind: zod_1.z.literal('alarm-triggered'),
77
- alarmId: zod_1.z.string().nonempty(),
78
- });
79
- exports.sAlarmAcknowledgedEvent = zod_1.z.object({
80
- kind: zod_1.z.literal('alarm-acknowledged'),
81
- alarmId: zod_1.z.string().nonempty(),
82
- userId: zod_1.z.string().optional(),
83
- personId: zod_1.z.string().optional(),
84
- });
85
- exports.sAlarmArmedAllEvent = zod_1.z.object({
86
- kind: zod_1.z.literal('alarm-armed-all'),
87
- userId: zod_1.z.string().optional(),
88
- personId: zod_1.z.string().optional(),
89
- });
90
- exports.sAlarmDisarmedAllEvent = zod_1.z.object({
91
- kind: zod_1.z.literal('alarm-disarmed-all'),
92
- userId: zod_1.z.string().optional(),
93
- personId: zod_1.z.string().optional(),
94
- });
95
- exports.sAlarmArmedEvent = zod_1.z.object({
96
- kind: zod_1.z.literal('alarm-armed'),
97
- subjects: zod_1.z.array(zod_1.z.string().nonempty()),
98
- userId: zod_1.z.string().optional(),
99
- personId: zod_1.z.string().optional(),
100
- });
101
- exports.sAlarmDisarmedEvent = zod_1.z.object({
102
- kind: zod_1.z.literal('alarm-disarmed'),
103
- subjects: zod_1.z.array(zod_1.z.string().nonempty()),
104
- userId: zod_1.z.string().optional(),
105
- personId: zod_1.z.string().optional(),
106
- });
107
- exports.sAlarmArmReleasedEvent = zod_1.z.object({
108
- kind: zod_1.z.literal('alarm-arm-released'),
109
- userId: zod_1.z.string().optional(),
110
- personId: zod_1.z.string().optional(),
111
- });
112
- exports.sAlarmRearmedEvent = zod_1.z.object({
113
- kind: zod_1.z.literal('alarm-rearmed'),
114
- });
115
- exports.alarmEventSchemasByKind = {
116
- 'alarm-triggered': exports.sAlarmTriggeredEvent,
117
- 'alarm-acknowledged': exports.sAlarmAcknowledgedEvent,
118
- 'alarm-armed-all': exports.sAlarmArmedAllEvent,
119
- 'alarm-disarmed-all': exports.sAlarmDisarmedAllEvent,
120
- 'alarm-armed': exports.sAlarmArmedEvent,
121
- 'alarm-disarmed': exports.sAlarmDisarmedEvent,
122
- 'alarm-arm-released': exports.sAlarmArmReleasedEvent,
123
- 'alarm-rearmed': exports.sAlarmRearmedEvent,
124
- };