@awarevue/api-types 2.0.22 → 2.0.24
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 +28 -0
- package/dist/objects/index.js +28 -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
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// EVENTS
|
|
3
|
+
export const sIoBoardInputChangedEvent = z.object({
|
|
4
|
+
kind: z.literal('io-board-input-changed'),
|
|
5
|
+
inputName: z.string().nonempty(),
|
|
6
|
+
value: z.boolean(),
|
|
7
|
+
});
|
|
8
|
+
export const ioBoardEventSchemaByKind = {
|
|
9
|
+
'io-board-input-changed': sIoBoardInputChangedEvent,
|
|
10
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// EVENTS
|
|
3
|
+
export const sExportStarted = z.object({
|
|
4
|
+
kind: z.literal('nvr-export-started'),
|
|
5
|
+
exportId: z
|
|
6
|
+
.string()
|
|
7
|
+
.nonempty()
|
|
8
|
+
.describe('The ID of the export, will be used to reference the export in future commands and queries'),
|
|
9
|
+
requestId: z.string().nonempty(),
|
|
10
|
+
});
|
|
11
|
+
export const sExportDeleted = z.object({
|
|
12
|
+
kind: z.literal('nvr-export-deleted'),
|
|
13
|
+
exportId: z.string().nonempty(),
|
|
14
|
+
});
|
|
15
|
+
export const nvrExporterEventSchemasByKind = {
|
|
16
|
+
'nvr-export-started': sExportStarted,
|
|
17
|
+
'nvr-export-deleted': sExportDeleted,
|
|
18
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { sPersonId } from '../../primitives';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
// EVENTS
|
|
4
|
+
export const sPersonIn = z.object({
|
|
5
|
+
kind: z.literal('person-in'),
|
|
6
|
+
personId: sPersonId,
|
|
7
|
+
personFirstName: z.string().nonempty(),
|
|
8
|
+
personLastName: z.string().nonempty(),
|
|
9
|
+
personAvatarId: z.string().nullable(),
|
|
10
|
+
personType: z.string().nonempty(),
|
|
11
|
+
personPosition: z.string().nullable(),
|
|
12
|
+
zoneId: z.string().nullable(),
|
|
13
|
+
securityChecked: z.boolean(),
|
|
14
|
+
});
|
|
15
|
+
export const sPersonOut = z.object({
|
|
16
|
+
kind: z.literal('person-out'),
|
|
17
|
+
personId: sPersonId,
|
|
18
|
+
personFirstName: z.string().nonempty(),
|
|
19
|
+
personLastName: z.string().nonempty(),
|
|
20
|
+
personAvatarId: z.string().nullable(),
|
|
21
|
+
personType: z.string().nonempty(),
|
|
22
|
+
personPosition: z.string().max(128).nullable(),
|
|
23
|
+
isLeave: z.boolean(),
|
|
24
|
+
zoneId: z.string().nullable(),
|
|
25
|
+
securityChecked: z.boolean(),
|
|
26
|
+
});
|
|
27
|
+
export const presenceTrackerEventSchemaByKind = {
|
|
28
|
+
'person-in': sPersonIn,
|
|
29
|
+
'person-out': sPersonOut,
|
|
30
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const sTokenAuthorized = z.object({
|
|
3
|
+
kind: z.literal('reader-auth'),
|
|
4
|
+
token: z.string().nullable(),
|
|
5
|
+
personId: z.string().optional(),
|
|
6
|
+
allowed: z.boolean(),
|
|
7
|
+
});
|
|
8
|
+
export const readerEventSchemaByKind = {
|
|
9
|
+
'reader-auth': sTokenAuthorized,
|
|
10
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { ObjectKinds } from '../../objects';
|
|
1
2
|
import { z } from 'zod';
|
|
2
|
-
import { ObjectKinds } from '../objects';
|
|
3
3
|
export declare const sAgentStarted: z.ZodObject<{
|
|
4
4
|
kind: z.ZodLiteral<"agent-started">;
|
|
5
5
|
agent: z.ZodString;
|
|
6
6
|
providers: z.ZodArray<z.ZodString, "many">;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
8
|
kind: "agent-started";
|
|
9
|
-
providers: string[];
|
|
10
9
|
agent: string;
|
|
10
|
+
providers: string[];
|
|
11
11
|
}, {
|
|
12
12
|
kind: "agent-started";
|
|
13
|
-
providers: string[];
|
|
14
13
|
agent: string;
|
|
14
|
+
providers: string[];
|
|
15
15
|
}>;
|
|
16
16
|
export declare const sAgentStopped: z.ZodObject<{
|
|
17
17
|
kind: z.ZodLiteral<"agent-stopped">;
|
|
@@ -19,12 +19,12 @@ export declare const sAgentStopped: z.ZodObject<{
|
|
|
19
19
|
providers: z.ZodArray<z.ZodString, "many">;
|
|
20
20
|
}, "strip", z.ZodTypeAny, {
|
|
21
21
|
kind: "agent-stopped";
|
|
22
|
-
providers: string[];
|
|
23
22
|
agent: string;
|
|
23
|
+
providers: string[];
|
|
24
24
|
}, {
|
|
25
25
|
kind: "agent-stopped";
|
|
26
|
-
providers: string[];
|
|
27
26
|
agent: string;
|
|
27
|
+
providers: string[];
|
|
28
28
|
}>;
|
|
29
29
|
export type AgentStarted = z.infer<typeof sAgentStarted>;
|
|
30
30
|
export type AgentStopped = z.infer<typeof sAgentStopped>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// EVENTS
|
|
3
|
+
export const sAgentStarted = z.object({
|
|
4
|
+
kind: z.literal('agent-started'),
|
|
5
|
+
agent: z.string(),
|
|
6
|
+
providers: z.array(z.string()),
|
|
7
|
+
});
|
|
8
|
+
export const sAgentStopped = z.object({
|
|
9
|
+
kind: z.literal('agent-stopped'),
|
|
10
|
+
agent: z.string(),
|
|
11
|
+
providers: z.array(z.string()),
|
|
12
|
+
});
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
1
|
+
export * from './error';
|
|
2
|
+
export * from './agent-protocol';
|
|
3
|
+
export * from './mqtt';
|
|
4
|
+
export * from './ws';
|
|
5
|
+
export * from './commands';
|
|
6
|
+
export * from './events';
|
|
7
|
+
export * from './queries';
|
|
8
|
+
export * from './rest';
|
|
9
|
+
export * from './state';
|
package/dist/api/index.js
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./alarm"), exports);
|
|
18
|
-
__exportStar(require("./auth"), exports);
|
|
19
|
-
__exportStar(require("./query"), exports);
|
|
20
|
-
__exportStar(require("./media"), exports);
|
|
1
|
+
export * from './error';
|
|
2
|
+
export * from './agent-protocol';
|
|
3
|
+
export * from './mqtt';
|
|
4
|
+
export * from './ws';
|
|
5
|
+
export * from './commands';
|
|
6
|
+
export * from './events';
|
|
7
|
+
export * from './queries';
|
|
8
|
+
export * from './rest';
|
|
9
|
+
export * from './state';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './payloads';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './payloads';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// MQTT Payloads for agent communication
|
|
3
|
+
export const sMqttInboundCommand = z.object({
|
|
4
|
+
command: z.string().nonempty(),
|
|
5
|
+
params: z.unknown().describe('Command data'),
|
|
6
|
+
});
|
|
7
|
+
export const sMqttInboundStateUpdate = z.object({
|
|
8
|
+
timestamp: z.number(),
|
|
9
|
+
mergeProps: z.record(z.string(), z.unknown()),
|
|
10
|
+
removeProps: z.array(z.string().nonempty()).optional(),
|
|
11
|
+
});
|
|
12
|
+
export const sMqttInboundEvent = z.object({
|
|
13
|
+
eventTimestamp: z
|
|
14
|
+
.number()
|
|
15
|
+
.describe('Event timestamp in milliseconds since epoch, as reported by origin'),
|
|
16
|
+
eventForeignRef: z.string().nonempty(),
|
|
17
|
+
event: z.unknown().describe('Event data'),
|
|
18
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { cameraRequestSchemas, cameraResponseSchemas, } from './camera';
|
|
3
|
+
import { nvrAnalyticsRequestSchemas, nvrAnalyticsResponseSchemas, } from './nvr-analytics-server';
|
|
4
|
+
import { nvrExporterRequestSchemas, nvrExporterResponseSchemas, } from './nvr-exporter';
|
|
5
|
+
import { nvrRecorderRequestSchemas, nvrRecorderResponseSchemas, } from './nvr-recorder';
|
|
6
|
+
// queries that apply to all devices
|
|
7
|
+
export const sEventCapsQueryArgs = z.object({});
|
|
8
|
+
export const QUERY_EVENT_CAPS = 'device:event-caps';
|
|
9
|
+
export const sEventCapsQueryResponse = z.array(z.string());
|
|
10
|
+
// Dictionary of request schemas by query type
|
|
11
|
+
export const requestSchemasByType = {
|
|
12
|
+
...nvrRecorderRequestSchemas,
|
|
13
|
+
...nvrExporterRequestSchemas,
|
|
14
|
+
...nvrAnalyticsRequestSchemas,
|
|
15
|
+
...cameraRequestSchemas,
|
|
16
|
+
[QUERY_EVENT_CAPS]: sEventCapsQueryArgs,
|
|
17
|
+
};
|
|
18
|
+
// Dictionary of response schemas by query type
|
|
19
|
+
export const responseSchemasByType = {
|
|
20
|
+
...nvrRecorderResponseSchemas,
|
|
21
|
+
...nvrExporterResponseSchemas,
|
|
22
|
+
...nvrAnalyticsResponseSchemas,
|
|
23
|
+
...cameraResponseSchemas,
|
|
24
|
+
[QUERY_EVENT_CAPS]: sEventCapsQueryResponse,
|
|
25
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// QUERIES
|
|
3
|
+
// -- RTSP DATA
|
|
4
|
+
export const QUERY_RTSP_DATA = 'cctv:rtsp-data';
|
|
5
|
+
export const sRtspDataArgs = z.object({});
|
|
6
|
+
export const sRtspDataResponse = z.object({
|
|
7
|
+
cameraName: z.string(),
|
|
8
|
+
username: z.string(),
|
|
9
|
+
password: z.string(),
|
|
10
|
+
streams: z.array(z.object({
|
|
11
|
+
streamId: z.string(),
|
|
12
|
+
displayName: z.string(),
|
|
13
|
+
resolution: z.string().nullable(),
|
|
14
|
+
rtspUrl: z.string(),
|
|
15
|
+
})),
|
|
16
|
+
});
|
|
17
|
+
// Dictionary of request schemas by query type
|
|
18
|
+
export const cameraRequestSchemas = {
|
|
19
|
+
[QUERY_RTSP_DATA]: sRtspDataArgs,
|
|
20
|
+
};
|
|
21
|
+
// Dictionary of response schemas by query type
|
|
22
|
+
export const cameraResponseSchemas = {
|
|
23
|
+
[QUERY_RTSP_DATA]: sRtspDataResponse,
|
|
24
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { sFileResponse } from '../../primitives';
|
|
3
|
+
import { sSortOptions } from '../rest/media';
|
|
4
|
+
// QUERIES
|
|
5
|
+
// -- Media Search
|
|
6
|
+
export const QUERY_MEDIA_SEARCH = 'cctv:media-search';
|
|
7
|
+
export const sMediaSearchArgs = z
|
|
8
|
+
.object({
|
|
9
|
+
devices: z.array(z.any()).optional(),
|
|
10
|
+
limit: z.number().nonnegative(),
|
|
11
|
+
q: z.string(),
|
|
12
|
+
similarTo: z.string().optional(),
|
|
13
|
+
label: z.array(z.string().nonempty()),
|
|
14
|
+
timeFrom: z.number().nonnegative(),
|
|
15
|
+
timeTo: z.number().nonnegative(),
|
|
16
|
+
sortBy: sSortOptions,
|
|
17
|
+
})
|
|
18
|
+
.partial();
|
|
19
|
+
export const sMediaSearchMatch = z.object({
|
|
20
|
+
relevance: z.number(),
|
|
21
|
+
providerAssignedRef: z.string(),
|
|
22
|
+
foreignRef: z.string(),
|
|
23
|
+
provider: z.string(),
|
|
24
|
+
probability: z.number(),
|
|
25
|
+
objectKind: z.string(),
|
|
26
|
+
startTime: z.number(),
|
|
27
|
+
endTime: z.number().nullable(),
|
|
28
|
+
});
|
|
29
|
+
export const sMediaSearchResponse = z.array(sMediaSearchMatch);
|
|
30
|
+
// -- Scene Preview Clip
|
|
31
|
+
export const QUERY_SCENE_PREVIEW_CLIP = 'cctv:scene-preview-clip';
|
|
32
|
+
export const sScenePreviewClipArgs = z.object({
|
|
33
|
+
providerAssignedRef: z.string(),
|
|
34
|
+
});
|
|
35
|
+
export const sScenePreviewClipResponse = sFileResponse;
|
|
36
|
+
// -- Object Snapshot
|
|
37
|
+
export const QUERY_OBJECT_SNAPSHOT = 'cctv:object-snapshot';
|
|
38
|
+
export const sObjectSnapshotArgs = z.object({
|
|
39
|
+
providerAssignedRef: z.string(),
|
|
40
|
+
height: z.number().optional(),
|
|
41
|
+
quality: z.number().optional(),
|
|
42
|
+
crop: z.boolean(),
|
|
43
|
+
boxes: z.boolean(),
|
|
44
|
+
});
|
|
45
|
+
export const sObjectSnapshotResponse = sFileResponse;
|
|
46
|
+
// -- Object Thumbnail
|
|
47
|
+
export const QUERY_OBJECT_THUMBNAIL = 'cctv:object-thumbnail';
|
|
48
|
+
export const sObjectThumbnailArgs = z.object({
|
|
49
|
+
providerAssignedRef: z.string(),
|
|
50
|
+
});
|
|
51
|
+
export const sObjectThumbnailResponse = sFileResponse;
|
|
52
|
+
// -- Object Labels
|
|
53
|
+
export const QUERY_OBJECT_LABELS = 'cctv:object-labels';
|
|
54
|
+
// (No args or response schema defined for this query in the provided code)
|
|
55
|
+
export const sObjectLabelsArgs = z.object({});
|
|
56
|
+
export const sObjectLabelResponse = z.array(z.string());
|
|
57
|
+
// SCHEMA DICTIONARIES AND TYPE MAPS
|
|
58
|
+
// Dictionary of request schemas by query type
|
|
59
|
+
export const nvrAnalyticsRequestSchemas = {
|
|
60
|
+
[QUERY_MEDIA_SEARCH]: sMediaSearchArgs,
|
|
61
|
+
[QUERY_SCENE_PREVIEW_CLIP]: sScenePreviewClipArgs,
|
|
62
|
+
[QUERY_OBJECT_SNAPSHOT]: sObjectSnapshotArgs,
|
|
63
|
+
[QUERY_OBJECT_THUMBNAIL]: sObjectThumbnailArgs,
|
|
64
|
+
[QUERY_OBJECT_LABELS]: sObjectLabelsArgs,
|
|
65
|
+
};
|
|
66
|
+
// Dictionary of response schemas by query type
|
|
67
|
+
export const nvrAnalyticsResponseSchemas = {
|
|
68
|
+
[QUERY_MEDIA_SEARCH]: sMediaSearchResponse,
|
|
69
|
+
[QUERY_SCENE_PREVIEW_CLIP]: sScenePreviewClipResponse,
|
|
70
|
+
[QUERY_OBJECT_SNAPSHOT]: sObjectSnapshotResponse,
|
|
71
|
+
[QUERY_OBJECT_THUMBNAIL]: sObjectThumbnailResponse,
|
|
72
|
+
[QUERY_OBJECT_LABELS]: sObjectLabelResponse,
|
|
73
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// QUERIES
|
|
3
|
+
// -- Get Export Link
|
|
4
|
+
export const QUERY_GET_EXPORT_LINK = 'cctv:get-export-link';
|
|
5
|
+
export const sGetExportLinkArgs = z.object({
|
|
6
|
+
exportId: z.string().nonempty(),
|
|
7
|
+
});
|
|
8
|
+
export const sGetExportLinkResponse = z.object({
|
|
9
|
+
exportLink: z.string().url(),
|
|
10
|
+
});
|
|
11
|
+
// -- Get Exports
|
|
12
|
+
export const QUERY_GET_EXPORTS = 'cctv:get-exports';
|
|
13
|
+
export const sGetExportsArgs = z.object({});
|
|
14
|
+
export const sExportItem = z.object({
|
|
15
|
+
name: z.string().nonempty(),
|
|
16
|
+
endTime: z.number().int().nonnegative(),
|
|
17
|
+
startTime: z.number().int().nonnegative(),
|
|
18
|
+
id: z.string().nonempty(),
|
|
19
|
+
status: z.string().nonempty(),
|
|
20
|
+
size: z.string().nonempty().optional(),
|
|
21
|
+
expires: z.number().int().nonnegative().optional(),
|
|
22
|
+
});
|
|
23
|
+
export const sGetExportsResponse = z.array(sExportItem);
|
|
24
|
+
// Dictionary of request schemas by query type
|
|
25
|
+
export const nvrExporterRequestSchemas = {
|
|
26
|
+
[QUERY_GET_EXPORT_LINK]: sGetExportLinkArgs,
|
|
27
|
+
[QUERY_GET_EXPORTS]: sGetExportsArgs,
|
|
28
|
+
};
|
|
29
|
+
// Dictionary of response schemas by query type
|
|
30
|
+
export const nvrExporterResponseSchemas = {
|
|
31
|
+
[QUERY_GET_EXPORT_LINK]: sGetExportLinkResponse,
|
|
32
|
+
[QUERY_GET_EXPORTS]: sGetExportsResponse,
|
|
33
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { sDeviceParam, sFileResponse } from '../../primitives';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { sRecordingSequence } from '../rest/media';
|
|
4
|
+
// QUERIES
|
|
5
|
+
// -- Recordings by Time Range
|
|
6
|
+
export const QUERY_RECORDINGS_BY_TIME_RANGE = 'cctv:recordings-by-time-range';
|
|
7
|
+
export const sRecordingsByTimeRangeArgs = z.object({
|
|
8
|
+
device: sDeviceParam,
|
|
9
|
+
timeFrom: z.number(),
|
|
10
|
+
timeTo: z.number(),
|
|
11
|
+
});
|
|
12
|
+
export const sRecordingsResponse = z.array(sRecordingSequence);
|
|
13
|
+
// -- Preview Image
|
|
14
|
+
export const QUERY_PREVIEW_IMAGE = 'cctv:preview-image';
|
|
15
|
+
export const sPreviewImageArgs = z.object({
|
|
16
|
+
device: sDeviceParam,
|
|
17
|
+
time: z.number(),
|
|
18
|
+
height: z.number(),
|
|
19
|
+
});
|
|
20
|
+
export const sPreviewImageResponse = sFileResponse;
|
|
21
|
+
// -- Camera Latest Frame
|
|
22
|
+
export const QUERY_CAMERA_LATEST_FRAME = 'cctv:latest-frame';
|
|
23
|
+
export const sCameraLatestFrameArgs = z.object({
|
|
24
|
+
device: sDeviceParam,
|
|
25
|
+
width: z.number(),
|
|
26
|
+
height: z.number(),
|
|
27
|
+
});
|
|
28
|
+
export const sCameraLatestFrameResponse = sFileResponse;
|
|
29
|
+
export const nvrRecorderRequestSchemas = {
|
|
30
|
+
[QUERY_RECORDINGS_BY_TIME_RANGE]: sRecordingsByTimeRangeArgs,
|
|
31
|
+
[QUERY_PREVIEW_IMAGE]: sPreviewImageArgs,
|
|
32
|
+
[QUERY_CAMERA_LATEST_FRAME]: sCameraLatestFrameArgs,
|
|
33
|
+
};
|
|
34
|
+
// Dictionary of response schemas by query type
|
|
35
|
+
export const nvrRecorderResponseSchemas = {
|
|
36
|
+
[QUERY_RECORDINGS_BY_TIME_RANGE]: sRecordingsResponse,
|
|
37
|
+
[QUERY_PREVIEW_IMAGE]: sPreviewImageResponse,
|
|
38
|
+
[QUERY_CAMERA_LATEST_FRAME]: sCameraLatestFrameResponse,
|
|
39
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export declare const sCreateAccessRuleRequest: z.ZodObject<{
|
|
3
|
+
displayName: z.ZodString;
|
|
4
|
+
appliedTo: z.ZodArray<z.ZodString, "many">;
|
|
5
|
+
permissions: z.ZodArray<z.ZodObject<{
|
|
6
|
+
deviceId: z.ZodString;
|
|
7
|
+
scheduleId: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
deviceId: string;
|
|
10
|
+
scheduleId: string;
|
|
11
|
+
}, {
|
|
12
|
+
deviceId: string;
|
|
13
|
+
scheduleId: string;
|
|
14
|
+
}>, "many">;
|
|
15
|
+
groupPermissions: z.ZodArray<z.ZodObject<{
|
|
16
|
+
groupId: z.ZodString;
|
|
17
|
+
scheduleId: z.ZodString;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
scheduleId: string;
|
|
20
|
+
groupId: string;
|
|
21
|
+
}, {
|
|
22
|
+
scheduleId: string;
|
|
23
|
+
groupId: string;
|
|
24
|
+
}>, "many">;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
displayName: string;
|
|
27
|
+
appliedTo: string[];
|
|
28
|
+
permissions: {
|
|
29
|
+
deviceId: string;
|
|
30
|
+
scheduleId: string;
|
|
31
|
+
}[];
|
|
32
|
+
groupPermissions: {
|
|
33
|
+
scheduleId: string;
|
|
34
|
+
groupId: string;
|
|
35
|
+
}[];
|
|
36
|
+
}, {
|
|
37
|
+
displayName: string;
|
|
38
|
+
appliedTo: string[];
|
|
39
|
+
permissions: {
|
|
40
|
+
deviceId: string;
|
|
41
|
+
scheduleId: string;
|
|
42
|
+
}[];
|
|
43
|
+
groupPermissions: {
|
|
44
|
+
scheduleId: string;
|
|
45
|
+
groupId: string;
|
|
46
|
+
}[];
|
|
47
|
+
}>;
|
|
48
|
+
export declare const sUpdateAccessRuleRequest: z.ZodObject<{
|
|
49
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
50
|
+
appliedTo: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
51
|
+
permissions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
52
|
+
deviceId: z.ZodString;
|
|
53
|
+
scheduleId: z.ZodString;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
deviceId: string;
|
|
56
|
+
scheduleId: string;
|
|
57
|
+
}, {
|
|
58
|
+
deviceId: string;
|
|
59
|
+
scheduleId: string;
|
|
60
|
+
}>, "many">>;
|
|
61
|
+
groupPermissions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
62
|
+
groupId: z.ZodString;
|
|
63
|
+
scheduleId: z.ZodString;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
scheduleId: string;
|
|
66
|
+
groupId: string;
|
|
67
|
+
}, {
|
|
68
|
+
scheduleId: string;
|
|
69
|
+
groupId: string;
|
|
70
|
+
}>, "many">>;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
displayName?: string | undefined;
|
|
73
|
+
appliedTo?: string[] | undefined;
|
|
74
|
+
permissions?: {
|
|
75
|
+
deviceId: string;
|
|
76
|
+
scheduleId: string;
|
|
77
|
+
}[] | undefined;
|
|
78
|
+
groupPermissions?: {
|
|
79
|
+
scheduleId: string;
|
|
80
|
+
groupId: string;
|
|
81
|
+
}[] | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
displayName?: string | undefined;
|
|
84
|
+
appliedTo?: string[] | undefined;
|
|
85
|
+
permissions?: {
|
|
86
|
+
deviceId: string;
|
|
87
|
+
scheduleId: string;
|
|
88
|
+
}[] | undefined;
|
|
89
|
+
groupPermissions?: {
|
|
90
|
+
scheduleId: string;
|
|
91
|
+
groupId: string;
|
|
92
|
+
}[] | undefined;
|
|
93
|
+
}>;
|
|
94
|
+
export declare const sAddMemberToAccessRuleRequest: z.ZodObject<{
|
|
95
|
+
personId: z.ZodString;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
personId: string;
|
|
98
|
+
}, {
|
|
99
|
+
personId: string;
|
|
100
|
+
}>;
|
|
101
|
+
export declare const sRemoveMemberFromAccessRuleRequest: z.ZodObject<{
|
|
102
|
+
personId: z.ZodString;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
personId: string;
|
|
105
|
+
}, {
|
|
106
|
+
personId: string;
|
|
107
|
+
}>;
|
|
108
|
+
export type CreateAccessRuleRequest = z.infer<typeof sCreateAccessRuleRequest>;
|
|
109
|
+
export type UpdateAccessRuleRequest = {
|
|
110
|
+
id: string;
|
|
111
|
+
} & z.infer<typeof sUpdateAccessRuleRequest>;
|
|
112
|
+
export type AddMemberToAccessRuleRequest = {
|
|
113
|
+
id: string;
|
|
114
|
+
} & z.infer<typeof sAddMemberToAccessRuleRequest>;
|
|
115
|
+
export type RemoveMemberFromAccessRuleRequest = {
|
|
116
|
+
id: string;
|
|
117
|
+
} & z.infer<typeof sRemoveMemberFromAccessRuleRequest>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { sAccessRuleProps } from '../../objects/access-rule';
|
|
2
|
+
import z from 'zod';
|
|
3
|
+
export const sCreateAccessRuleRequest = sAccessRuleProps;
|
|
4
|
+
export const sUpdateAccessRuleRequest = sCreateAccessRuleRequest.partial();
|
|
5
|
+
export const sAddMemberToAccessRuleRequest = z.object({
|
|
6
|
+
personId: z.string().nonempty().describe('Person ID'),
|
|
7
|
+
});
|
|
8
|
+
export const sRemoveMemberFromAccessRuleRequest = z.object({
|
|
9
|
+
personId: z.string().nonempty().describe('Person ID'),
|
|
10
|
+
});
|
|
@@ -1,23 +1,4 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
export declare const sAgreementDto: z.ZodObject<{
|
|
3
|
-
id: z.ZodString;
|
|
4
|
-
displayName: z.ZodString;
|
|
5
|
-
content: z.ZodString;
|
|
6
|
-
createdOn: z.ZodString;
|
|
7
|
-
lastModifiedOn: z.ZodString;
|
|
8
|
-
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
id: string;
|
|
10
|
-
content: string;
|
|
11
|
-
displayName: string;
|
|
12
|
-
createdOn: string;
|
|
13
|
-
lastModifiedOn: string;
|
|
14
|
-
}, {
|
|
15
|
-
id: string;
|
|
16
|
-
content: string;
|
|
17
|
-
displayName: string;
|
|
18
|
-
createdOn: string;
|
|
19
|
-
lastModifiedOn: string;
|
|
20
|
-
}>;
|
|
21
2
|
export declare const sCreateAgreementRequest: z.ZodObject<Omit<{
|
|
22
3
|
id: z.ZodString;
|
|
23
4
|
displayName: z.ZodString;
|
|
@@ -31,7 +12,6 @@ export declare const sCreateAgreementRequest: z.ZodObject<Omit<{
|
|
|
31
12
|
content: string;
|
|
32
13
|
displayName: string;
|
|
33
14
|
}>;
|
|
34
|
-
export type AgreementDto = z.infer<typeof sAgreementDto>;
|
|
35
15
|
export type CreateAgreementRequest = z.infer<typeof sCreateAgreementRequest>;
|
|
36
16
|
export declare const sUpdateAgreementRequest: z.ZodObject<{
|
|
37
17
|
content: z.ZodOptional<z.ZodString>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -23,26 +23,6 @@ export declare const sRevokeApiKeyRequest: z.ZodObject<{
|
|
|
23
23
|
}, {
|
|
24
24
|
id: string;
|
|
25
25
|
}>;
|
|
26
|
-
export declare const sApiKeyDto: z.ZodObject<{
|
|
27
|
-
id: z.ZodString;
|
|
28
|
-
displayName: z.ZodString;
|
|
29
|
-
prefix: z.ZodString;
|
|
30
|
-
createdOn: z.ZodString;
|
|
31
|
-
lastModifiedOn: z.ZodString;
|
|
32
|
-
}, "strip", z.ZodTypeAny, {
|
|
33
|
-
id: string;
|
|
34
|
-
prefix: string;
|
|
35
|
-
displayName: string;
|
|
36
|
-
createdOn: string;
|
|
37
|
-
lastModifiedOn: string;
|
|
38
|
-
}, {
|
|
39
|
-
id: string;
|
|
40
|
-
prefix: string;
|
|
41
|
-
displayName: string;
|
|
42
|
-
createdOn: string;
|
|
43
|
-
lastModifiedOn: string;
|
|
44
|
-
}>;
|
|
45
26
|
export type CreateApiKeyRequest = z.infer<typeof sCreateApiKeyRequest>;
|
|
46
27
|
export type CreateApiKeyResponse = z.infer<typeof sCreateApiKeyResponse>;
|
|
47
28
|
export type RevokeApiKeyRequest = z.infer<typeof sRevokeApiKeyRequest>;
|
|
48
|
-
export type ApiKeyDto = z.infer<typeof sApiKeyDto>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const sCreateApiKeyRequest = z.object({
|
|
3
|
+
displayName: z.string().min(1).max(128),
|
|
4
|
+
});
|
|
5
|
+
export const sCreateApiKeyResponse = z.object({
|
|
6
|
+
id: z.string().uuid(),
|
|
7
|
+
apiKey: z.string().min(32).max(1024),
|
|
8
|
+
});
|
|
9
|
+
export const sRevokeApiKeyRequest = z.object({
|
|
10
|
+
id: z.string().uuid(),
|
|
11
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const sLoginByCredentialsRequest = z.object({
|
|
3
|
+
username: z.string().nonempty('Username must not be empty'),
|
|
4
|
+
password: z.string().nonempty('Password must not be empty'),
|
|
5
|
+
});
|
|
6
|
+
export const sLoginByRefreshTokenRequest = z.object({
|
|
7
|
+
refreshToken: z.string().nonempty('Refresh token must not be empty'),
|
|
8
|
+
});
|
|
9
|
+
export const sLoginResponse = z.object({
|
|
10
|
+
accessToken: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe('Access token to be used for authentication with short expiry time. Apply this token in the Authorization header as a Bearer token.'),
|
|
13
|
+
refreshToken: z
|
|
14
|
+
.string()
|
|
15
|
+
.describe('Refresh token to be used to obtain a new access token when the current one expires.'),
|
|
16
|
+
});
|