@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,192 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const sUiOrderHint: z.ZodObject<{
|
|
3
|
+
kind: z.ZodLiteral<"order">;
|
|
4
|
+
path: z.ZodString;
|
|
5
|
+
fields: z.ZodArray<z.ZodString, "many">;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
path: string;
|
|
8
|
+
kind: "order";
|
|
9
|
+
fields: string[];
|
|
10
|
+
}, {
|
|
11
|
+
path: string;
|
|
12
|
+
kind: "order";
|
|
13
|
+
fields: string[];
|
|
14
|
+
}>;
|
|
15
|
+
export declare const sUiWidgetHint: z.ZodObject<{
|
|
16
|
+
kind: z.ZodLiteral<"widget">;
|
|
17
|
+
path: z.ZodString;
|
|
18
|
+
spanColumns: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
password: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
placeHolder: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
path: string;
|
|
23
|
+
kind: "widget";
|
|
24
|
+
spanColumns?: number | undefined;
|
|
25
|
+
password?: boolean | undefined;
|
|
26
|
+
placeHolder?: string | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
path: string;
|
|
29
|
+
kind: "widget";
|
|
30
|
+
spanColumns?: number | undefined;
|
|
31
|
+
password?: boolean | undefined;
|
|
32
|
+
placeHolder?: string | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const sUiHint: z.ZodUnion<[z.ZodObject<{
|
|
35
|
+
kind: z.ZodLiteral<"order">;
|
|
36
|
+
path: z.ZodString;
|
|
37
|
+
fields: z.ZodArray<z.ZodString, "many">;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
path: string;
|
|
40
|
+
kind: "order";
|
|
41
|
+
fields: string[];
|
|
42
|
+
}, {
|
|
43
|
+
path: string;
|
|
44
|
+
kind: "order";
|
|
45
|
+
fields: string[];
|
|
46
|
+
}>, z.ZodObject<{
|
|
47
|
+
kind: z.ZodLiteral<"widget">;
|
|
48
|
+
path: z.ZodString;
|
|
49
|
+
spanColumns: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
password: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
placeHolder: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
path: string;
|
|
54
|
+
kind: "widget";
|
|
55
|
+
spanColumns?: number | undefined;
|
|
56
|
+
password?: boolean | undefined;
|
|
57
|
+
placeHolder?: string | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
path: string;
|
|
60
|
+
kind: "widget";
|
|
61
|
+
spanColumns?: number | undefined;
|
|
62
|
+
password?: boolean | undefined;
|
|
63
|
+
placeHolder?: string | undefined;
|
|
64
|
+
}>]>;
|
|
65
|
+
export declare const sProviderSpecs: z.ZodObject<{
|
|
66
|
+
title: z.ZodString;
|
|
67
|
+
configSchema: z.ZodUnknown;
|
|
68
|
+
configDefault: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
69
|
+
configFormUiHints: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
70
|
+
kind: z.ZodLiteral<"order">;
|
|
71
|
+
path: z.ZodString;
|
|
72
|
+
fields: z.ZodArray<z.ZodString, "many">;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
path: string;
|
|
75
|
+
kind: "order";
|
|
76
|
+
fields: string[];
|
|
77
|
+
}, {
|
|
78
|
+
path: string;
|
|
79
|
+
kind: "order";
|
|
80
|
+
fields: string[];
|
|
81
|
+
}>, z.ZodObject<{
|
|
82
|
+
kind: z.ZodLiteral<"widget">;
|
|
83
|
+
path: z.ZodString;
|
|
84
|
+
spanColumns: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
password: z.ZodOptional<z.ZodBoolean>;
|
|
86
|
+
placeHolder: z.ZodOptional<z.ZodString>;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
path: string;
|
|
89
|
+
kind: "widget";
|
|
90
|
+
spanColumns?: number | undefined;
|
|
91
|
+
password?: boolean | undefined;
|
|
92
|
+
placeHolder?: string | undefined;
|
|
93
|
+
}, {
|
|
94
|
+
path: string;
|
|
95
|
+
kind: "widget";
|
|
96
|
+
spanColumns?: number | undefined;
|
|
97
|
+
password?: boolean | undefined;
|
|
98
|
+
placeHolder?: string | undefined;
|
|
99
|
+
}>]>, "many">>;
|
|
100
|
+
}, "strip", z.ZodTypeAny, {
|
|
101
|
+
title: string;
|
|
102
|
+
configDefault: Record<string, unknown>;
|
|
103
|
+
configSchema?: unknown;
|
|
104
|
+
configFormUiHints?: ({
|
|
105
|
+
path: string;
|
|
106
|
+
kind: "order";
|
|
107
|
+
fields: string[];
|
|
108
|
+
} | {
|
|
109
|
+
path: string;
|
|
110
|
+
kind: "widget";
|
|
111
|
+
spanColumns?: number | undefined;
|
|
112
|
+
password?: boolean | undefined;
|
|
113
|
+
placeHolder?: string | undefined;
|
|
114
|
+
})[] | undefined;
|
|
115
|
+
}, {
|
|
116
|
+
title: string;
|
|
117
|
+
configDefault: Record<string, unknown>;
|
|
118
|
+
configSchema?: unknown;
|
|
119
|
+
configFormUiHints?: ({
|
|
120
|
+
path: string;
|
|
121
|
+
kind: "order";
|
|
122
|
+
fields: string[];
|
|
123
|
+
} | {
|
|
124
|
+
path: string;
|
|
125
|
+
kind: "widget";
|
|
126
|
+
spanColumns?: number | undefined;
|
|
127
|
+
password?: boolean | undefined;
|
|
128
|
+
placeHolder?: string | undefined;
|
|
129
|
+
})[] | undefined;
|
|
130
|
+
}>;
|
|
131
|
+
export declare const sAccessObjectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
132
|
+
export declare const sTokenSpecs: z.ZodObject<{
|
|
133
|
+
type: z.ZodEnum<["card", "pin", "fingerprint"]>;
|
|
134
|
+
regex: z.ZodOptional<z.ZodString>;
|
|
135
|
+
formatDescription: z.ZodOptional<z.ZodString>;
|
|
136
|
+
maxPerPerson: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
type: "card" | "pin" | "fingerprint";
|
|
139
|
+
regex?: string | undefined;
|
|
140
|
+
formatDescription?: string | undefined;
|
|
141
|
+
maxPerPerson?: number | undefined;
|
|
142
|
+
}, {
|
|
143
|
+
type: "card" | "pin" | "fingerprint";
|
|
144
|
+
regex?: string | undefined;
|
|
145
|
+
formatDescription?: string | undefined;
|
|
146
|
+
maxPerPerson?: number | undefined;
|
|
147
|
+
}>;
|
|
148
|
+
export declare const sAccessControlCapabilityReport: z.ZodObject<{
|
|
149
|
+
tokens: z.ZodArray<z.ZodObject<{
|
|
150
|
+
type: z.ZodEnum<["card", "pin", "fingerprint"]>;
|
|
151
|
+
regex: z.ZodOptional<z.ZodString>;
|
|
152
|
+
formatDescription: z.ZodOptional<z.ZodString>;
|
|
153
|
+
maxPerPerson: z.ZodOptional<z.ZodNumber>;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
type: "card" | "pin" | "fingerprint";
|
|
156
|
+
regex?: string | undefined;
|
|
157
|
+
formatDescription?: string | undefined;
|
|
158
|
+
maxPerPerson?: number | undefined;
|
|
159
|
+
}, {
|
|
160
|
+
type: "card" | "pin" | "fingerprint";
|
|
161
|
+
regex?: string | undefined;
|
|
162
|
+
formatDescription?: string | undefined;
|
|
163
|
+
maxPerPerson?: number | undefined;
|
|
164
|
+
}>, "many">;
|
|
165
|
+
accessObjects: z.ZodArray<z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>, "many">;
|
|
166
|
+
oneSchedulePerDoor: z.ZodBoolean;
|
|
167
|
+
}, "strip", z.ZodTypeAny, {
|
|
168
|
+
tokens: {
|
|
169
|
+
type: "card" | "pin" | "fingerprint";
|
|
170
|
+
regex?: string | undefined;
|
|
171
|
+
formatDescription?: string | undefined;
|
|
172
|
+
maxPerPerson?: number | undefined;
|
|
173
|
+
}[];
|
|
174
|
+
accessObjects: ("person" | "zone" | "schedule" | "device" | "accessRule")[];
|
|
175
|
+
oneSchedulePerDoor: boolean;
|
|
176
|
+
}, {
|
|
177
|
+
tokens: {
|
|
178
|
+
type: "card" | "pin" | "fingerprint";
|
|
179
|
+
regex?: string | undefined;
|
|
180
|
+
formatDescription?: string | undefined;
|
|
181
|
+
maxPerPerson?: number | undefined;
|
|
182
|
+
}[];
|
|
183
|
+
accessObjects: ("person" | "zone" | "schedule" | "device" | "accessRule")[];
|
|
184
|
+
oneSchedulePerDoor: boolean;
|
|
185
|
+
}>;
|
|
186
|
+
export type AccessControlCapabilityReport = z.infer<typeof sAccessControlCapabilityReport>;
|
|
187
|
+
export type AccessTokenSpecs = z.infer<typeof sTokenSpecs>;
|
|
188
|
+
export type AccessObjectKind = z.infer<typeof sAccessObjectKind>;
|
|
189
|
+
export type UiHint = z.infer<typeof sUiHint>;
|
|
190
|
+
export type UiOrderHint = z.infer<typeof sUiOrderHint>;
|
|
191
|
+
export type UiWidgetHint = z.infer<typeof sUiWidgetHint>;
|
|
192
|
+
export type ProviderSpecs = z.infer<typeof sProviderSpecs>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { sCredentialType } from './credential';
|
|
3
|
+
export const sUiOrderHint = z.object({
|
|
4
|
+
kind: z.literal('order'),
|
|
5
|
+
path: z.string(),
|
|
6
|
+
fields: z.array(z.string().nonempty()),
|
|
7
|
+
});
|
|
8
|
+
export const sUiWidgetHint = z.object({
|
|
9
|
+
kind: z.literal('widget'),
|
|
10
|
+
path: z.string(),
|
|
11
|
+
spanColumns: z.number().optional(),
|
|
12
|
+
password: z.boolean().optional(),
|
|
13
|
+
placeHolder: z.string().optional(),
|
|
14
|
+
});
|
|
15
|
+
export const sUiHint = z.union([sUiOrderHint, sUiWidgetHint]);
|
|
16
|
+
export const sProviderSpecs = z.object({
|
|
17
|
+
title: z
|
|
18
|
+
.string()
|
|
19
|
+
.nonempty()
|
|
20
|
+
.describe('a human-readable name for the provider'),
|
|
21
|
+
configSchema: z
|
|
22
|
+
.unknown()
|
|
23
|
+
.describe('a valid JSON schema that describes provider config data structure'), // We can use AJV to validate the definition of a JSON schema
|
|
24
|
+
configDefault: z
|
|
25
|
+
.record(z.unknown())
|
|
26
|
+
.describe('Default initialized values for configuration'),
|
|
27
|
+
configFormUiHints: z
|
|
28
|
+
.array(sUiHint)
|
|
29
|
+
.optional()
|
|
30
|
+
.describe('UI hints for configuration form visuals'),
|
|
31
|
+
});
|
|
32
|
+
export const sAccessObjectKind = z.enum([
|
|
33
|
+
'accessRule',
|
|
34
|
+
'schedule',
|
|
35
|
+
'person',
|
|
36
|
+
'device',
|
|
37
|
+
'zone',
|
|
38
|
+
]);
|
|
39
|
+
export const sTokenSpecs = z.object({
|
|
40
|
+
type: sCredentialType, // etc, those map to a AWARE-standardized set of token types
|
|
41
|
+
regex: z.string().optional(),
|
|
42
|
+
formatDescription: z.string().optional(),
|
|
43
|
+
maxPerPerson: z.number().optional(),
|
|
44
|
+
});
|
|
45
|
+
export const sAccessControlCapabilityReport = z.object({
|
|
46
|
+
tokens: z.array(sTokenSpecs),
|
|
47
|
+
accessObjects: z.array(sAccessObjectKind),
|
|
48
|
+
oneSchedulePerDoor: z.boolean(),
|
|
49
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
export type AgreementDto = z.infer<typeof sAgreementDto>;
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import { AutomationRuleDto, AutomationRuleProps } from './automation';
|
|
4
|
-
import { BookmarkDto } from './bookmarks';
|
|
2
|
+
import { LayoutDto } from './layout';
|
|
5
3
|
import { DeviceDto } from './device';
|
|
4
|
+
import { AccessRuleDto, AccessRuleProps } from './access-rule';
|
|
5
|
+
import { AgreementDto } from './agreement';
|
|
6
|
+
import { ApiKeyDto } from './api-key';
|
|
7
|
+
import { AutomationRuleDto, AutomationRuleProps } from './automation-rule';
|
|
8
|
+
import { BookmarkDto } from './bookmark';
|
|
6
9
|
import { DeviceGroupDto } from './device-group';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
10
|
+
import { MacroDto } from './macro';
|
|
11
|
+
import { PersonDto, PersonProps } from './person';
|
|
12
|
+
import { PersonPresenceDto } from './person-presence';
|
|
13
|
+
import { PersonTypeDto } from './person-type';
|
|
14
|
+
import { RoleDto } from './role';
|
|
15
|
+
import { ScheduleDto, ScheduleProps } from './schedule';
|
|
9
16
|
import { SecurityLevelDto } from './security-level';
|
|
10
|
-
import {
|
|
17
|
+
import { UserDto } from './user';
|
|
11
18
|
import { ViewDto } from './view';
|
|
12
|
-
import {
|
|
19
|
+
import { ZoneDto, ZoneProps } from './zone';
|
|
13
20
|
export declare const sObjectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role", "user", "securityLevel", "bookmark", "personType", "agreement", "apiKey"]>;
|
|
14
21
|
export type ObjectKind = z.infer<typeof sObjectKind>;
|
|
15
22
|
export type ObjectKinds = {
|
|
@@ -34,10 +41,10 @@ export type ObjectKinds = {
|
|
|
34
41
|
};
|
|
35
42
|
export type ObjectDto = ObjectKinds;
|
|
36
43
|
export type ObjectProps = {
|
|
37
|
-
person:
|
|
38
|
-
schedule:
|
|
39
|
-
zone:
|
|
40
|
-
accessRule:
|
|
44
|
+
person: PersonProps;
|
|
45
|
+
schedule: ScheduleProps;
|
|
46
|
+
zone: ZoneProps;
|
|
47
|
+
accessRule: AccessRuleProps;
|
|
41
48
|
automationRule: AutomationRuleProps;
|
|
42
49
|
};
|
|
43
50
|
export declare const objectLabels: Record<string, string>;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.objectKinds = exports.objectLabels = exports.sObjectKind = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.sObjectKind = zod_1.z.enum([
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const sObjectKind = z.enum([
|
|
6
3
|
'accessRule',
|
|
7
4
|
'schedule',
|
|
8
5
|
'person',
|
|
@@ -22,7 +19,7 @@ exports.sObjectKind = zod_1.z.enum([
|
|
|
22
19
|
'agreement',
|
|
23
20
|
'apiKey',
|
|
24
21
|
]);
|
|
25
|
-
|
|
22
|
+
export const objectLabels = {
|
|
26
23
|
accessRule: 'Access Rule',
|
|
27
24
|
schedule: 'Schedule',
|
|
28
25
|
person: 'Person',
|
|
@@ -42,4 +39,4 @@ exports.objectLabels = {
|
|
|
42
39
|
agreement: 'Agreement',
|
|
43
40
|
apiKey: 'API Key',
|
|
44
41
|
};
|
|
45
|
-
|
|
42
|
+
export const objectKinds = sObjectKind.options;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const sApiKeyDto: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
displayName: z.ZodString;
|
|
5
|
+
prefix: z.ZodString;
|
|
6
|
+
createdOn: z.ZodString;
|
|
7
|
+
lastModifiedOn: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
id: string;
|
|
10
|
+
prefix: string;
|
|
11
|
+
displayName: string;
|
|
12
|
+
createdOn: string;
|
|
13
|
+
lastModifiedOn: string;
|
|
14
|
+
}, {
|
|
15
|
+
id: string;
|
|
16
|
+
prefix: string;
|
|
17
|
+
displayName: string;
|
|
18
|
+
createdOn: string;
|
|
19
|
+
lastModifiedOn: string;
|
|
20
|
+
}>;
|
|
21
|
+
export type ApiKeyDto = z.infer<typeof sApiKeyDto>;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const sAutomationRuleCommand: z.ZodObject<{
|
|
3
|
+
command: z.ZodString;
|
|
4
|
+
target: z.ZodString;
|
|
5
|
+
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
target: string;
|
|
8
|
+
params: Record<string, unknown>;
|
|
9
|
+
command: string;
|
|
10
|
+
}, {
|
|
11
|
+
target: string;
|
|
12
|
+
params: Record<string, unknown>;
|
|
13
|
+
command: string;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const sAutomationRuleBody: z.ZodObject<{
|
|
16
|
+
onEvent: z.ZodString;
|
|
17
|
+
runIf: z.ZodOptional<z.ZodString>;
|
|
18
|
+
commands: z.ZodArray<z.ZodObject<{
|
|
19
|
+
command: z.ZodString;
|
|
20
|
+
target: z.ZodString;
|
|
21
|
+
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
target: string;
|
|
24
|
+
params: Record<string, unknown>;
|
|
25
|
+
command: string;
|
|
26
|
+
}, {
|
|
27
|
+
target: string;
|
|
28
|
+
params: Record<string, unknown>;
|
|
29
|
+
command: string;
|
|
30
|
+
}>, "many">;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
onEvent: string;
|
|
33
|
+
commands: {
|
|
34
|
+
target: string;
|
|
35
|
+
params: Record<string, unknown>;
|
|
36
|
+
command: string;
|
|
37
|
+
}[];
|
|
38
|
+
runIf?: string | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
onEvent: string;
|
|
41
|
+
commands: {
|
|
42
|
+
target: string;
|
|
43
|
+
params: Record<string, unknown>;
|
|
44
|
+
command: string;
|
|
45
|
+
}[];
|
|
46
|
+
runIf?: string | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
export declare const sAutomationRuleProps: z.ZodObject<{
|
|
49
|
+
displayName: z.ZodString;
|
|
50
|
+
description: z.ZodOptional<z.ZodString>;
|
|
51
|
+
code: z.ZodNullable<z.ZodString>;
|
|
52
|
+
body: z.ZodObject<{
|
|
53
|
+
onEvent: z.ZodString;
|
|
54
|
+
runIf: z.ZodOptional<z.ZodString>;
|
|
55
|
+
commands: z.ZodArray<z.ZodObject<{
|
|
56
|
+
command: z.ZodString;
|
|
57
|
+
target: z.ZodString;
|
|
58
|
+
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
target: string;
|
|
61
|
+
params: Record<string, unknown>;
|
|
62
|
+
command: string;
|
|
63
|
+
}, {
|
|
64
|
+
target: string;
|
|
65
|
+
params: Record<string, unknown>;
|
|
66
|
+
command: string;
|
|
67
|
+
}>, "many">;
|
|
68
|
+
}, "strip", z.ZodTypeAny, {
|
|
69
|
+
onEvent: string;
|
|
70
|
+
commands: {
|
|
71
|
+
target: string;
|
|
72
|
+
params: Record<string, unknown>;
|
|
73
|
+
command: string;
|
|
74
|
+
}[];
|
|
75
|
+
runIf?: string | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
onEvent: string;
|
|
78
|
+
commands: {
|
|
79
|
+
target: string;
|
|
80
|
+
params: Record<string, unknown>;
|
|
81
|
+
command: string;
|
|
82
|
+
}[];
|
|
83
|
+
runIf?: string | undefined;
|
|
84
|
+
}>;
|
|
85
|
+
enabled: z.ZodBoolean;
|
|
86
|
+
exclusivityGroup: z.ZodNullable<z.ZodString>;
|
|
87
|
+
score: z.ZodNullable<z.ZodNumber>;
|
|
88
|
+
module: z.ZodNullable<z.ZodString>;
|
|
89
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
|
91
|
+
code: string | null;
|
|
92
|
+
module: string | null;
|
|
93
|
+
body: {
|
|
94
|
+
onEvent: string;
|
|
95
|
+
commands: {
|
|
96
|
+
target: string;
|
|
97
|
+
params: Record<string, unknown>;
|
|
98
|
+
command: string;
|
|
99
|
+
}[];
|
|
100
|
+
runIf?: string | undefined;
|
|
101
|
+
};
|
|
102
|
+
metadata: Record<string, unknown>;
|
|
103
|
+
displayName: string;
|
|
104
|
+
enabled: boolean;
|
|
105
|
+
exclusivityGroup: string | null;
|
|
106
|
+
score: number | null;
|
|
107
|
+
description?: string | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
code: string | null;
|
|
110
|
+
module: string | null;
|
|
111
|
+
body: {
|
|
112
|
+
onEvent: string;
|
|
113
|
+
commands: {
|
|
114
|
+
target: string;
|
|
115
|
+
params: Record<string, unknown>;
|
|
116
|
+
command: string;
|
|
117
|
+
}[];
|
|
118
|
+
runIf?: string | undefined;
|
|
119
|
+
};
|
|
120
|
+
metadata: Record<string, unknown>;
|
|
121
|
+
displayName: string;
|
|
122
|
+
enabled: boolean;
|
|
123
|
+
exclusivityGroup: string | null;
|
|
124
|
+
score: number | null;
|
|
125
|
+
description?: string | undefined;
|
|
126
|
+
}>;
|
|
127
|
+
export declare const sAutomationRuleDto: z.ZodObject<{
|
|
128
|
+
displayName: z.ZodString;
|
|
129
|
+
description: z.ZodOptional<z.ZodString>;
|
|
130
|
+
code: z.ZodNullable<z.ZodString>;
|
|
131
|
+
body: z.ZodObject<{
|
|
132
|
+
onEvent: z.ZodString;
|
|
133
|
+
runIf: z.ZodOptional<z.ZodString>;
|
|
134
|
+
commands: z.ZodArray<z.ZodObject<{
|
|
135
|
+
command: z.ZodString;
|
|
136
|
+
target: z.ZodString;
|
|
137
|
+
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
138
|
+
}, "strip", z.ZodTypeAny, {
|
|
139
|
+
target: string;
|
|
140
|
+
params: Record<string, unknown>;
|
|
141
|
+
command: string;
|
|
142
|
+
}, {
|
|
143
|
+
target: string;
|
|
144
|
+
params: Record<string, unknown>;
|
|
145
|
+
command: string;
|
|
146
|
+
}>, "many">;
|
|
147
|
+
}, "strip", z.ZodTypeAny, {
|
|
148
|
+
onEvent: string;
|
|
149
|
+
commands: {
|
|
150
|
+
target: string;
|
|
151
|
+
params: Record<string, unknown>;
|
|
152
|
+
command: string;
|
|
153
|
+
}[];
|
|
154
|
+
runIf?: string | undefined;
|
|
155
|
+
}, {
|
|
156
|
+
onEvent: string;
|
|
157
|
+
commands: {
|
|
158
|
+
target: string;
|
|
159
|
+
params: Record<string, unknown>;
|
|
160
|
+
command: string;
|
|
161
|
+
}[];
|
|
162
|
+
runIf?: string | undefined;
|
|
163
|
+
}>;
|
|
164
|
+
enabled: z.ZodBoolean;
|
|
165
|
+
exclusivityGroup: z.ZodNullable<z.ZodString>;
|
|
166
|
+
score: z.ZodNullable<z.ZodNumber>;
|
|
167
|
+
module: z.ZodNullable<z.ZodString>;
|
|
168
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
169
|
+
} & {
|
|
170
|
+
id: z.ZodString;
|
|
171
|
+
createdOn: z.ZodString;
|
|
172
|
+
lastModifiedOn: z.ZodString;
|
|
173
|
+
}, "strip", z.ZodTypeAny, {
|
|
174
|
+
code: string | null;
|
|
175
|
+
id: string;
|
|
176
|
+
module: string | null;
|
|
177
|
+
body: {
|
|
178
|
+
onEvent: string;
|
|
179
|
+
commands: {
|
|
180
|
+
target: string;
|
|
181
|
+
params: Record<string, unknown>;
|
|
182
|
+
command: string;
|
|
183
|
+
}[];
|
|
184
|
+
runIf?: string | undefined;
|
|
185
|
+
};
|
|
186
|
+
metadata: Record<string, unknown>;
|
|
187
|
+
displayName: string;
|
|
188
|
+
createdOn: string;
|
|
189
|
+
lastModifiedOn: string;
|
|
190
|
+
enabled: boolean;
|
|
191
|
+
exclusivityGroup: string | null;
|
|
192
|
+
score: number | null;
|
|
193
|
+
description?: string | undefined;
|
|
194
|
+
}, {
|
|
195
|
+
code: string | null;
|
|
196
|
+
id: string;
|
|
197
|
+
module: string | null;
|
|
198
|
+
body: {
|
|
199
|
+
onEvent: string;
|
|
200
|
+
commands: {
|
|
201
|
+
target: string;
|
|
202
|
+
params: Record<string, unknown>;
|
|
203
|
+
command: string;
|
|
204
|
+
}[];
|
|
205
|
+
runIf?: string | undefined;
|
|
206
|
+
};
|
|
207
|
+
metadata: Record<string, unknown>;
|
|
208
|
+
displayName: string;
|
|
209
|
+
createdOn: string;
|
|
210
|
+
lastModifiedOn: string;
|
|
211
|
+
enabled: boolean;
|
|
212
|
+
exclusivityGroup: string | null;
|
|
213
|
+
score: number | null;
|
|
214
|
+
description?: string | undefined;
|
|
215
|
+
}>;
|
|
216
|
+
export type AutomationRuleBody = z.infer<typeof sAutomationRuleBody>;
|
|
217
|
+
export type AutomationRuleProps = z.infer<typeof sAutomationRuleProps>;
|
|
218
|
+
export type AutomationRuleDto = z.infer<typeof sAutomationRuleDto>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const sAutomationRuleCommand = z.object({
|
|
3
|
+
command: z.string().nonempty().describe('The command to be executed'),
|
|
4
|
+
target: z.string().nonempty().describe('The target of the command'),
|
|
5
|
+
params: z
|
|
6
|
+
.record(z.unknown())
|
|
7
|
+
.describe('The parameters of the command depending on what it is'),
|
|
8
|
+
});
|
|
9
|
+
export const sAutomationRuleBody = z.object({
|
|
10
|
+
onEvent: z
|
|
11
|
+
.string()
|
|
12
|
+
.nonempty()
|
|
13
|
+
.describe('The event that triggers the automation rule'),
|
|
14
|
+
runIf: z
|
|
15
|
+
.string()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('The condition under which the automation rule should run'),
|
|
18
|
+
commands: z
|
|
19
|
+
.array(sAutomationRuleCommand)
|
|
20
|
+
.describe('The commands to be executed by the automation rule'),
|
|
21
|
+
});
|
|
22
|
+
export const sAutomationRuleProps = z.object({
|
|
23
|
+
displayName: z
|
|
24
|
+
.string()
|
|
25
|
+
.nonempty()
|
|
26
|
+
.describe('The name of the automation rule'),
|
|
27
|
+
description: z
|
|
28
|
+
.string()
|
|
29
|
+
.optional()
|
|
30
|
+
.describe('A description of the automation rule'),
|
|
31
|
+
code: z.string().nullable().describe('The code of the automation rule'),
|
|
32
|
+
body: sAutomationRuleBody.describe('The body of the automation rule'),
|
|
33
|
+
enabled: z.boolean().describe('Whether the automation rule is enabled'),
|
|
34
|
+
exclusivityGroup: z
|
|
35
|
+
.string()
|
|
36
|
+
.nullable()
|
|
37
|
+
.describe('The exclusivity group of the automation rule. Only one matching rule at max will run within one group based on the highest score'),
|
|
38
|
+
score: z.number().int().min(0).nullable(),
|
|
39
|
+
module: z
|
|
40
|
+
.string()
|
|
41
|
+
.nullable()
|
|
42
|
+
.describe('The module the automation rule belongs to'),
|
|
43
|
+
metadata: z.record(z.unknown()),
|
|
44
|
+
});
|
|
45
|
+
export const sAutomationRuleDto = sAutomationRuleProps.merge(z.object({
|
|
46
|
+
id: z.string().describe('The ID of the automation rule'),
|
|
47
|
+
createdOn: z.string().describe('The date the automation rule was created'),
|
|
48
|
+
lastModifiedOn: z
|
|
49
|
+
.string()
|
|
50
|
+
.describe('The date the automation rule was last modified'),
|
|
51
|
+
}));
|