@awarevue/api-types 2.0.22 → 2.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_legacy/index.d.ts +2 -0
- package/dist/_legacy/index.js +2 -0
- package/dist/_legacy/milestone.js +1 -0
- package/dist/_legacy/orchid.js +1 -0
- package/dist/alarm-automation.d.ts +3 -3
- package/dist/alarm-automation.js +26 -37
- package/dist/api/agent-protocol/index.d.ts +1 -0
- package/dist/api/agent-protocol/index.js +1 -0
- package/dist/{agent-communication → api/agent-protocol}/protocol.d.ts +407 -598
- package/dist/api/agent-protocol/protocol.js +382 -0
- package/dist/api/commands/alarm.js +59 -0
- package/dist/{commands → api/commands}/all.d.ts +83 -83
- package/dist/{commands → api/commands}/all.js +22 -25
- package/dist/api/commands/camera-lift.js +14 -0
- package/dist/api/commands/camera.js +93 -0
- package/dist/api/commands/display.js +34 -0
- package/dist/api/commands/door.js +24 -0
- package/dist/api/commands/index.js +12 -0
- package/dist/api/commands/intercom-terminal.js +2 -0
- package/dist/api/commands/io-board.js +12 -0
- package/dist/api/commands/nvr-exporter.js +23 -0
- package/dist/api/commands/pbx.js +14 -0
- package/dist/api/commands/presence-tracker.js +30 -0
- package/dist/api/commands/server.js +24 -0
- package/dist/api/error.js +181 -0
- package/dist/api/events/alarm.js +52 -0
- package/dist/{events → api/events}/all.d.ts +8 -8
- package/dist/api/events/all.js +124 -0
- package/dist/api/events/camera.js +84 -0
- package/dist/api/events/display.js +6 -0
- package/dist/api/events/door.js +59 -0
- package/dist/api/events/index.js +12 -0
- package/dist/api/events/intercom-terminal.js +16 -0
- package/dist/api/events/io-board.js +10 -0
- package/dist/api/events/nvr-exporter.js +18 -0
- package/dist/api/events/panic-button.js +8 -0
- package/dist/api/events/presence-tracker.js +30 -0
- package/dist/api/events/reader.js +10 -0
- package/dist/{events → api/events}/server.d.ts +5 -5
- package/dist/api/events/server.js +12 -0
- package/dist/api/index.d.ts +9 -4
- package/dist/api/index.js +9 -20
- package/dist/api/mqtt/index.d.ts +1 -0
- package/dist/api/mqtt/index.js +1 -0
- package/dist/api/mqtt/payloads.js +18 -0
- package/dist/api/queries/all.js +25 -0
- package/dist/api/queries/camera.js +24 -0
- package/dist/api/queries/index.js +5 -0
- package/dist/api/queries/nvr-analytics-server.js +73 -0
- package/dist/api/queries/nvr-exporter.js +33 -0
- package/dist/api/queries/nvr-recorder.js +39 -0
- package/dist/api/rest/access-rule.d.ts +117 -0
- package/dist/api/rest/access-rule.js +10 -0
- package/dist/{access-control → api/rest}/agreement.d.ts +0 -20
- package/dist/api/rest/agreement.js +7 -0
- package/dist/api/rest/alarm.js +1 -0
- package/dist/{api-keys.d.ts → api/rest/api-keys.d.ts} +0 -20
- package/dist/api/rest/api-keys.js +11 -0
- package/dist/api/rest/app.js +9 -0
- package/dist/api/rest/auth.js +16 -0
- package/dist/{automation.d.ts → api/rest/automation.d.ts} +0 -217
- package/dist/api/rest/automation.js +14 -0
- package/dist/api/rest/aware-config.js +1 -0
- package/dist/{bookmarks.d.ts → api/rest/bookmarks.d.ts} +0 -49
- package/dist/api/rest/bookmarks.js +18 -0
- package/dist/api/rest/cast.js +7 -0
- package/dist/{custom-field.d.ts → api/rest/custom-field.d.ts} +1 -19
- package/dist/api/rest/custom-field.js +3 -0
- package/dist/{device-event.d.ts → api/rest/device-event.d.ts} +1 -1
- package/dist/api/rest/device-event.js +1 -0
- package/dist/{device-group.d.ts → api/rest/device-group.d.ts} +0 -23
- package/dist/api/rest/device-group.js +17 -0
- package/dist/api/rest/file.js +1 -0
- package/dist/api/rest/index.d.ts +34 -0
- package/dist/api/rest/index.js +34 -0
- package/dist/{device-factory.d.ts → api/rest/io-device.d.ts} +1 -1
- package/dist/api/rest/io-device.js +19 -0
- package/dist/{layout.d.ts → api/rest/layout.d.ts} +6 -107
- package/dist/api/rest/layout.js +19 -0
- package/dist/{macros.d.ts → api/rest/macros.d.ts} +0 -82
- package/dist/api/rest/macros.js +8 -0
- package/dist/api/rest/media.js +65 -0
- package/dist/api/rest/module-config.d.ts +19 -0
- package/dist/api/rest/module-config.js +1 -0
- package/dist/api/rest/notifications.d.ts +21 -0
- package/dist/api/rest/notifications.js +9 -0
- package/dist/api/rest/person-agreement.d.ts +15 -0
- package/dist/api/rest/person-agreement.js +6 -0
- package/dist/api/rest/person-presence.d.ts +72 -0
- package/dist/api/rest/person-presence.js +29 -0
- package/dist/{access-control → api/rest}/person-type.d.ts +1 -33
- package/dist/api/rest/person-type.js +8 -0
- package/dist/api/rest/person.d.ts +128 -0
- package/dist/api/rest/person.js +8 -0
- package/dist/api/{query.js → rest/query.js} +8 -13
- package/dist/api/rest/schedule.d.ts +249 -0
- package/dist/api/rest/schedule.js +9 -0
- package/dist/{security-level.d.ts → api/rest/security-level.d.ts} +0 -29
- package/dist/api/rest/security-level.js +5 -0
- package/dist/{template.d.ts → api/rest/template.d.ts} +1 -18
- package/dist/api/rest/template.js +12 -0
- package/dist/{token-conversion.d.ts → api/rest/token-conversion.d.ts} +0 -22
- package/dist/api/rest/token-conversion.js +5 -0
- package/dist/{user.d.ts → api/rest/user.d.ts} +10 -60
- package/dist/api/rest/user.js +32 -0
- package/dist/api/rest/view.d.ts +397 -0
- package/dist/api/rest/view.js +16 -0
- package/dist/api/rest/webrtc-playback.js +8 -0
- package/dist/{access-control → api/rest}/zone.d.ts +0 -29
- package/dist/api/rest/zone.js +10 -0
- package/dist/api/state/index.d.ts +10 -0
- package/dist/api/state/index.js +1 -0
- package/dist/api/ws/device-communication.js +55 -0
- package/dist/api/ws/index.js +5 -0
- package/dist/api/ws/notifications.js +20 -0
- package/dist/api/ws/progress.js +44 -0
- package/dist/api/ws/web-rtc-signaling.js +92 -0
- package/dist/api/ws/web-socket.js +2 -0
- package/dist/index.d.ts +1 -36
- package/dist/index.js +6 -57
- package/dist/{access-control → objects}/access-rule.d.ts +9 -78
- package/dist/objects/access-rule.js +36 -0
- package/dist/objects/agent-metadata.d.ts +192 -0
- package/dist/objects/agent-metadata.js +49 -0
- package/dist/objects/agreement.d.ts +21 -0
- package/dist/objects/agreement.js +8 -0
- package/dist/{objects.d.ts → objects/all.d.ts} +18 -11
- package/dist/{objects.js → objects/all.js} +4 -7
- package/dist/objects/api-key.d.ts +21 -0
- package/dist/objects/api-key.js +8 -0
- package/dist/objects/automation-rule.d.ts +218 -0
- package/dist/objects/automation-rule.js +51 -0
- package/dist/objects/bookmark.d.ts +50 -0
- package/dist/objects/bookmark.js +13 -0
- package/dist/objects/credential.js +11 -0
- package/dist/objects/custom-field.d.ts +20 -0
- package/dist/objects/custom-field.js +14 -0
- package/dist/{device → objects/device}/alarm.js +3 -6
- package/dist/{device → objects/device}/any-device.d.ts +510 -510
- package/dist/objects/device/any-device.js +239 -0
- package/dist/objects/device/camera-lift.js +4 -0
- package/dist/objects/device/camera.js +32 -0
- package/dist/objects/device/device-gateway.js +2 -0
- package/dist/{device-import.d.ts → objects/device/device-import.d.ts} +44 -44
- package/dist/objects/device/device-import.js +30 -0
- package/dist/{device-relation.js → objects/device/device-relation.js} +13 -16
- package/dist/objects/device/display.js +4 -0
- package/dist/objects/device/door.js +9 -0
- package/dist/{device → objects/device}/index.d.ts +2 -0
- package/dist/objects/device/index.js +22 -0
- package/dist/objects/device/intercom-operator.js +1 -0
- package/dist/objects/device/intercom-terminal.js +23 -0
- package/dist/objects/device/io-board.js +7 -0
- package/dist/objects/device/motion-sensor.js +4 -0
- package/dist/objects/device/nvr-analytics-server.js +6 -0
- package/dist/objects/device/nvr-exporter.js +7 -0
- package/dist/objects/device/nvr-recorder.js +6 -0
- package/dist/objects/device/panic-button.js +4 -0
- package/dist/objects/device/pbx.js +6 -0
- package/dist/objects/device/presence-tracker.js +1 -0
- package/dist/objects/device/reader.js +1 -0
- package/dist/{device → objects/device}/server.d.ts +1 -1
- package/dist/objects/device/server.js +1 -0
- package/dist/objects/device/system.js +6 -0
- package/dist/objects/device-group.d.ts +24 -0
- package/dist/objects/device-group.js +9 -0
- package/dist/objects/index.d.ts +27 -0
- package/dist/objects/index.js +27 -0
- package/dist/objects/layout.d.ts +102 -0
- package/dist/objects/layout.js +22 -0
- package/dist/objects/macro.d.ts +83 -0
- package/dist/objects/macro.js +22 -0
- package/dist/{module-config.d.ts → objects/module-config.d.ts} +1 -18
- package/dist/objects/module-config.js +1 -0
- package/dist/{notifications.d.ts → objects/notification.d.ts} +0 -20
- package/dist/objects/notification.js +13 -0
- package/dist/{access-control → objects}/person-agreement.d.ts +1 -15
- package/dist/objects/person-agreement.js +8 -0
- package/dist/{access-control → objects}/person-presence.d.ts +2 -73
- package/dist/objects/person-presence.js +35 -0
- package/dist/objects/person-type.d.ts +33 -0
- package/dist/objects/person-type.js +16 -0
- package/dist/{access-control → objects}/person.d.ts +74 -140
- package/dist/objects/person.js +42 -0
- package/dist/objects/role.d.ts +21 -0
- package/dist/objects/role.js +15 -0
- package/dist/{access-control → objects}/schedule.d.ts +4 -129
- package/dist/objects/schedule.js +53 -0
- package/dist/objects/security-level.d.ts +30 -0
- package/dist/objects/security-level.js +11 -0
- package/dist/objects/template.d.ts +20 -0
- package/dist/objects/template.js +8 -0
- package/dist/objects/token-conversion.d.ts +23 -0
- package/dist/objects/token-conversion.js +8 -0
- package/dist/objects/user.d.ts +31 -0
- package/dist/objects/user.js +12 -0
- package/dist/{view.d.ts → objects/view.d.ts} +3 -399
- package/dist/objects/view.js +64 -0
- package/dist/{world-objects.js → objects/world-object.js} +5 -8
- package/dist/objects/zone.d.ts +41 -0
- package/dist/objects/zone.js +15 -0
- package/dist/package.json +1 -1
- package/dist/permissions.js +146 -149
- package/dist/primitives.d.ts +30 -30
- package/dist/primitives.js +27 -30
- package/package.json +1 -1
- package/dist/access-control/access-rule.js +0 -49
- package/dist/access-control/agreement.js +0 -20
- package/dist/access-control/credential.js +0 -17
- package/dist/access-control/index.d.ts +0 -9
- package/dist/access-control/index.js +0 -25
- package/dist/access-control/person-agreement.js +0 -19
- package/dist/access-control/person-presence.js +0 -66
- package/dist/access-control/person-type.js +0 -29
- package/dist/access-control/person.js +0 -53
- package/dist/access-control/schedule.js +0 -65
- package/dist/access-control/zone.js +0 -28
- package/dist/agent-communication/index.d.ts +0 -2
- package/dist/agent-communication/index.js +0 -18
- package/dist/agent-communication/mqtt-payloads.js +0 -21
- package/dist/agent-communication/protocol.js +0 -436
- package/dist/api/alarm.js +0 -2
- package/dist/api/auth.js +0 -19
- package/dist/api/media.js +0 -68
- package/dist/api-keys.js +0 -21
- package/dist/app.js +0 -12
- package/dist/automation.js +0 -66
- package/dist/aware-config.js +0 -2
- package/dist/bookmarks.js +0 -32
- package/dist/cast.js +0 -13
- package/dist/commands/alarm.js +0 -62
- package/dist/commands/camera-lift.js +0 -17
- package/dist/commands/camera.js +0 -97
- package/dist/commands/display.js +0 -37
- package/dist/commands/door.js +0 -27
- package/dist/commands/index.js +0 -28
- package/dist/commands/intercom-terminal.js +0 -3
- package/dist/commands/io-board.js +0 -15
- package/dist/commands/nvr-exporter.js +0 -26
- package/dist/commands/pbx.js +0 -17
- package/dist/commands/presence-tracker.js +0 -33
- package/dist/commands/server.js +0 -27
- package/dist/custom-field.js +0 -19
- package/dist/device/any-device.js +0 -242
- package/dist/device/camera-lift.js +0 -7
- package/dist/device/camera.js +0 -35
- package/dist/device/device-gateway.js +0 -5
- package/dist/device/display.js +0 -7
- package/dist/device/door.js +0 -12
- package/dist/device/index.js +0 -36
- package/dist/device/intercom-operator.js +0 -4
- package/dist/device/intercom-terminal.js +0 -26
- package/dist/device/io-board.js +0 -10
- package/dist/device/motion-sensor.js +0 -7
- package/dist/device/nvr-analytics-server.js +0 -9
- package/dist/device/nvr-exporter.js +0 -10
- package/dist/device/nvr-recorder.js +0 -9
- package/dist/device/panic-button.js +0 -7
- package/dist/device/pbx.js +0 -9
- package/dist/device/presence-tracker.js +0 -4
- package/dist/device/reader.js +0 -4
- package/dist/device/server.js +0 -4
- package/dist/device/system.js +0 -9
- package/dist/device-event.js +0 -2
- package/dist/device-factory.js +0 -26
- package/dist/device-group.js +0 -31
- package/dist/device-import.js +0 -33
- package/dist/device-state.d.ts +0 -10
- package/dist/device-state.js +0 -2
- package/dist/error.js +0 -185
- package/dist/events/alarm.js +0 -55
- package/dist/events/all.js +0 -128
- package/dist/events/camera.js +0 -87
- package/dist/events/display.js +0 -9
- package/dist/events/door.js +0 -62
- package/dist/events/index.js +0 -28
- package/dist/events/intercom-terminal.js +0 -19
- package/dist/events/io-board.js +0 -13
- package/dist/events/nvr-exporter.js +0 -21
- package/dist/events/panic-button.js +0 -11
- package/dist/events/presence-tracker.js +0 -33
- package/dist/events/reader.js +0 -13
- package/dist/events/server.js +0 -15
- package/dist/file.js +0 -2
- package/dist/layout.js +0 -45
- package/dist/macros.js +0 -32
- package/dist/messages/device-communication.js +0 -63
- package/dist/messages/index.js +0 -21
- package/dist/messages/notifications.js +0 -27
- package/dist/messages/progress.js +0 -51
- package/dist/messages/web-rtc-signaling.js +0 -99
- package/dist/messages/web-socket.js +0 -5
- package/dist/milestone.js +0 -2
- package/dist/module-config.js +0 -2
- package/dist/notifications.js +0 -23
- package/dist/orchid.js +0 -2
- package/dist/queries/all.js +0 -28
- package/dist/queries/camera.js +0 -27
- package/dist/queries/index.js +0 -21
- package/dist/queries/nvr-analytics-server.js +0 -76
- package/dist/queries/nvr-exporter.js +0 -36
- package/dist/queries/nvr-recorder.js +0 -42
- package/dist/security-level.js +0 -18
- package/dist/template.js +0 -21
- package/dist/token-conversion.js +0 -15
- package/dist/user.js +0 -57
- package/dist/view.js +0 -84
- package/dist/webrtc-playback.js +0 -14
- package/dist/{milestone.d.ts → _legacy/milestone.d.ts} +0 -0
- package/dist/{orchid.d.ts → _legacy/orchid.d.ts} +0 -0
- package/dist/{commands → api/commands}/alarm.d.ts +0 -0
- package/dist/{commands → api/commands}/camera-lift.d.ts +0 -0
- package/dist/{commands → api/commands}/camera.d.ts +0 -0
- package/dist/{commands → api/commands}/display.d.ts +0 -0
- package/dist/{commands → api/commands}/door.d.ts +0 -0
- package/dist/{commands → api/commands}/index.d.ts +0 -0
- package/dist/{commands → api/commands}/intercom-terminal.d.ts +0 -0
- package/dist/{commands → api/commands}/io-board.d.ts +0 -0
- package/dist/{commands → api/commands}/nvr-exporter.d.ts +86 -86
- package/dist/{commands → api/commands}/pbx.d.ts +0 -0
- package/dist/{commands → api/commands}/presence-tracker.d.ts +0 -0
- package/dist/{commands → api/commands}/server.d.ts +78 -78
- package/dist/{error.d.ts → api/error.d.ts} +0 -0
- package/dist/{events → api/events}/alarm.d.ts +0 -0
- package/dist/{events → api/events}/camera.d.ts +0 -0
- package/dist/{events → api/events}/display.d.ts +0 -0
- package/dist/{events → api/events}/door.d.ts +0 -0
- package/dist/{events → api/events}/index.d.ts +0 -0
- package/dist/{events → api/events}/intercom-terminal.d.ts +0 -0
- package/dist/{events → api/events}/io-board.d.ts +0 -0
- package/dist/{events → api/events}/nvr-exporter.d.ts +4 -4
- package/dist/{events → api/events}/panic-button.d.ts +0 -0
- package/dist/{events → api/events}/presence-tracker.d.ts +8 -8
- package/dist/{events → api/events}/reader.d.ts +0 -0
- package/dist/{agent-communication/mqtt-payloads.d.ts → api/mqtt/payloads.d.ts} +0 -0
- package/dist/{queries → api/queries}/all.d.ts +83 -83
- package/dist/{queries → api/queries}/camera.d.ts +0 -0
- package/dist/{queries → api/queries}/index.d.ts +0 -0
- package/dist/{queries → api/queries}/nvr-analytics-server.d.ts +4 -4
- package/dist/{queries → api/queries}/nvr-exporter.d.ts +0 -0
- package/dist/{queries → api/queries}/nvr-recorder.d.ts +162 -162
- package/dist/api/{alarm.d.ts → rest/alarm.d.ts} +0 -0
- package/dist/{app.d.ts → api/rest/app.d.ts} +0 -0
- package/dist/api/{auth.d.ts → rest/auth.d.ts} +0 -0
- package/dist/{aware-config.d.ts → api/rest/aware-config.d.ts} +0 -0
- package/dist/{cast.d.ts → api/rest/cast.d.ts} +0 -0
- package/dist/{file.d.ts → api/rest/file.d.ts} +0 -0
- package/dist/api/{media.d.ts → rest/media.d.ts} +2 -2
- /package/dist/api/{query.d.ts → rest/query.d.ts} +0 -0
- /package/dist/{webrtc-playback.d.ts → api/rest/webrtc-playback.d.ts} +0 -0
- /package/dist/{messages → api/ws}/device-communication.d.ts +0 -0
- /package/dist/{messages → api/ws}/index.d.ts +0 -0
- /package/dist/{messages → api/ws}/notifications.d.ts +0 -0
- /package/dist/{messages → api/ws}/progress.d.ts +0 -0
- /package/dist/{messages → api/ws}/web-rtc-signaling.d.ts +0 -0
- /package/dist/{messages → api/ws}/web-socket.d.ts +0 -0
- /package/dist/{access-control → objects}/credential.d.ts +0 -0
- /package/dist/{device → objects/device}/alarm.d.ts +0 -0
- /package/dist/{device → objects/device}/camera-lift.d.ts +0 -0
- /package/dist/{device → objects/device}/camera.d.ts +0 -0
- /package/dist/{device → objects/device}/device-gateway.d.ts +0 -0
- /package/dist/{device-relation.d.ts → objects/device/device-relation.d.ts} +0 -0
- /package/dist/{device → objects/device}/display.d.ts +0 -0
- /package/dist/{device → objects/device}/door.d.ts +0 -0
- /package/dist/{device → objects/device}/intercom-operator.d.ts +0 -0
- /package/dist/{device → objects/device}/intercom-terminal.d.ts +0 -0
- /package/dist/{device → objects/device}/io-board.d.ts +0 -0
- /package/dist/{device → objects/device}/motion-sensor.d.ts +0 -0
- /package/dist/{device → objects/device}/nvr-analytics-server.d.ts +0 -0
- /package/dist/{device → objects/device}/nvr-exporter.d.ts +0 -0
- /package/dist/{device → objects/device}/nvr-recorder.d.ts +0 -0
- /package/dist/{device → objects/device}/panic-button.d.ts +0 -0
- /package/dist/{device → objects/device}/pbx.d.ts +0 -0
- /package/dist/{device → objects/device}/presence-tracker.d.ts +0 -0
- /package/dist/{device → objects/device}/reader.d.ts +0 -0
- /package/dist/{device → objects/device}/system.d.ts +0 -0
- /package/dist/{world-objects.d.ts → objects/world-object.d.ts} +0 -0
|
@@ -1,436 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isMessageFromAgent = exports.getAgentMessageIssues = 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.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.sAccessControlCapabilityReport = exports.sTokenSpecs = exports.sAccessObjectKind = exports.sProviderSpecs = exports.sUiHint = exports.sUiWidgetHint = exports.sUiOrderHint = exports.sErrorPayload = exports.sAgentErrorCode = exports.sResponsePayload = exports.sMessageWithPayload = exports.sMessageHeader = void 0;
|
|
4
|
-
const device_import_1 = require("../device-import");
|
|
5
|
-
const credential_1 = require("../access-control/credential");
|
|
6
|
-
const zod_1 = require("zod");
|
|
7
|
-
const access_control_1 = require("../access-control");
|
|
8
|
-
const primitives_1 = require("../primitives");
|
|
9
|
-
// PROTOCOL ENVELOPE
|
|
10
|
-
exports.sMessageHeader = zod_1.z.object({
|
|
11
|
-
version: zod_1.z.number().describe('Protocol version'),
|
|
12
|
-
id: zod_1.z.string().nonempty('ID is required').describe('Unique message ID'),
|
|
13
|
-
from: zod_1.z
|
|
14
|
-
.string()
|
|
15
|
-
.nonempty('Agent name required')
|
|
16
|
-
.describe("Sender ID (Agent ID or 'server')"),
|
|
17
|
-
on: zod_1.z.number().describe('Timestamp in milliseconds since epoch'),
|
|
18
|
-
});
|
|
19
|
-
const sMessageWithPayload = (sPayload) => exports.sMessageHeader.and(sPayload).describe('Message with payload');
|
|
20
|
-
exports.sMessageWithPayload = sMessageWithPayload;
|
|
21
|
-
const sResponsePayload = (kind, sPayload) =>
|
|
22
|
-
// success branch
|
|
23
|
-
zod_1.z.object({ requestId: zod_1.z.string().nonempty(), kind }).and(sPayload);
|
|
24
|
-
exports.sResponsePayload = sResponsePayload;
|
|
25
|
-
exports.sAgentErrorCode = zod_1.z.enum(['NOT_SUPPORTED', 'TIMEOUT']);
|
|
26
|
-
exports.sErrorPayload = (0, exports.sResponsePayload)(zod_1.z.literal('error-rs'), zod_1.z.object({
|
|
27
|
-
error: zod_1.z.string().nonempty().describe('Error message if request failed'),
|
|
28
|
-
code: exports.sAgentErrorCode.optional().describe('Optional error code'),
|
|
29
|
-
}));
|
|
30
|
-
// REGISTER
|
|
31
|
-
exports.sUiOrderHint = zod_1.z.object({
|
|
32
|
-
kind: zod_1.z.literal('order'),
|
|
33
|
-
path: zod_1.z.string(),
|
|
34
|
-
fields: zod_1.z.array(zod_1.z.string().nonempty()),
|
|
35
|
-
});
|
|
36
|
-
exports.sUiWidgetHint = zod_1.z.object({
|
|
37
|
-
kind: zod_1.z.literal('widget'),
|
|
38
|
-
path: zod_1.z.string(),
|
|
39
|
-
spanColumns: zod_1.z.number().optional(),
|
|
40
|
-
password: zod_1.z.boolean().optional(),
|
|
41
|
-
placeHolder: zod_1.z.string().optional(),
|
|
42
|
-
});
|
|
43
|
-
exports.sUiHint = zod_1.z.union([exports.sUiOrderHint, exports.sUiWidgetHint]);
|
|
44
|
-
exports.sProviderSpecs = zod_1.z.object({
|
|
45
|
-
title: zod_1.z
|
|
46
|
-
.string()
|
|
47
|
-
.nonempty()
|
|
48
|
-
.describe('a human-readable name for the provider'),
|
|
49
|
-
configSchema: zod_1.z
|
|
50
|
-
.unknown()
|
|
51
|
-
.describe('a valid JSON schema that describes provider config data structure'), // We can use AJV to validate the definition of a JSON schema
|
|
52
|
-
configDefault: zod_1.z
|
|
53
|
-
.record(zod_1.z.unknown())
|
|
54
|
-
.describe('Default initialized values for configuration'),
|
|
55
|
-
configFormUiHints: zod_1.z
|
|
56
|
-
.array(exports.sUiHint)
|
|
57
|
-
.optional()
|
|
58
|
-
.describe('UI hints for configuration form visuals'),
|
|
59
|
-
});
|
|
60
|
-
exports.sAccessObjectKind = zod_1.z.enum([
|
|
61
|
-
'accessRule',
|
|
62
|
-
'schedule',
|
|
63
|
-
'person',
|
|
64
|
-
'device',
|
|
65
|
-
'zone',
|
|
66
|
-
]);
|
|
67
|
-
exports.sTokenSpecs = zod_1.z.object({
|
|
68
|
-
type: credential_1.sCredentialType, // etc, those map to a AWARE-standardized set of token types
|
|
69
|
-
regex: zod_1.z.string().optional(),
|
|
70
|
-
formatDescription: zod_1.z.string().optional(),
|
|
71
|
-
maxPerPerson: zod_1.z.number().optional(),
|
|
72
|
-
});
|
|
73
|
-
exports.sAccessControlCapabilityReport = zod_1.z.object({
|
|
74
|
-
tokens: zod_1.z.array(exports.sTokenSpecs),
|
|
75
|
-
accessObjects: zod_1.z.array(exports.sAccessObjectKind),
|
|
76
|
-
oneSchedulePerDoor: zod_1.z.boolean(),
|
|
77
|
-
});
|
|
78
|
-
exports.sRegisterRq = zod_1.z.object({
|
|
79
|
-
kind: zod_1.z.literal('register'),
|
|
80
|
-
providers: zod_1.z
|
|
81
|
-
.record(exports.sProviderSpecs)
|
|
82
|
-
.describe('Map of providers and their specs, ones that the agent can handle'),
|
|
83
|
-
accessControlProviders: zod_1.z.record(exports.sAccessControlCapabilityReport).optional(),
|
|
84
|
-
});
|
|
85
|
-
exports.sRegisterRs = (0, exports.sResponsePayload)(zod_1.z.literal('register-rs'), zod_1.z.object({}));
|
|
86
|
-
// UNREGISTER
|
|
87
|
-
exports.sUnregister = zod_1.z
|
|
88
|
-
.object({
|
|
89
|
-
kind: zod_1.z.literal('unregister'),
|
|
90
|
-
provider: zod_1.z.string().nonempty(),
|
|
91
|
-
})
|
|
92
|
-
.describe('Request to unregister a provider');
|
|
93
|
-
// VALIDATE PROVIDER CONFIG
|
|
94
|
-
exports.sValidateProviderConfigRq = zod_1.z.object({
|
|
95
|
-
kind: zod_1.z.literal('validate-config'),
|
|
96
|
-
provider: zod_1.z.string().nonempty(),
|
|
97
|
-
config: zod_1.z.record(zod_1.z.unknown()),
|
|
98
|
-
});
|
|
99
|
-
exports.sConfigurationIssue = zod_1.z
|
|
100
|
-
.object({
|
|
101
|
-
paths: zod_1.z.array(zod_1.z.string()),
|
|
102
|
-
message: zod_1.z.string(),
|
|
103
|
-
})
|
|
104
|
-
.describe('A configuration issue that can be reported by agents');
|
|
105
|
-
exports.sValidateProviderConfigRs = (0, exports.sResponsePayload)(zod_1.z.literal('validate-config-rs'), zod_1.z.object({
|
|
106
|
-
issues: zod_1.z.array(exports.sConfigurationIssue),
|
|
107
|
-
})).describe('Validation result for provider configuration');
|
|
108
|
-
// START SERVICE
|
|
109
|
-
exports.sStartServiceRq = zod_1.z
|
|
110
|
-
.object({
|
|
111
|
-
kind: zod_1.z.literal('start'),
|
|
112
|
-
provider: zod_1.z.string().nonempty(),
|
|
113
|
-
config: zod_1.z.record(zod_1.z.unknown()),
|
|
114
|
-
lastEventForeignRef: zod_1.z
|
|
115
|
-
.string()
|
|
116
|
-
.nullable()
|
|
117
|
-
.describe('Last event foreign reference that the agent should start from'),
|
|
118
|
-
lastEventTimestamp: zod_1.z
|
|
119
|
-
.number()
|
|
120
|
-
.nullable()
|
|
121
|
-
.describe('Last event timestamp that the agent should start from'),
|
|
122
|
-
})
|
|
123
|
-
.describe('Request to start a service for a provider');
|
|
124
|
-
exports.sStartServiceRs = (0, exports.sResponsePayload)(zod_1.z.literal('start-rs'), zod_1.z.object({})).describe('Response for starting a service for a provider');
|
|
125
|
-
// STOP SERVICE
|
|
126
|
-
exports.sStopServiceRq = zod_1.z
|
|
127
|
-
.object({
|
|
128
|
-
kind: zod_1.z.literal('stop'),
|
|
129
|
-
provider: zod_1.z.string().nonempty(),
|
|
130
|
-
})
|
|
131
|
-
.describe('Request to stop a service for a provider');
|
|
132
|
-
exports.sStopServiceRs = (0, exports.sResponsePayload)(zod_1.z.literal('stop-rs'), zod_1.z.object({})).describe('Response for starting a service for a provider');
|
|
133
|
-
// RUN COMMAND
|
|
134
|
-
exports.sRunCommandRq = zod_1.z
|
|
135
|
-
.object({
|
|
136
|
-
kind: zod_1.z.literal('command'),
|
|
137
|
-
device: primitives_1.sAgentDeviceInfo,
|
|
138
|
-
command: zod_1.z.string().nonempty(),
|
|
139
|
-
batchId: zod_1.z
|
|
140
|
-
.string()
|
|
141
|
-
.optional()
|
|
142
|
-
.describe('Batch ID for the command of the command was part of a macro'),
|
|
143
|
-
params: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
144
|
-
})
|
|
145
|
-
.describe('Request to run a device command');
|
|
146
|
-
exports.sRunCommandRs = (0, exports.sResponsePayload)(zod_1.z.literal('command-rs'), zod_1.z.object({})).describe('Response for running a device command');
|
|
147
|
-
// QUERIES
|
|
148
|
-
exports.sQueryRq = zod_1.z.object({
|
|
149
|
-
kind: zod_1.z.literal('query'),
|
|
150
|
-
query: zod_1.z.string().nonempty(),
|
|
151
|
-
device: primitives_1.sAgentDeviceInfo,
|
|
152
|
-
args: zod_1.z.unknown().describe('Query arguments, depends on the query type'),
|
|
153
|
-
});
|
|
154
|
-
exports.sQueryRs = (0, exports.sResponsePayload)(zod_1.z.literal('query-rs'), zod_1.z.object({
|
|
155
|
-
result: zod_1.z.unknown().describe('Query result, depends on the query type'),
|
|
156
|
-
})).describe('Response for a query');
|
|
157
|
-
// FILE PUSH INSTRUCTIONS
|
|
158
|
-
exports.sPushFile = zod_1.z
|
|
159
|
-
.object({
|
|
160
|
-
kind: zod_1.z.literal('push-file'),
|
|
161
|
-
query: zod_1.z.string().nonempty(),
|
|
162
|
-
device: primitives_1.sAgentDeviceInfo,
|
|
163
|
-
args: zod_1.z.unknown().describe('Query arguments, depends on the query type'),
|
|
164
|
-
url: zod_1.z.string().nonempty().describe('URL to pull the file from'),
|
|
165
|
-
})
|
|
166
|
-
.describe('Instruction to push a file from an agent to file relay');
|
|
167
|
-
// PUSH DEVICE STATE UPDATE
|
|
168
|
-
exports.sPushStateUpdateRq = zod_1.z
|
|
169
|
-
.object({
|
|
170
|
-
kind: zod_1.z.literal('state'),
|
|
171
|
-
foreignRef: zod_1.z.string().nonempty(),
|
|
172
|
-
provider: zod_1.z.string().nonempty(),
|
|
173
|
-
mergeProps: zod_1.z.record(zod_1.z.unknown()),
|
|
174
|
-
removeProps: zod_1.z.array(zod_1.z.string().nonempty()),
|
|
175
|
-
})
|
|
176
|
-
.describe('Request to push a device state update');
|
|
177
|
-
exports.sPushStateUpdateRs = (0, exports.sResponsePayload)(zod_1.z.literal('state-rs'), zod_1.z.object({})).describe('Response for pushing a device state update');
|
|
178
|
-
// PUSH DEVICE EVENT
|
|
179
|
-
exports.sPushEventRq = zod_1.z
|
|
180
|
-
.object({
|
|
181
|
-
kind: zod_1.z.literal('event'),
|
|
182
|
-
foreignRef: zod_1.z.string().nonempty(),
|
|
183
|
-
provider: zod_1.z.string().nonempty(),
|
|
184
|
-
eventTimestamp: zod_1.z
|
|
185
|
-
.number()
|
|
186
|
-
.describe('Event timestamp in milliseconds since epoch, as reported by origin'),
|
|
187
|
-
eventForeignRef: zod_1.z.string().nonempty(),
|
|
188
|
-
event: zod_1.z.unknown().describe('Event data'),
|
|
189
|
-
})
|
|
190
|
-
.describe('Request to push a device event');
|
|
191
|
-
exports.sPushEventRs = (0, exports.sResponsePayload)(zod_1.z.literal('event-rs'), zod_1.z.object({})).describe('Response for pushing a device event');
|
|
192
|
-
// REQUEST AVAILABLE DEVICES (DISCOVERY)
|
|
193
|
-
exports.sGetAvailableDevicesRq = zod_1.z
|
|
194
|
-
.object({
|
|
195
|
-
kind: zod_1.z.literal('get-available-devices'),
|
|
196
|
-
provider: zod_1.z.string().nonempty(),
|
|
197
|
-
})
|
|
198
|
-
.describe('Request to get available devices from a provider via an agent');
|
|
199
|
-
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');
|
|
200
|
-
// ACCESS SYNC SECTION
|
|
201
|
-
// ————————————————————————————————————————————————————
|
|
202
|
-
// Merge (insert vs update) variants, all listed explicitly
|
|
203
|
-
// ————————————————————————————————————————————————————
|
|
204
|
-
exports.sObjectMerge = zod_1.z
|
|
205
|
-
.union([
|
|
206
|
-
// accessRule insert
|
|
207
|
-
zod_1.z.object({
|
|
208
|
-
kind: zod_1.z.literal('merge'),
|
|
209
|
-
objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
|
|
210
|
-
objectKind: zod_1.z.literal('accessRule'),
|
|
211
|
-
original: zod_1.z.null(),
|
|
212
|
-
props: access_control_1.sCreateAccessRuleRequest,
|
|
213
|
-
}),
|
|
214
|
-
// accessRule update
|
|
215
|
-
zod_1.z.object({
|
|
216
|
-
kind: zod_1.z.literal('merge'),
|
|
217
|
-
objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
|
|
218
|
-
objectKind: zod_1.z.literal('accessRule'),
|
|
219
|
-
original: access_control_1.sCreateAccessRuleRequest,
|
|
220
|
-
props: access_control_1.sCreateAccessRuleRequest.partial(),
|
|
221
|
-
}),
|
|
222
|
-
// schedule insert
|
|
223
|
-
zod_1.z.object({
|
|
224
|
-
kind: zod_1.z.literal('merge'),
|
|
225
|
-
objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
|
|
226
|
-
objectKind: zod_1.z.literal('schedule'),
|
|
227
|
-
original: zod_1.z.null(),
|
|
228
|
-
props: access_control_1.sCreateScheduleRequest,
|
|
229
|
-
}),
|
|
230
|
-
// schedule update
|
|
231
|
-
zod_1.z.object({
|
|
232
|
-
kind: zod_1.z.literal('merge'),
|
|
233
|
-
objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
|
|
234
|
-
objectKind: zod_1.z.literal('schedule'),
|
|
235
|
-
original: access_control_1.sCreateScheduleRequest,
|
|
236
|
-
props: access_control_1.sCreateScheduleRequest.partial(),
|
|
237
|
-
}),
|
|
238
|
-
// person insert
|
|
239
|
-
zod_1.z.object({
|
|
240
|
-
kind: zod_1.z.literal('merge'),
|
|
241
|
-
objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
|
|
242
|
-
objectKind: zod_1.z.literal('person'),
|
|
243
|
-
original: zod_1.z.null(),
|
|
244
|
-
props: access_control_1.sCreatePersonRequest,
|
|
245
|
-
}),
|
|
246
|
-
// person update
|
|
247
|
-
zod_1.z.object({
|
|
248
|
-
kind: zod_1.z.literal('merge'),
|
|
249
|
-
objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
|
|
250
|
-
objectKind: zod_1.z.literal('person'),
|
|
251
|
-
original: access_control_1.sCreatePersonRequest,
|
|
252
|
-
props: access_control_1.sCreatePersonRequest.partial(),
|
|
253
|
-
}),
|
|
254
|
-
// zone insert
|
|
255
|
-
zod_1.z.object({
|
|
256
|
-
kind: zod_1.z.literal('merge'),
|
|
257
|
-
objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
|
|
258
|
-
objectKind: zod_1.z.literal('zone'),
|
|
259
|
-
original: zod_1.z.null(),
|
|
260
|
-
props: access_control_1.sCreateZoneRequest,
|
|
261
|
-
}),
|
|
262
|
-
// zone update
|
|
263
|
-
zod_1.z.object({
|
|
264
|
-
kind: zod_1.z.literal('merge'),
|
|
265
|
-
objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
|
|
266
|
-
objectKind: zod_1.z.literal('zone'),
|
|
267
|
-
original: access_control_1.sCreateZoneRequest,
|
|
268
|
-
props: access_control_1.sCreateZoneRequest.partial(),
|
|
269
|
-
}),
|
|
270
|
-
])
|
|
271
|
-
.describe('Object merge request');
|
|
272
|
-
// ————————————————————————————————————————————————————
|
|
273
|
-
// Delete variants, also fully expanded
|
|
274
|
-
// ————————————————————————————————————————————————————
|
|
275
|
-
exports.sObjectDelete = zod_1.z
|
|
276
|
-
.union([
|
|
277
|
-
zod_1.z.object({
|
|
278
|
-
kind: zod_1.z.literal('delete'),
|
|
279
|
-
objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
|
|
280
|
-
objectKind: zod_1.z.literal('accessRule'),
|
|
281
|
-
original: access_control_1.sCreateAccessRuleRequest,
|
|
282
|
-
}),
|
|
283
|
-
zod_1.z.object({
|
|
284
|
-
kind: zod_1.z.literal('delete'),
|
|
285
|
-
objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
|
|
286
|
-
objectKind: zod_1.z.literal('schedule'),
|
|
287
|
-
original: access_control_1.sCreateScheduleRequest,
|
|
288
|
-
}),
|
|
289
|
-
zod_1.z.object({
|
|
290
|
-
kind: zod_1.z.literal('delete'),
|
|
291
|
-
objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
|
|
292
|
-
objectKind: zod_1.z.literal('person'),
|
|
293
|
-
original: access_control_1.sCreatePersonRequest,
|
|
294
|
-
}),
|
|
295
|
-
zod_1.z.object({
|
|
296
|
-
kind: zod_1.z.literal('delete'),
|
|
297
|
-
objectId: zod_1.z.string().nonempty().describe('Object ID as in backend'),
|
|
298
|
-
objectKind: zod_1.z.literal('zone'),
|
|
299
|
-
original: access_control_1.sCreateZoneRequest,
|
|
300
|
-
}),
|
|
301
|
-
])
|
|
302
|
-
.describe('Object delete request');
|
|
303
|
-
exports.sAccessMutation = zod_1.z
|
|
304
|
-
.union([exports.sObjectMerge, exports.sObjectDelete])
|
|
305
|
-
.describe('Access object change description');
|
|
306
|
-
exports.sDeviceMap = zod_1.z
|
|
307
|
-
.record(zod_1.z.record(zod_1.z.unknown()))
|
|
308
|
-
.describe('Map of devices (readers) and their stashed provider metadata');
|
|
309
|
-
exports.sRefMap = zod_1.z
|
|
310
|
-
.record(zod_1.z.record(zod_1.z.array(zod_1.z.string().nonempty())))
|
|
311
|
-
.describe('Map of foreign references to object IDs');
|
|
312
|
-
// A. VALIDATE ACCESS CHANGES
|
|
313
|
-
exports.sValidateChangeRq = zod_1.z
|
|
314
|
-
.object({
|
|
315
|
-
kind: zod_1.z.literal('validate-change'),
|
|
316
|
-
provider: zod_1.z.string().nonempty(),
|
|
317
|
-
devices: exports.sDeviceMap,
|
|
318
|
-
refMap: exports.sRefMap,
|
|
319
|
-
mutations: zod_1.z.array(exports.sAccessMutation),
|
|
320
|
-
})
|
|
321
|
-
.describe('Request to validate access changes');
|
|
322
|
-
exports.sChangeIssueCode = zod_1.z.enum([
|
|
323
|
-
'BAD_REFERENCE',
|
|
324
|
-
'NOT_FOUND',
|
|
325
|
-
'NOT_UNIQUE',
|
|
326
|
-
'INVALID',
|
|
327
|
-
'NOT_SUPPORTED',
|
|
328
|
-
]);
|
|
329
|
-
exports.sChangeIssue = zod_1.z
|
|
330
|
-
.object({
|
|
331
|
-
objectId: zod_1.z.string().optional().describe('Object ID as in backend'),
|
|
332
|
-
objectKind: exports.sAccessObjectKind.optional(),
|
|
333
|
-
code: exports.sChangeIssueCode
|
|
334
|
-
.optional()
|
|
335
|
-
.describe('Issue code that describes the issue to UI agent(s) or bots'),
|
|
336
|
-
path: zod_1.z
|
|
337
|
-
.string()
|
|
338
|
-
.optional()
|
|
339
|
-
.describe('Path - inside object referenced by ObjectID, points to a field or a related object'),
|
|
340
|
-
index: zod_1.z
|
|
341
|
-
.number()
|
|
342
|
-
.optional()
|
|
343
|
-
.describe('Index ofa value in field pointed at by path'),
|
|
344
|
-
message: zod_1.z
|
|
345
|
-
.string()
|
|
346
|
-
.optional()
|
|
347
|
-
.describe('Message that describes the issue to user or the details of what went wrong'),
|
|
348
|
-
})
|
|
349
|
-
.describe('Access change issue description');
|
|
350
|
-
exports.sValidateChangeRs = (0, exports.sResponsePayload)(zod_1.z.literal('validate-change-rs'), zod_1.z.object({
|
|
351
|
-
issues: zod_1.z.array(exports.sChangeIssue),
|
|
352
|
-
})).describe('Response for validating access changes');
|
|
353
|
-
// B. APPLY ACCESS CHANGES
|
|
354
|
-
exports.sApplyChange = zod_1.z
|
|
355
|
-
.object({
|
|
356
|
-
kind: zod_1.z.literal('apply-change'),
|
|
357
|
-
provider: zod_1.z.string().nonempty(),
|
|
358
|
-
devices: exports.sDeviceMap,
|
|
359
|
-
refMap: exports.sRefMap,
|
|
360
|
-
mutations: zod_1.z.array(exports.sAccessMutation),
|
|
361
|
-
})
|
|
362
|
-
.describe('Request to apply access changes');
|
|
363
|
-
exports.sApplyChangeRs = (0, exports.sResponsePayload)(zod_1.z.literal('apply-change-rs'), zod_1.z.object({
|
|
364
|
-
requestId: zod_1.z.string().nonempty(),
|
|
365
|
-
//error: z.string().optional().describe('Error message if request failed'),
|
|
366
|
-
refs: exports.sRefMap,
|
|
367
|
-
})).describe('Response for applying access changes');
|
|
368
|
-
exports.sApplyChangeProgress = zod_1.z
|
|
369
|
-
.object({
|
|
370
|
-
kind: zod_1.z.literal('apply-change-progress'),
|
|
371
|
-
requestId: zod_1.z.string().nonempty(),
|
|
372
|
-
mutationIndex: zod_1.z
|
|
373
|
-
.number()
|
|
374
|
-
.describe('Index of the finished mutation in the batch'),
|
|
375
|
-
// total: z.number().describe('Progress of the access changes'),
|
|
376
|
-
// completed: z.number().describe('Progress of the access changes'),
|
|
377
|
-
})
|
|
378
|
-
.describe('Progress of the access changes');
|
|
379
|
-
// C. ABORT CHANGES
|
|
380
|
-
exports.sAbortChange = zod_1.z
|
|
381
|
-
.object({
|
|
382
|
-
kind: zod_1.z.literal('abort-change'),
|
|
383
|
-
provider: zod_1.z.string().nonempty(),
|
|
384
|
-
policyVersion: zod_1.z.number().describe('Version of the access changes'),
|
|
385
|
-
})
|
|
386
|
-
.describe('Request to abort access changes');
|
|
387
|
-
const fromAgentSchemaByKind = {
|
|
388
|
-
register: exports.sRegisterRq,
|
|
389
|
-
unregister: exports.sUnregister,
|
|
390
|
-
'validate-config-rs': exports.sValidateProviderConfigRs,
|
|
391
|
-
'start-rs': exports.sStartServiceRs,
|
|
392
|
-
'stop-rs': exports.sStopServiceRs,
|
|
393
|
-
'command-rs': exports.sRunCommandRs,
|
|
394
|
-
'query-rs': exports.sQueryRs,
|
|
395
|
-
state: exports.sPushStateUpdateRq,
|
|
396
|
-
event: exports.sPushEventRq,
|
|
397
|
-
'get-available-devices-rs': exports.sGetAvailableDevicesRs,
|
|
398
|
-
'validate-change-rs': exports.sValidateChangeRs,
|
|
399
|
-
'apply-change-rs': exports.sApplyChangeRs,
|
|
400
|
-
'apply-change-progress': exports.sApplyChangeProgress,
|
|
401
|
-
'error-rs': exports.sErrorPayload,
|
|
402
|
-
};
|
|
403
|
-
const getAgentMessageIssues = (message) => {
|
|
404
|
-
const result = exports.sMessageHeader.safeParse(message);
|
|
405
|
-
if (!result.success) {
|
|
406
|
-
return result.error.errors.map((e) => `${e.path.map((p) => p.toString()).join('.')} - ${e.message}`);
|
|
407
|
-
}
|
|
408
|
-
const { kind } = message;
|
|
409
|
-
const schema = fromAgentSchemaByKind[kind];
|
|
410
|
-
if (!schema) {
|
|
411
|
-
return [`Unknown message kind: ${kind}`];
|
|
412
|
-
}
|
|
413
|
-
const result2 = schema.safeParse(message);
|
|
414
|
-
if (!result2.success) {
|
|
415
|
-
return result2.error.errors.map((e) => `${e.path.map((p) => p.toString()).join('.')} - ${e.message}`);
|
|
416
|
-
}
|
|
417
|
-
return [];
|
|
418
|
-
};
|
|
419
|
-
exports.getAgentMessageIssues = getAgentMessageIssues;
|
|
420
|
-
const isMessageFromAgent = (message) => {
|
|
421
|
-
if (typeof message !== 'object' || message === null) {
|
|
422
|
-
return false;
|
|
423
|
-
}
|
|
424
|
-
const headerResult = exports.sMessageHeader.safeParse(message);
|
|
425
|
-
if (!headerResult.success) {
|
|
426
|
-
return false;
|
|
427
|
-
}
|
|
428
|
-
const { kind } = message;
|
|
429
|
-
const schema = fromAgentSchemaByKind[kind];
|
|
430
|
-
if (!schema) {
|
|
431
|
-
return false;
|
|
432
|
-
}
|
|
433
|
-
const result = schema.safeParse(message);
|
|
434
|
-
return result.success;
|
|
435
|
-
};
|
|
436
|
-
exports.isMessageFromAgent = isMessageFromAgent;
|
package/dist/api/alarm.js
DELETED
package/dist/api/auth.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sLoginResponse = exports.sLoginByRefreshTokenRequest = exports.sLoginByCredentialsRequest = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.sLoginByCredentialsRequest = zod_1.z.object({
|
|
6
|
-
username: zod_1.z.string().nonempty('Username must not be empty'),
|
|
7
|
-
password: zod_1.z.string().nonempty('Password must not be empty'),
|
|
8
|
-
});
|
|
9
|
-
exports.sLoginByRefreshTokenRequest = zod_1.z.object({
|
|
10
|
-
refreshToken: zod_1.z.string().nonempty('Refresh token must not be empty'),
|
|
11
|
-
});
|
|
12
|
-
exports.sLoginResponse = zod_1.z.object({
|
|
13
|
-
accessToken: zod_1.z
|
|
14
|
-
.string()
|
|
15
|
-
.describe('Access token to be used for authentication with short expiry time. Apply this token in the Authorization header as a Bearer token.'),
|
|
16
|
-
refreshToken: zod_1.z
|
|
17
|
-
.string()
|
|
18
|
-
.describe('Refresh token to be used to obtain a new access token when the current one expires.'),
|
|
19
|
-
});
|
package/dist/api/media.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sGetLatestFrameRequest = exports.sMediaSearchQueryDto = exports.sSortOptions = exports.sGetObjectThumbnailRequest = exports.sGetObjectSnapshotRequest = exports.sGetScenePreviewClipRequest = exports.sGetPreviewImageRequest = exports.sGetRecordingsResponse = exports.sGetRecordingsRequest = exports.sRecordingSequence = exports.sCreateExportResponse = exports.sCreateExportRequest = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const query_1 = require("./query");
|
|
6
|
-
exports.sCreateExportRequest = zod_1.z.object({
|
|
7
|
-
name: zod_1.z.string().nonempty(),
|
|
8
|
-
deviceId: zod_1.z.string().nonempty(),
|
|
9
|
-
timeFrom: zod_1.z.number().nonnegative(),
|
|
10
|
-
timeTo: zod_1.z.number().nonnegative(),
|
|
11
|
-
});
|
|
12
|
-
exports.sCreateExportResponse = zod_1.z.object({
|
|
13
|
-
exportId: zod_1.z.string().nonempty(),
|
|
14
|
-
});
|
|
15
|
-
exports.sRecordingSequence = zod_1.z.object({
|
|
16
|
-
start: zod_1.z.number().nonnegative(),
|
|
17
|
-
end: zod_1.z.number().nonnegative(),
|
|
18
|
-
motion: zod_1.z.number().optional(),
|
|
19
|
-
objects: zod_1.z.number().optional(),
|
|
20
|
-
});
|
|
21
|
-
exports.sGetRecordingsRequest = zod_1.z.object({
|
|
22
|
-
deviceId: zod_1.z.string().nonempty(),
|
|
23
|
-
timeFrom: zod_1.z.number().nonnegative(),
|
|
24
|
-
timeTo: zod_1.z.number().nonnegative(),
|
|
25
|
-
});
|
|
26
|
-
exports.sGetRecordingsResponse = (0, query_1.sPaginatedQueryResponseOf)(exports.sRecordingSequence);
|
|
27
|
-
exports.sGetPreviewImageRequest = zod_1.z.object({
|
|
28
|
-
deviceId: zod_1.z.string().nonempty(),
|
|
29
|
-
time: zod_1.z.number().nonnegative(),
|
|
30
|
-
height: zod_1.z.number().nonnegative(),
|
|
31
|
-
});
|
|
32
|
-
exports.sGetScenePreviewClipRequest = zod_1.z.object({
|
|
33
|
-
deviceId: zod_1.z.string().nonempty(),
|
|
34
|
-
providerAssignedRef: zod_1.z.string().nonempty(),
|
|
35
|
-
});
|
|
36
|
-
exports.sGetObjectSnapshotRequest = zod_1.z.object({
|
|
37
|
-
deviceId: zod_1.z.string().nonempty(),
|
|
38
|
-
providerAssignedRef: zod_1.z.string().nonempty(),
|
|
39
|
-
crop: zod_1.z.boolean(),
|
|
40
|
-
boxes: zod_1.z.boolean(),
|
|
41
|
-
height: zod_1.z.number().nonnegative().optional(),
|
|
42
|
-
quality: zod_1.z.number().nonnegative().optional(),
|
|
43
|
-
});
|
|
44
|
-
exports.sGetObjectThumbnailRequest = zod_1.z.object({
|
|
45
|
-
deviceId: zod_1.z.string().nonempty(),
|
|
46
|
-
providerAssignedRef: zod_1.z.string().nonempty(),
|
|
47
|
-
});
|
|
48
|
-
exports.sSortOptions = zod_1.z.union([
|
|
49
|
-
zod_1.z.literal('time_asc'),
|
|
50
|
-
zod_1.z.literal('time_desc'),
|
|
51
|
-
]);
|
|
52
|
-
exports.sMediaSearchQueryDto = zod_1.z
|
|
53
|
-
.object({
|
|
54
|
-
limit: zod_1.z.number().nonnegative(),
|
|
55
|
-
q: zod_1.z.string(),
|
|
56
|
-
deviceId: zod_1.z.array(zod_1.z.string().nonempty()),
|
|
57
|
-
similarTo: zod_1.z.string().optional(),
|
|
58
|
-
label: zod_1.z.array(zod_1.z.string().nonempty()),
|
|
59
|
-
timeFrom: zod_1.z.number().nonnegative(),
|
|
60
|
-
timeTo: zod_1.z.number().nonnegative(),
|
|
61
|
-
sortBy: exports.sSortOptions,
|
|
62
|
-
})
|
|
63
|
-
.partial();
|
|
64
|
-
exports.sGetLatestFrameRequest = zod_1.z.object({
|
|
65
|
-
deviceId: zod_1.z.string().nonempty(),
|
|
66
|
-
width: zod_1.z.number().nonnegative(),
|
|
67
|
-
height: zod_1.z.number().nonnegative(),
|
|
68
|
-
});
|
package/dist/api-keys.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sApiKeyDto = exports.sRevokeApiKeyRequest = exports.sCreateApiKeyResponse = exports.sCreateApiKeyRequest = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.sCreateApiKeyRequest = zod_1.z.object({
|
|
6
|
-
displayName: zod_1.z.string().min(1).max(128),
|
|
7
|
-
});
|
|
8
|
-
exports.sCreateApiKeyResponse = zod_1.z.object({
|
|
9
|
-
id: zod_1.z.string().uuid(),
|
|
10
|
-
apiKey: zod_1.z.string().min(32).max(1024),
|
|
11
|
-
});
|
|
12
|
-
exports.sRevokeApiKeyRequest = zod_1.z.object({
|
|
13
|
-
id: zod_1.z.string().uuid(),
|
|
14
|
-
});
|
|
15
|
-
exports.sApiKeyDto = zod_1.z.object({
|
|
16
|
-
id: zod_1.z.string().uuid(),
|
|
17
|
-
displayName: zod_1.z.string().min(1).max(128),
|
|
18
|
-
prefix: zod_1.z.string().min(8).max(16),
|
|
19
|
-
createdOn: zod_1.z.string().datetime(),
|
|
20
|
-
lastModifiedOn: zod_1.z.string().datetime(),
|
|
21
|
-
});
|
package/dist/app.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sAppInfo = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.sAppInfo = zod_1.z.object({
|
|
6
|
-
version: zod_1.z.string(),
|
|
7
|
-
releaseDate: zod_1.z.string(),
|
|
8
|
-
serverDeviceId: zod_1.z.string(),
|
|
9
|
-
alarmDeviceId: zod_1.z.string(),
|
|
10
|
-
globalZoneId: zod_1.z.string(),
|
|
11
|
-
presenceTrackerId: zod_1.z.string(),
|
|
12
|
-
});
|
package/dist/automation.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sAutomationBulkMergeRequest = exports.sAutomationRuleDto = exports.sUpdateAutomationRule = exports.sAddAutomationRuleRequest = exports.sAutomationRuleProps = exports.sAutomationRuleBody = exports.sAutomationRuleCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.sAutomationRuleCommand = zod_1.z.object({
|
|
6
|
-
command: zod_1.z.string().nonempty().describe('The command to be executed'),
|
|
7
|
-
target: zod_1.z.string().nonempty().describe('The target of the command'),
|
|
8
|
-
params: zod_1.z
|
|
9
|
-
.record(zod_1.z.unknown())
|
|
10
|
-
.describe('The parameters of the command depending on what it is'),
|
|
11
|
-
});
|
|
12
|
-
exports.sAutomationRuleBody = zod_1.z.object({
|
|
13
|
-
onEvent: zod_1.z
|
|
14
|
-
.string()
|
|
15
|
-
.nonempty()
|
|
16
|
-
.describe('The event that triggers the automation rule'),
|
|
17
|
-
runIf: zod_1.z
|
|
18
|
-
.string()
|
|
19
|
-
.optional()
|
|
20
|
-
.describe('The condition under which the automation rule should run'),
|
|
21
|
-
commands: zod_1.z
|
|
22
|
-
.array(exports.sAutomationRuleCommand)
|
|
23
|
-
.describe('The commands to be executed by the automation rule'),
|
|
24
|
-
});
|
|
25
|
-
exports.sAutomationRuleProps = zod_1.z.object({
|
|
26
|
-
displayName: zod_1.z
|
|
27
|
-
.string()
|
|
28
|
-
.nonempty()
|
|
29
|
-
.describe('The name of the automation rule'),
|
|
30
|
-
description: zod_1.z
|
|
31
|
-
.string()
|
|
32
|
-
.optional()
|
|
33
|
-
.describe('A description of the automation rule'),
|
|
34
|
-
code: zod_1.z.string().nullable().describe('The code of the automation rule'),
|
|
35
|
-
body: exports.sAutomationRuleBody.describe('The body of the automation rule'),
|
|
36
|
-
enabled: zod_1.z.boolean().describe('Whether the automation rule is enabled'),
|
|
37
|
-
exclusivityGroup: zod_1.z
|
|
38
|
-
.string()
|
|
39
|
-
.nullable()
|
|
40
|
-
.describe('The exclusivity group of the automation rule. Only one matching rule at max will run within one group based on the highest score'),
|
|
41
|
-
score: zod_1.z.number().int().min(0).nullable(),
|
|
42
|
-
module: zod_1.z
|
|
43
|
-
.string()
|
|
44
|
-
.nullable()
|
|
45
|
-
.describe('The module the automation rule belongs to'),
|
|
46
|
-
metadata: zod_1.z.record(zod_1.z.unknown()),
|
|
47
|
-
});
|
|
48
|
-
exports.sAddAutomationRuleRequest = exports.sAutomationRuleProps;
|
|
49
|
-
exports.sUpdateAutomationRule = exports.sAutomationRuleProps.partial().merge(zod_1.z.object({
|
|
50
|
-
id: zod_1.z.string().describe('The ID of the automation rule'),
|
|
51
|
-
}));
|
|
52
|
-
exports.sAutomationRuleDto = exports.sAutomationRuleProps.merge(zod_1.z.object({
|
|
53
|
-
id: zod_1.z.string().describe('The ID of the automation rule'),
|
|
54
|
-
createdOn: zod_1.z.string().describe('The date the automation rule was created'),
|
|
55
|
-
lastModifiedOn: zod_1.z
|
|
56
|
-
.string()
|
|
57
|
-
.describe('The date the automation rule was last modified'),
|
|
58
|
-
}));
|
|
59
|
-
exports.sAutomationBulkMergeRequest = zod_1.z.object({
|
|
60
|
-
merge: zod_1.z
|
|
61
|
-
.array(exports.sAutomationRuleProps)
|
|
62
|
-
.describe('The automation rules to merge by code'),
|
|
63
|
-
removeCodes: zod_1.z
|
|
64
|
-
.array(zod_1.z.string())
|
|
65
|
-
.describe('The IDs of the automation rules to delete by code'),
|
|
66
|
-
});
|
package/dist/aware-config.js
DELETED
package/dist/bookmarks.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sBookmarkSearchCriteria = exports.sBookmarkDto = exports.sDeleteBookmarkRq = exports.sUpdateBookmarkRq = exports.sUpdateBookmarkBody = exports.sCreateBookmarkRq = exports.sBookmarkProps = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.sBookmarkProps = zod_1.z.object({
|
|
6
|
-
timestamp: zod_1.z.number().min(0),
|
|
7
|
-
label: zod_1.z.string().nonempty(),
|
|
8
|
-
deviceId: zod_1.z.string().nonempty(),
|
|
9
|
-
metadata: zod_1.z.record(zod_1.z.unknown()),
|
|
10
|
-
});
|
|
11
|
-
exports.sCreateBookmarkRq = exports.sBookmarkProps;
|
|
12
|
-
exports.sUpdateBookmarkBody = exports.sBookmarkProps.partial();
|
|
13
|
-
exports.sUpdateBookmarkRq = zod_1.z
|
|
14
|
-
.object({
|
|
15
|
-
id: zod_1.z.string().nonempty(),
|
|
16
|
-
})
|
|
17
|
-
.and(exports.sUpdateBookmarkBody);
|
|
18
|
-
exports.sDeleteBookmarkRq = zod_1.z.object({
|
|
19
|
-
id: zod_1.z.string().nonempty(),
|
|
20
|
-
});
|
|
21
|
-
exports.sBookmarkDto = exports.sBookmarkProps.and(zod_1.z.object({
|
|
22
|
-
id: zod_1.z.string().nonempty(),
|
|
23
|
-
createdBy: zod_1.z.string().nonempty(),
|
|
24
|
-
createdOn: zod_1.z.string().datetime(),
|
|
25
|
-
lastModifiedOn: zod_1.z.string().datetime(),
|
|
26
|
-
}));
|
|
27
|
-
exports.sBookmarkSearchCriteria = zod_1.z.object({
|
|
28
|
-
deviceId: zod_1.z.array(zod_1.z.string()),
|
|
29
|
-
createdBy: zod_1.z.array(zod_1.z.string()),
|
|
30
|
-
timeFrom: zod_1.z.number().min(0),
|
|
31
|
-
timeTo: zod_1.z.number().min(0),
|
|
32
|
-
});
|