@awarevue/api-types 2.0.82 → 2.0.84

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 (131) hide show
  1. package/dist/alarm-automation.d.ts +21 -37
  2. package/dist/api/agent-protocol/protocol.d.ts +1000 -10986
  3. package/dist/api/agent-protocol/protocol.js +114 -57
  4. package/dist/api/commands/alarm.d.ts +40 -248
  5. package/dist/api/commands/all.d.ts +393 -4642
  6. package/dist/api/commands/camera-lift.d.ts +8 -32
  7. package/dist/api/commands/camera.d.ts +82 -373
  8. package/dist/api/commands/display.d.ts +21 -373
  9. package/dist/api/commands/door.d.ts +16 -64
  10. package/dist/api/commands/io-board.d.ts +4 -40
  11. package/dist/api/commands/nvr-exporter.d.ts +104 -1380
  12. package/dist/api/commands/nvr-recorder.d.ts +400 -5288
  13. package/dist/api/commands/pbx.d.ts +4 -56
  14. package/dist/api/commands/presence-tracker.d.ts +12 -128
  15. package/dist/api/commands/server.d.ts +114 -1382
  16. package/dist/api/commands/server.js +1 -1
  17. package/dist/api/error.d.ts +77 -443
  18. package/dist/api/error.js +1 -1
  19. package/dist/api/events/alarm.d.ts +20 -148
  20. package/dist/api/events/all.d.ts +74 -526
  21. package/dist/api/events/all.js +1 -1
  22. package/dist/api/events/camera.d.ts +46 -470
  23. package/dist/api/events/display.d.ts +1 -5
  24. package/dist/api/events/door.d.ts +34 -146
  25. package/dist/api/events/intercom-terminal.d.ts +22 -42
  26. package/dist/api/events/io-board.d.ts +2 -18
  27. package/dist/api/events/nvr-exporter.d.ts +4 -32
  28. package/dist/api/events/panic-button.d.ts +2 -10
  29. package/dist/api/events/presence-tracker.d.ts +4 -88
  30. package/dist/api/events/reader.d.ts +2 -22
  31. package/dist/api/events/server.d.ts +6 -34
  32. package/dist/api/mqtt/payloads.d.ts +4 -26
  33. package/dist/api/queries/all.d.ts +188 -1622
  34. package/dist/api/queries/nvr-analytics-server.d.ts +61 -373
  35. package/dist/api/queries/nvr-exporter.d.ts +9 -73
  36. package/dist/api/queries/nvr-recorder.d.ts +300 -2828
  37. package/dist/api/rest/access-rule.d.ts +10 -86
  38. package/dist/api/rest/agreement.d.ts +3 -18
  39. package/dist/api/rest/api-keys.d.ts +3 -17
  40. package/dist/api/rest/app.d.ts +3 -51
  41. package/dist/api/rest/auth.d.ts +3 -19
  42. package/dist/api/rest/automation.d.ts +11 -236
  43. package/dist/api/rest/bookmarks.d.ts +8 -56
  44. package/dist/api/rest/camera.d.ts +12 -70
  45. package/dist/api/rest/cast.d.ts +1 -7
  46. package/dist/api/rest/custom-field.d.ts +21 -24
  47. package/dist/api/rest/device-group.d.ts +8 -32
  48. package/dist/api/rest/device.d.ts +104 -176
  49. package/dist/api/rest/io-device.d.ts +7 -75
  50. package/dist/api/rest/io-device.js +2 -2
  51. package/dist/api/rest/layout.d.ts +4 -102
  52. package/dist/api/rest/macros.d.ts +6 -82
  53. package/dist/api/rest/media.d.ts +17 -141
  54. package/dist/api/rest/notifications.d.ts +7 -15
  55. package/dist/api/rest/person-agreement.d.ts +1 -9
  56. package/dist/api/rest/person-presence.d.ts +8 -50
  57. package/dist/api/rest/person-type.d.ts +6 -39
  58. package/dist/api/rest/person.d.ts +18 -96
  59. package/dist/api/rest/query.d.ts +5 -15
  60. package/dist/api/rest/schedule.d.ts +78 -216
  61. package/dist/api/rest/security-level.d.ts +6 -43
  62. package/dist/api/rest/template.d.ts +10 -20
  63. package/dist/api/rest/token-conversion.d.ts +11 -28
  64. package/dist/api/rest/user.d.ts +15 -97
  65. package/dist/api/rest/view.d.ts +24 -496
  66. package/dist/api/rest/webrtc-playback.d.ts +3 -25
  67. package/dist/api/rest/zone.d.ts +5 -21
  68. package/dist/api/ws/device-communication.d.ts +10 -62
  69. package/dist/api/ws/notifications.d.ts +7 -33
  70. package/dist/api/ws/progress.d.ts +10 -72
  71. package/dist/api/ws/web-rtc-signaling.d.ts +33 -279
  72. package/dist/objects/access-rule.d.ts +12 -132
  73. package/dist/objects/access-rule.js +1 -1
  74. package/dist/objects/agent-metadata.d.ts +36 -146
  75. package/dist/objects/agent-metadata.js +1 -2
  76. package/dist/objects/agreement.d.ts +1 -13
  77. package/dist/objects/all.d.ts +20 -1
  78. package/dist/objects/api-key.d.ts +1 -13
  79. package/dist/objects/automation-rule.d.ts +9 -168
  80. package/dist/objects/automation-rule.js +2 -2
  81. package/dist/objects/bookmark.d.ts +3 -33
  82. package/dist/objects/bookmark.js +1 -1
  83. package/dist/objects/credential.d.ts +13 -13
  84. package/dist/objects/credential.js +1 -1
  85. package/dist/objects/custom-field.d.ts +19 -15
  86. package/dist/objects/device/alarm.d.ts +1 -1
  87. package/dist/objects/device/any-device.d.ts +1333 -4451
  88. package/dist/objects/device/camera-lift.d.ts +1 -1
  89. package/dist/objects/device/camera.d.ts +29 -125
  90. package/dist/objects/device/camera.js +1 -1
  91. package/dist/objects/device/device-import.d.ts +307 -1735
  92. package/dist/objects/device/device-relation.d.ts +70 -58
  93. package/dist/objects/device/display.d.ts +1 -1
  94. package/dist/objects/device/door.d.ts +9 -14
  95. package/dist/objects/device/intercom-terminal.d.ts +10 -59
  96. package/dist/objects/device/io-board.d.ts +3 -9
  97. package/dist/objects/device/motion-sensor.d.ts +1 -1
  98. package/dist/objects/device/nvr-analytics-server.d.ts +2 -6
  99. package/dist/objects/device/nvr-exporter.d.ts +3 -9
  100. package/dist/objects/device/nvr-recorder.d.ts +16 -68
  101. package/dist/objects/device/panic-button.d.ts +1 -1
  102. package/dist/objects/device/pbx.d.ts +1 -5
  103. package/dist/objects/device/system.d.ts +1 -1
  104. package/dist/objects/device/system.js +1 -1
  105. package/dist/objects/device-group.d.ts +2 -16
  106. package/dist/objects/layout.d.ts +3 -75
  107. package/dist/objects/macro.d.ts +3 -59
  108. package/dist/objects/macro.js +2 -2
  109. package/dist/objects/notification.d.ts +6 -24
  110. package/dist/objects/notification.js +1 -1
  111. package/dist/objects/person-agreement.d.ts +1 -13
  112. package/dist/objects/person-presence.d.ts +11 -165
  113. package/dist/objects/person-type.d.ts +2 -22
  114. package/dist/objects/person.d.ts +21 -153
  115. package/dist/objects/person.js +3 -3
  116. package/dist/objects/role.d.ts +3 -15
  117. package/dist/objects/schedule.d.ts +152 -314
  118. package/dist/objects/schedule.js +1 -1
  119. package/dist/objects/security-level.d.ts +1 -21
  120. package/dist/objects/template.d.ts +9 -13
  121. package/dist/objects/token-conversion.d.ts +8 -18
  122. package/dist/objects/user.d.ts +2 -20
  123. package/dist/objects/view.d.ts +52 -682
  124. package/dist/objects/world-object.d.ts +1 -7
  125. package/dist/objects/zone.d.ts +5 -29
  126. package/dist/objects/zone.js +1 -1
  127. package/dist/package.json +3 -3
  128. package/dist/permissions.d.ts +1 -1
  129. package/dist/primitives.d.ts +113 -551
  130. package/dist/primitives.js +1 -1
  131. package/package.json +3 -3
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isMessageFromAgent = exports.getAgentMessageIssues = exports.ReplyKindByRequestKind = exports.sAbortChange = exports.sApplyChangeProgress = exports.sApplyChangeRs = exports.sApplyChange = exports.sValidateChangeRs = exports.sChangeIssue = exports.sChangeIssueCode = exports.sValidateChangeRq = exports.sRefMap = exports.sDeviceMap = exports.sAccessMutation = exports.sObjectDelete = exports.sObjectMerge = exports.sGetAvailableDevicesRs = exports.sGetAvailableDevicesRq = exports.sPushEventRs = exports.sPushEventRq = exports.sPushStateUpdateRs = exports.sPushStateUpdateRq = exports.sPushFile = exports.sProgressUpdate = exports.sQueryRs = exports.sQueryRq = exports.sRunCommandRs = exports.sRunCommandRq = exports.sStopServiceRs = exports.sStopServiceRq = exports.sStartServiceRs = exports.sStartServiceRq = exports.sValidateProviderConfigRs = exports.sConfigurationIssue = exports.sValidateProviderConfigRq = exports.sUnregister = exports.sRegisterRs = exports.sRegisterRq = exports.sErrorPayload = exports.sAgentErrorCode = exports.sResponsePayload = exports.sMessageWithPayload = exports.sMessageHeader = void 0;
3
+ exports.isMessageFromAgent = exports.getAgentMessageIssues = exports.ReplyKindByRequestKind = exports.sDescribeObjectRs = exports.sDescribeObjectRq = exports.sAbortChange = exports.sApplyChangeProgress = exports.sApplyChangeRs = exports.sApplyChange = exports.sValidateChangeRs = exports.sChangeIssue = exports.sChangeIssueCode = exports.sValidateChangeRq = exports.sRefMap = exports.sDeviceMap = exports.sAccessMutation = exports.sObjectDelete = exports.sObjectMerge = exports.sExternalObjectProps = exports.sExternalZoneProps = exports.sExternalAccessRuleProps = exports.sExternalScheduleProps = exports.sExternalPersonProps = exports.sGetAvailableDevicesRs = exports.sGetAvailableDevicesRq = exports.sPushEventRs = exports.sPushEventRq = exports.sPushStateUpdateRs = exports.sPushStateUpdateRq = exports.sPushFile = exports.sProgressUpdate = exports.sQueryRs = exports.sQueryRq = exports.sRunCommandRs = exports.sRunCommandRq = exports.sStopServiceRs = exports.sStopServiceRq = exports.sStartServiceRs = exports.sStartServiceRq = exports.sValidateProviderConfigRs = exports.sConfigurationIssue = exports.sValidateProviderConfigRq = exports.sUnregister = exports.sRegisterRs = exports.sRegisterRq = exports.sErrorPayload = exports.sAgentErrorCode = exports.sResponsePayload = exports.sMessageWithPayload = exports.sMessageHeader = void 0;
4
4
  const device_import_1 = require("../../objects/device/device-import");
5
5
  const zod_1 = require("zod");
6
6
  const rest_1 = require("../rest");
7
7
  const primitives_1 = require("../../primitives");
8
8
  const agent_metadata_1 = require("../../objects/agent-metadata");
9
+ const objects_1 = require("../../objects");
9
10
  // PROTOCOL ENVELOPE
10
11
  exports.sMessageHeader = zod_1.z.object({
11
12
  version: zod_1.z.number().describe('Protocol version'),
@@ -20,7 +21,7 @@ const sMessageWithPayload = (sPayload) => exports.sMessageHeader.and(sPayload).d
20
21
  exports.sMessageWithPayload = sMessageWithPayload;
21
22
  const sResponsePayload = (kind, sPayload) =>
22
23
  // success branch
23
- zod_1.z.object({ requestId: zod_1.z.string().nonempty(), kind }).and(sPayload);
24
+ zod_1.z.object({ requestId: zod_1.z.string().nonempty(), kind }).merge(sPayload);
24
25
  exports.sResponsePayload = sResponsePayload;
25
26
  exports.sAgentErrorCode = zod_1.z.enum(['NOT_SUPPORTED', 'TIMEOUT']);
26
27
  exports.sErrorPayload = (0, exports.sResponsePayload)(zod_1.z.literal('error-rs'), zod_1.z.object({
@@ -31,9 +32,12 @@ exports.sErrorPayload = (0, exports.sResponsePayload)(zod_1.z.literal('error-rs'
31
32
  exports.sRegisterRq = zod_1.z.object({
32
33
  kind: zod_1.z.literal('register'),
33
34
  providers: zod_1.z
34
- .record(agent_metadata_1.sProviderSpecs)
35
+ .record(zod_1.z.string(), agent_metadata_1.sProviderSpecs)
35
36
  .describe('Map of providers and their specs, ones that the agent can handle'),
36
- accessControlProviders: zod_1.z.record(agent_metadata_1.sAccessControlCapabilityReport).optional(),
37
+ accessControlProviders: zod_1.z
38
+ .record(zod_1.z.string(), agent_metadata_1.sAccessControlCapabilityReport)
39
+ .optional(),
40
+ testerCliTags: zod_1.z.array(zod_1.z.string().nonempty()).optional(),
37
41
  });
38
42
  exports.sRegisterRs = (0, exports.sResponsePayload)(zod_1.z.literal('register-rs'), zod_1.z.object({}));
39
43
  // UNREGISTER
@@ -47,7 +51,7 @@ exports.sUnregister = zod_1.z
47
51
  exports.sValidateProviderConfigRq = zod_1.z.object({
48
52
  kind: zod_1.z.literal('validate-config'),
49
53
  provider: zod_1.z.string().nonempty(),
50
- config: zod_1.z.record(zod_1.z.unknown()),
54
+ config: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
51
55
  });
52
56
  exports.sConfigurationIssue = zod_1.z
53
57
  .object({
@@ -63,7 +67,7 @@ exports.sStartServiceRq = zod_1.z
63
67
  .object({
64
68
  kind: zod_1.z.literal('start'),
65
69
  provider: zod_1.z.string().nonempty(),
66
- config: zod_1.z.record(zod_1.z.unknown()),
70
+ config: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
67
71
  lastEventForeignRef: zod_1.z
68
72
  .string()
69
73
  .nullable()
@@ -93,7 +97,7 @@ exports.sRunCommandRq = zod_1.z
93
97
  .string()
94
98
  .optional()
95
99
  .describe('Batch ID for the command of the command was part of a macro'),
96
- params: zod_1.z.record(zod_1.z.unknown()).optional(),
100
+ params: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
97
101
  })
98
102
  .describe('Request to run a device command');
99
103
  exports.sRunCommandRs = (0, exports.sResponsePayload)(zod_1.z.literal('command-rs'), zod_1.z.object({})).describe('Response for running a device command');
@@ -123,7 +127,9 @@ exports.sPushFile = zod_1.z
123
127
  kind: zod_1.z.literal('push-file'),
124
128
  query: zod_1.z.string().nonempty(),
125
129
  device: primitives_1.sAgentDeviceInfo,
126
- args: zod_1.z.unknown().describe('Query arguments, depends on the query type'),
130
+ args: zod_1.z
131
+ .record(zod_1.z.string(), zod_1.z.unknown())
132
+ .describe('Query arguments, depends on the query type'),
127
133
  url: zod_1.z.string().nonempty().describe('URL to pull the file from'),
128
134
  })
129
135
  .describe('Instruction to push a file from an agent to file relay');
@@ -133,7 +139,7 @@ exports.sPushStateUpdateRq = zod_1.z
133
139
  kind: zod_1.z.literal('state'),
134
140
  foreignRef: zod_1.z.string().nonempty(),
135
141
  provider: zod_1.z.string().nonempty(),
136
- mergeProps: zod_1.z.record(zod_1.z.unknown()),
142
+ mergeProps: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
137
143
  removeProps: zod_1.z.array(zod_1.z.string().nonempty()),
138
144
  })
139
145
  .describe('Request to push a device state update');
@@ -161,74 +167,72 @@ exports.sGetAvailableDevicesRq = zod_1.z
161
167
  .describe('Request to get available devices from a provider via an agent');
162
168
  exports.sGetAvailableDevicesRs = (0, exports.sResponsePayload)(zod_1.z.literal('get-available-devices-rs'), device_import_1.sDeviceDiscoveryDto).describe('Response for getting available devices from a provider via an agent');
163
169
  // ACCESS SYNC SECTION
170
+ exports.sExternalPersonProps = zod_1.z.object({
171
+ firstName: zod_1.z.string().nonempty(),
172
+ lastName: zod_1.z.string().nonempty(),
173
+ validFrom: zod_1.z.number().nullable(),
174
+ validTo: zod_1.z.number().nullable(),
175
+ accessSuspended: zod_1.z.boolean(),
176
+ credentials: zod_1.z
177
+ .array(rest_1.sAssignedCredential.omit({ note: true }))
178
+ .describe('IDs of credentials assigned to the person'),
179
+ });
180
+ exports.sExternalScheduleProps = zod_1.z.object({
181
+ displayName: zod_1.z.string().nonempty(),
182
+ include: objects_1.sScheduleDetailsRequest,
183
+ });
184
+ exports.sExternalAccessRuleProps = zod_1.z.object({
185
+ displayName: zod_1.z.string().nonempty(),
186
+ appliedTo: zod_1.z.array(zod_1.z.string().nonempty()),
187
+ permissions: zod_1.z.array(objects_1.sAccessRulePermissionDto),
188
+ groupPermissions: zod_1.z.array(objects_1.sAccessRuleGroupPermissionDto),
189
+ });
190
+ exports.sExternalZoneProps = zod_1.z.object({
191
+ displayName: zod_1.z.string().nonempty(),
192
+ devices: zod_1.z.array(zod_1.z.string().nonempty()),
193
+ });
194
+ exports.sExternalObjectProps = zod_1.z.object({
195
+ person: exports.sExternalPersonProps,
196
+ schedule: exports.sExternalScheduleProps,
197
+ accessRule: exports.sExternalAccessRuleProps,
198
+ zone: exports.sExternalZoneProps,
199
+ });
164
200
  // ————————————————————————————————————————————————————
165
201
  // Merge (insert vs update) variants, all listed explicitly
166
202
  // ————————————————————————————————————————————————————
167
203
  exports.sObjectMerge = zod_1.z
168
204
  .union([
169
- // accessRule insert
170
- zod_1.z.object({
171
- kind: zod_1.z.literal('merge'),
172
- objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
173
- objectKind: zod_1.z.literal('accessRule'),
174
- original: rest_1.sCreateAccessRuleRequest,
175
- props: rest_1.sCreateAccessRuleRequest,
176
- }),
177
205
  // accessRule update
178
206
  zod_1.z.object({
179
207
  kind: zod_1.z.literal('merge'),
180
208
  objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
181
209
  objectKind: zod_1.z.literal('accessRule'),
182
- original: rest_1.sCreateAccessRuleRequest,
183
- props: rest_1.sCreateAccessRuleRequest.partial(),
184
- }),
185
- // schedule insert
186
- zod_1.z.object({
187
- kind: zod_1.z.literal('merge'),
188
- objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
189
- objectKind: zod_1.z.literal('schedule'),
190
- original: rest_1.sCreateScheduleRequest,
191
- props: rest_1.sCreateScheduleRequest,
210
+ original: exports.sExternalAccessRuleProps,
211
+ props: exports.sExternalAccessRuleProps.partial(),
192
212
  }),
193
213
  // schedule update
194
214
  zod_1.z.object({
195
215
  kind: zod_1.z.literal('merge'),
196
216
  objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
197
217
  objectKind: zod_1.z.literal('schedule'),
198
- original: rest_1.sCreateScheduleRequest,
199
- props: rest_1.sCreateScheduleRequest.partial(),
200
- }),
201
- // person insert
202
- zod_1.z.object({
203
- kind: zod_1.z.literal('merge'),
204
- objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
205
- objectKind: zod_1.z.literal('person'),
206
- original: rest_1.sCreatePersonRequest,
207
- props: rest_1.sCreatePersonRequest,
218
+ original: exports.sExternalScheduleProps,
219
+ props: exports.sExternalScheduleProps.partial(),
208
220
  }),
209
221
  // person update
210
222
  zod_1.z.object({
211
223
  kind: zod_1.z.literal('merge'),
212
224
  objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
213
225
  objectKind: zod_1.z.literal('person'),
214
- original: rest_1.sCreatePersonRequest,
215
- props: rest_1.sCreatePersonRequest.partial(),
216
- }),
217
- // zone insert
218
- zod_1.z.object({
219
- kind: zod_1.z.literal('merge'),
220
- objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
221
- objectKind: zod_1.z.literal('zone'),
222
- original: rest_1.sCreateZoneRequest,
223
- props: rest_1.sCreateZoneRequest,
226
+ original: exports.sExternalPersonProps,
227
+ props: exports.sExternalPersonProps.partial(),
224
228
  }),
225
229
  // zone update
226
230
  zod_1.z.object({
227
231
  kind: zod_1.z.literal('merge'),
228
232
  objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
229
233
  objectKind: zod_1.z.literal('zone'),
230
- original: rest_1.sCreateZoneRequest,
231
- props: rest_1.sCreateZoneRequest.partial(),
234
+ original: exports.sExternalZoneProps,
235
+ props: exports.sExternalZoneProps.partial(),
232
236
  }),
233
237
  ])
234
238
  .describe('Object merge request');
@@ -241,25 +245,25 @@ exports.sObjectDelete = zod_1.z
241
245
  kind: zod_1.z.literal('delete'),
242
246
  objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
243
247
  objectKind: zod_1.z.literal('accessRule'),
244
- original: rest_1.sCreateAccessRuleRequest,
248
+ original: exports.sExternalAccessRuleProps,
245
249
  }),
246
250
  zod_1.z.object({
247
251
  kind: zod_1.z.literal('delete'),
248
252
  objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
249
253
  objectKind: zod_1.z.literal('schedule'),
250
- original: rest_1.sCreateScheduleRequest,
254
+ original: exports.sExternalScheduleProps,
251
255
  }),
252
256
  zod_1.z.object({
253
257
  kind: zod_1.z.literal('delete'),
254
258
  objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
255
259
  objectKind: zod_1.z.literal('person'),
256
- original: rest_1.sCreatePersonRequest,
260
+ original: exports.sExternalPersonProps,
257
261
  }),
258
262
  zod_1.z.object({
259
263
  kind: zod_1.z.literal('delete'),
260
264
  objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
261
265
  objectKind: zod_1.z.literal('zone'),
262
- original: rest_1.sCreateZoneRequest,
266
+ original: exports.sExternalZoneProps,
263
267
  }),
264
268
  ])
265
269
  .describe('Object delete request');
@@ -267,10 +271,10 @@ exports.sAccessMutation = zod_1.z
267
271
  .union([exports.sObjectMerge, exports.sObjectDelete])
268
272
  .describe('Access object change description');
269
273
  exports.sDeviceMap = zod_1.z
270
- .record(zod_1.z.record(zod_1.z.unknown()))
274
+ .record(zod_1.z.string(), zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()))
271
275
  .describe('Map of devices (readers) and their stashed provider metadata');
272
276
  exports.sRefMap = zod_1.z
273
- .record(zod_1.z.record(zod_1.z.array(zod_1.z.string().nonempty())))
277
+ .record(zod_1.z.string(), zod_1.z.record(zod_1.z.string(), zod_1.z.array(zod_1.z.string().nonempty())))
274
278
  .describe('Map of foreign references to object IDs');
275
279
  // A. VALIDATE ACCESS CHANGES
276
280
  exports.sValidateChangeRq = zod_1.z
@@ -347,6 +351,57 @@ exports.sAbortChange = zod_1.z
347
351
  policyVersion: zod_1.z.number().describe('Version of the access changes'),
348
352
  })
349
353
  .describe('Request to abort access changes');
354
+ // DESCRIBE
355
+ exports.sDescribeObjectRq = zod_1.z
356
+ .object({
357
+ kind: zod_1.z.literal('describe-object'),
358
+ provider: zod_1.z.string().nonempty(),
359
+ objectAssignedRef: zod_1.z
360
+ .string()
361
+ .nonempty()
362
+ .describe('Object ID as in 3rd party backend'),
363
+ objectKind: agent_metadata_1.sAccessObjectKind,
364
+ })
365
+ .describe('Request to describe the capabilities of a provider via an agent');
366
+ exports.sDescribeObjectRs = (0, exports.sResponsePayload)(zod_1.z.literal('describe-object-rs'), zod_1.z.object({
367
+ object: zod_1.z
368
+ .union([
369
+ zod_1.z.object({
370
+ objectKind: zod_1.z.literal('accessRule'),
371
+ objectAssignedRef: zod_1.z
372
+ .string()
373
+ .nonempty()
374
+ .describe('Object ID as in 3rd party backend'),
375
+ data: exports.sExternalAccessRuleProps,
376
+ }),
377
+ zod_1.z.object({
378
+ objectKind: zod_1.z.literal('schedule'),
379
+ objectAssignedRef: zod_1.z
380
+ .string()
381
+ .nonempty()
382
+ .describe('Object ID as in 3rd party backend'),
383
+ data: exports.sExternalScheduleProps,
384
+ }),
385
+ zod_1.z.object({
386
+ objectKind: zod_1.z.literal('person'),
387
+ data: exports.sExternalPersonProps,
388
+ objectAssignedRef: zod_1.z
389
+ .string()
390
+ .nonempty()
391
+ .describe('Object ID as in 3rd party backend'),
392
+ }),
393
+ zod_1.z.object({
394
+ objectKind: zod_1.z.literal('zone'),
395
+ data: exports.sExternalZoneProps,
396
+ objectAssignedRef: zod_1.z
397
+ .string()
398
+ .nonempty()
399
+ .describe('Object ID as in 3rd party backend'),
400
+ }),
401
+ ])
402
+ .nullable()
403
+ .describe('Object data or null if the object was not found'),
404
+ }));
350
405
  const fromAgentSchemaByKind = {
351
406
  register: exports.sRegisterRq,
352
407
  unregister: exports.sUnregister,
@@ -362,6 +417,7 @@ const fromAgentSchemaByKind = {
362
417
  'validate-change-rs': exports.sValidateChangeRs,
363
418
  'apply-change-rs': exports.sApplyChangeRs,
364
419
  'apply-change-progress': exports.sApplyChangeProgress,
420
+ 'describe-object-rs': exports.sDescribeObjectRs,
365
421
  'error-rs': exports.sErrorPayload,
366
422
  };
367
423
  exports.ReplyKindByRequestKind = {
@@ -376,11 +432,12 @@ exports.ReplyKindByRequestKind = {
376
432
  'get-available-devices': 'get-available-devices-rs',
377
433
  'validate-change': 'validate-change-rs',
378
434
  'apply-change': 'apply-change-rs',
435
+ 'describe-object': 'describe-object-rs',
379
436
  };
380
437
  const getAgentMessageIssues = (message) => {
381
438
  const result = exports.sMessageHeader.safeParse(message);
382
439
  if (!result.success) {
383
- return result.error.errors.map((e) => `${e.path.map((p) => p.toString()).join('.')} - ${e.message}`);
440
+ return result.error.issues.map((e) => `${e.path.map((p) => p.toString()).join('.')} - ${e.message}`);
384
441
  }
385
442
  const { kind } = message;
386
443
  const schema = fromAgentSchemaByKind[kind];
@@ -389,7 +446,7 @@ const getAgentMessageIssues = (message) => {
389
446
  }
390
447
  const result2 = schema.safeParse(message);
391
448
  if (!result2.success) {
392
- return result2.error.errors.map((e) => `${e.path.map((p) => p.toString()).join('.')} - ${e.message}`);
449
+ return result2.error.issues.map((e) => `${e.path.map((p) => p.toString()).join('.')} - ${e.message}`);
393
450
  }
394
451
  return [];
395
452
  };
@@ -2,311 +2,103 @@ import { z } from 'zod';
2
2
  export declare const sArmCommand: z.ZodObject<{
3
3
  command: z.ZodLiteral<"alarm.arm">;
4
4
  params: z.ZodObject<{
5
- deviceIds: z.ZodArray<z.ZodString, "many">;
6
- }, "strip", z.ZodTypeAny, {
7
- deviceIds: string[];
8
- }, {
9
- deviceIds: string[];
10
- }>;
11
- }, "strip", z.ZodTypeAny, {
12
- params: {
13
- deviceIds: string[];
14
- };
15
- command: "alarm.arm";
16
- }, {
17
- params: {
18
- deviceIds: string[];
19
- };
20
- command: "alarm.arm";
21
- }>;
5
+ deviceIds: z.ZodArray<z.ZodString>;
6
+ }, z.core.$strip>;
7
+ }, z.core.$strip>;
22
8
  export type ArmCommand = z.infer<typeof sArmCommand>;
23
9
  export declare const sDisarmCommand: z.ZodObject<{
24
10
  command: z.ZodLiteral<"alarm.disarm">;
25
11
  params: z.ZodObject<{
26
- deviceIds: z.ZodArray<z.ZodString, "many">;
12
+ deviceIds: z.ZodArray<z.ZodString>;
27
13
  duration: z.ZodOptional<z.ZodNumber>;
28
- }, "strip", z.ZodTypeAny, {
29
- deviceIds: string[];
30
- duration?: number | undefined;
31
- }, {
32
- deviceIds: string[];
33
- duration?: number | undefined;
34
- }>;
35
- }, "strip", z.ZodTypeAny, {
36
- params: {
37
- deviceIds: string[];
38
- duration?: number | undefined;
39
- };
40
- command: "alarm.disarm";
41
- }, {
42
- params: {
43
- deviceIds: string[];
44
- duration?: number | undefined;
45
- };
46
- command: "alarm.disarm";
47
- }>;
14
+ }, z.core.$strip>;
15
+ }, z.core.$strip>;
48
16
  export type DisarmCommand = z.infer<typeof sDisarmCommand>;
49
17
  export declare const sBypassCommand: z.ZodObject<{
50
18
  command: z.ZodLiteral<"alarm.bypass">;
51
19
  params: z.ZodObject<{
52
- deviceIds: z.ZodArray<z.ZodString, "many">;
53
- }, "strip", z.ZodTypeAny, {
54
- deviceIds: string[];
55
- }, {
56
- deviceIds: string[];
57
- }>;
58
- }, "strip", z.ZodTypeAny, {
59
- params: {
60
- deviceIds: string[];
61
- };
62
- command: "alarm.bypass";
63
- }, {
64
- params: {
65
- deviceIds: string[];
66
- };
67
- command: "alarm.bypass";
68
- }>;
20
+ deviceIds: z.ZodArray<z.ZodString>;
21
+ }, z.core.$strip>;
22
+ }, z.core.$strip>;
69
23
  export type BypassCommand = z.infer<typeof sBypassCommand>;
70
24
  export declare const sUnbypassCommand: z.ZodObject<{
71
25
  command: z.ZodLiteral<"alarm.unbypass">;
72
26
  params: z.ZodObject<{
73
- deviceIds: z.ZodArray<z.ZodString, "many">;
74
- }, "strip", z.ZodTypeAny, {
75
- deviceIds: string[];
76
- }, {
77
- deviceIds: string[];
78
- }>;
79
- }, "strip", z.ZodTypeAny, {
80
- params: {
81
- deviceIds: string[];
82
- };
83
- command: "alarm.unbypass";
84
- }, {
85
- params: {
86
- deviceIds: string[];
87
- };
88
- command: "alarm.unbypass";
89
- }>;
27
+ deviceIds: z.ZodArray<z.ZodString>;
28
+ }, z.core.$strip>;
29
+ }, z.core.$strip>;
90
30
  export type UnbypassCommand = z.infer<typeof sUnbypassCommand>;
91
31
  export declare const sArmAllCommand: z.ZodObject<{
92
32
  command: z.ZodLiteral<"alarm.arm-all">;
93
- params: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
94
- }, "strip", z.ZodTypeAny, {
95
- params: {};
96
- command: "alarm.arm-all";
97
- }, {
98
- params: {};
99
- command: "alarm.arm-all";
100
- }>;
33
+ params: z.ZodObject<{}, z.core.$strip>;
34
+ }, z.core.$strip>;
101
35
  export type ArmAllCommand = z.infer<typeof sArmAllCommand>;
102
36
  export declare const sDisarmAllCommand: z.ZodObject<{
103
37
  command: z.ZodLiteral<"alarm.disarm-all">;
104
38
  params: z.ZodObject<{
105
39
  duration: z.ZodOptional<z.ZodNumber>;
106
- }, "strip", z.ZodTypeAny, {
107
- duration?: number | undefined;
108
- }, {
109
- duration?: number | undefined;
110
- }>;
111
- }, "strip", z.ZodTypeAny, {
112
- params: {
113
- duration?: number | undefined;
114
- };
115
- command: "alarm.disarm-all";
116
- }, {
117
- params: {
118
- duration?: number | undefined;
119
- };
120
- command: "alarm.disarm-all";
121
- }>;
40
+ }, z.core.$strip>;
41
+ }, z.core.$strip>;
122
42
  export type DisarmAllCommand = z.infer<typeof sDisarmAllCommand>;
123
43
  export declare const sAcknowledgeCommand: z.ZodObject<{
124
44
  command: z.ZodLiteral<"alarm.acknowledge">;
125
- params: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
126
- }, "strip", z.ZodTypeAny, {
127
- params: {};
128
- command: "alarm.acknowledge";
129
- }, {
130
- params: {};
131
- command: "alarm.acknowledge";
132
- }>;
45
+ params: z.ZodObject<{}, z.core.$strip>;
46
+ }, z.core.$strip>;
133
47
  export type AcknowledgeCommand = z.infer<typeof sAcknowledgeCommand>;
134
48
  export declare const sSetTriggerCommand: z.ZodObject<{
135
49
  command: z.ZodLiteral<"alarm.set-trigger">;
136
50
  params: z.ZodObject<{
137
51
  event: z.ZodRecord<z.ZodString, z.ZodUnknown>;
138
52
  onlyIfArmed: z.ZodBoolean;
139
- }, "strip", z.ZodTypeAny, {
140
- event: Record<string, unknown>;
141
- onlyIfArmed: boolean;
142
- }, {
143
- event: Record<string, unknown>;
144
- onlyIfArmed: boolean;
145
- }>;
146
- }, "strip", z.ZodTypeAny, {
147
- params: {
148
- event: Record<string, unknown>;
149
- onlyIfArmed: boolean;
150
- };
151
- command: "alarm.set-trigger";
152
- }, {
153
- params: {
154
- event: Record<string, unknown>;
155
- onlyIfArmed: boolean;
156
- };
157
- command: "alarm.set-trigger";
158
- }>;
53
+ }, z.core.$strip>;
54
+ }, z.core.$strip>;
159
55
  export type SetTriggerCommand = z.infer<typeof sSetTriggerCommand>;
160
56
  export type AlarmCommand = ArmCommand | DisarmCommand | ArmAllCommand | DisarmAllCommand | AcknowledgeCommand | SetTriggerCommand | BypassCommand | UnbypassCommand;
161
57
  export declare const alarmCommandSchemas: {
162
58
  readonly 'alarm.arm': z.ZodObject<{
163
59
  command: z.ZodLiteral<"alarm.arm">;
164
60
  params: z.ZodObject<{
165
- deviceIds: z.ZodArray<z.ZodString, "many">;
166
- }, "strip", z.ZodTypeAny, {
167
- deviceIds: string[];
168
- }, {
169
- deviceIds: string[];
170
- }>;
171
- }, "strip", z.ZodTypeAny, {
172
- params: {
173
- deviceIds: string[];
174
- };
175
- command: "alarm.arm";
176
- }, {
177
- params: {
178
- deviceIds: string[];
179
- };
180
- command: "alarm.arm";
181
- }>;
61
+ deviceIds: z.ZodArray<z.ZodString>;
62
+ }, z.core.$strip>;
63
+ }, z.core.$strip>;
182
64
  readonly 'alarm.disarm': z.ZodObject<{
183
65
  command: z.ZodLiteral<"alarm.disarm">;
184
66
  params: z.ZodObject<{
185
- deviceIds: z.ZodArray<z.ZodString, "many">;
67
+ deviceIds: z.ZodArray<z.ZodString>;
186
68
  duration: z.ZodOptional<z.ZodNumber>;
187
- }, "strip", z.ZodTypeAny, {
188
- deviceIds: string[];
189
- duration?: number | undefined;
190
- }, {
191
- deviceIds: string[];
192
- duration?: number | undefined;
193
- }>;
194
- }, "strip", z.ZodTypeAny, {
195
- params: {
196
- deviceIds: string[];
197
- duration?: number | undefined;
198
- };
199
- command: "alarm.disarm";
200
- }, {
201
- params: {
202
- deviceIds: string[];
203
- duration?: number | undefined;
204
- };
205
- command: "alarm.disarm";
206
- }>;
69
+ }, z.core.$strip>;
70
+ }, z.core.$strip>;
207
71
  readonly 'alarm.arm-all': z.ZodObject<{
208
72
  command: z.ZodLiteral<"alarm.arm-all">;
209
- params: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
210
- }, "strip", z.ZodTypeAny, {
211
- params: {};
212
- command: "alarm.arm-all";
213
- }, {
214
- params: {};
215
- command: "alarm.arm-all";
216
- }>;
73
+ params: z.ZodObject<{}, z.core.$strip>;
74
+ }, z.core.$strip>;
217
75
  readonly 'alarm.disarm-all': z.ZodObject<{
218
76
  command: z.ZodLiteral<"alarm.disarm-all">;
219
77
  params: z.ZodObject<{
220
78
  duration: z.ZodOptional<z.ZodNumber>;
221
- }, "strip", z.ZodTypeAny, {
222
- duration?: number | undefined;
223
- }, {
224
- duration?: number | undefined;
225
- }>;
226
- }, "strip", z.ZodTypeAny, {
227
- params: {
228
- duration?: number | undefined;
229
- };
230
- command: "alarm.disarm-all";
231
- }, {
232
- params: {
233
- duration?: number | undefined;
234
- };
235
- command: "alarm.disarm-all";
236
- }>;
79
+ }, z.core.$strip>;
80
+ }, z.core.$strip>;
237
81
  readonly 'alarm.acknowledge': z.ZodObject<{
238
82
  command: z.ZodLiteral<"alarm.acknowledge">;
239
- params: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
240
- }, "strip", z.ZodTypeAny, {
241
- params: {};
242
- command: "alarm.acknowledge";
243
- }, {
244
- params: {};
245
- command: "alarm.acknowledge";
246
- }>;
83
+ params: z.ZodObject<{}, z.core.$strip>;
84
+ }, z.core.$strip>;
247
85
  readonly 'alarm.set-trigger': z.ZodObject<{
248
86
  command: z.ZodLiteral<"alarm.set-trigger">;
249
87
  params: z.ZodObject<{
250
88
  event: z.ZodRecord<z.ZodString, z.ZodUnknown>;
251
89
  onlyIfArmed: z.ZodBoolean;
252
- }, "strip", z.ZodTypeAny, {
253
- event: Record<string, unknown>;
254
- onlyIfArmed: boolean;
255
- }, {
256
- event: Record<string, unknown>;
257
- onlyIfArmed: boolean;
258
- }>;
259
- }, "strip", z.ZodTypeAny, {
260
- params: {
261
- event: Record<string, unknown>;
262
- onlyIfArmed: boolean;
263
- };
264
- command: "alarm.set-trigger";
265
- }, {
266
- params: {
267
- event: Record<string, unknown>;
268
- onlyIfArmed: boolean;
269
- };
270
- command: "alarm.set-trigger";
271
- }>;
90
+ }, z.core.$strip>;
91
+ }, z.core.$strip>;
272
92
  readonly 'alarm.bypass': z.ZodObject<{
273
93
  command: z.ZodLiteral<"alarm.bypass">;
274
94
  params: z.ZodObject<{
275
- deviceIds: z.ZodArray<z.ZodString, "many">;
276
- }, "strip", z.ZodTypeAny, {
277
- deviceIds: string[];
278
- }, {
279
- deviceIds: string[];
280
- }>;
281
- }, "strip", z.ZodTypeAny, {
282
- params: {
283
- deviceIds: string[];
284
- };
285
- command: "alarm.bypass";
286
- }, {
287
- params: {
288
- deviceIds: string[];
289
- };
290
- command: "alarm.bypass";
291
- }>;
95
+ deviceIds: z.ZodArray<z.ZodString>;
96
+ }, z.core.$strip>;
97
+ }, z.core.$strip>;
292
98
  readonly 'alarm.unbypass': z.ZodObject<{
293
99
  command: z.ZodLiteral<"alarm.unbypass">;
294
100
  params: z.ZodObject<{
295
- deviceIds: z.ZodArray<z.ZodString, "many">;
296
- }, "strip", z.ZodTypeAny, {
297
- deviceIds: string[];
298
- }, {
299
- deviceIds: string[];
300
- }>;
301
- }, "strip", z.ZodTypeAny, {
302
- params: {
303
- deviceIds: string[];
304
- };
305
- command: "alarm.unbypass";
306
- }, {
307
- params: {
308
- deviceIds: string[];
309
- };
310
- command: "alarm.unbypass";
311
- }>;
101
+ deviceIds: z.ZodArray<z.ZodString>;
102
+ }, z.core.$strip>;
103
+ }, z.core.$strip>;
312
104
  };