@awarevue/api-types 1.0.1
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/access-control/access-rule.d.ts +243 -0
- package/dist/access-control/access-rule.js +49 -0
- package/dist/access-control/credential.d.ts +14 -0
- package/dist/access-control/credential.js +12 -0
- package/dist/access-control/index.d.ts +7 -0
- package/dist/access-control/index.js +23 -0
- package/dist/access-control/person-presence.d.ts +249 -0
- package/dist/access-control/person-presence.js +61 -0
- package/dist/access-control/person.d.ts +209 -0
- package/dist/access-control/person.js +49 -0
- package/dist/access-control/schedule.d.ts +500 -0
- package/dist/access-control/schedule.js +65 -0
- package/dist/access-control/sync.d.ts +3 -0
- package/dist/access-control/sync.js +2 -0
- package/dist/access-control/zone.d.ts +65 -0
- package/dist/access-control/zone.js +28 -0
- package/dist/agent-communication/index.d.ts +1 -0
- package/dist/agent-communication/index.js +17 -0
- package/dist/agent-communication/protocol.d.ts +1692 -0
- package/dist/agent-communication/protocol.js +341 -0
- package/dist/api/alarm.d.ts +23 -0
- package/dist/api/alarm.js +2 -0
- package/dist/api/auth.d.ts +31 -0
- package/dist/api/auth.js +19 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.js +20 -0
- package/dist/api/media.d.ts +187 -0
- package/dist/api/media.js +59 -0
- package/dist/api/query.d.ts +33 -0
- package/dist/api/query.js +41 -0
- package/dist/app.d.ts +12 -0
- package/dist/app.js +8 -0
- package/dist/automation.d.ts +334 -0
- package/dist/automation.js +49 -0
- package/dist/aware-config.d.ts +3 -0
- package/dist/aware-config.js +2 -0
- package/dist/custom-field.d.ts +52 -0
- package/dist/custom-field.js +19 -0
- package/dist/device/alarm.d.ts +265 -0
- package/dist/device/alarm.js +66 -0
- package/dist/device/any-device.d.ts +2376 -0
- package/dist/device/any-device.js +185 -0
- package/dist/device/camera-lift.d.ts +17 -0
- package/dist/device/camera-lift.js +7 -0
- package/dist/device/camera.d.ts +829 -0
- package/dist/device/camera.js +120 -0
- package/dist/device/device-gateway.d.ts +3 -0
- package/dist/device/device-gateway.js +4 -0
- package/dist/device/door.d.ts +217 -0
- package/dist/device/door.js +57 -0
- package/dist/device/index.d.ts +15 -0
- package/dist/device/index.js +31 -0
- package/dist/device/intercom-operator.d.ts +13 -0
- package/dist/device/intercom-operator.js +5 -0
- package/dist/device/intercom-terminal.d.ts +244 -0
- package/dist/device/intercom-terminal.js +48 -0
- package/dist/device/io-board.d.ts +55 -0
- package/dist/device/io-board.js +19 -0
- package/dist/device/motion-sensor.d.ts +8 -0
- package/dist/device/motion-sensor.js +8 -0
- package/dist/device/panic-button.d.ts +26 -0
- package/dist/device/panic-button.js +14 -0
- package/dist/device/pbx.d.ts +20 -0
- package/dist/device/pbx.js +11 -0
- package/dist/device/presence-tracker.d.ts +127 -0
- package/dist/device/presence-tracker.js +27 -0
- package/dist/device/reader/commands.d.ts +1 -0
- package/dist/device/reader/commands.js +2 -0
- package/dist/device/reader/events.d.ts +37 -0
- package/dist/device/reader/events.js +13 -0
- package/dist/device/reader/index.d.ts +3 -0
- package/dist/device/reader/index.js +19 -0
- package/dist/device/reader/specs.d.ts +2 -0
- package/dist/device/reader/specs.js +4 -0
- package/dist/device/server.d.ts +73 -0
- package/dist/device/server.js +33 -0
- package/dist/device-command.d.ts +23 -0
- package/dist/device-command.js +110 -0
- package/dist/device-event.d.ts +682 -0
- package/dist/device-event.js +87 -0
- package/dist/device-factory.d.ts +112 -0
- package/dist/device-factory.js +25 -0
- package/dist/device-group.d.ts +74 -0
- package/dist/device-group.js +31 -0
- package/dist/device-import.d.ts +1412 -0
- package/dist/device-import.js +33 -0
- package/dist/device-relation.d.ts +30 -0
- package/dist/device-relation.js +68 -0
- package/dist/device-state.d.ts +10 -0
- package/dist/device-state.js +2 -0
- package/dist/error.d.ts +13 -0
- package/dist/error.js +10 -0
- package/dist/file.d.ts +3 -0
- package/dist/file.js +2 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +44 -0
- package/dist/layout.d.ts +188 -0
- package/dist/layout.js +40 -0
- package/dist/macros.d.ts +160 -0
- package/dist/macros.js +26 -0
- package/dist/messages/device-communication.d.ts +121 -0
- package/dist/messages/device-communication.js +63 -0
- package/dist/messages/index.d.ts +5 -0
- package/dist/messages/index.js +21 -0
- package/dist/messages/progress.d.ts +118 -0
- package/dist/messages/progress.js +51 -0
- package/dist/messages/provider-api/index.d.ts +1 -0
- package/dist/messages/provider-api/index.js +17 -0
- package/dist/messages/provider-api/sync-protocol.d.ts +83 -0
- package/dist/messages/provider-api/sync-protocol.js +2 -0
- package/dist/messages/web-rtc-signaling.d.ts +265 -0
- package/dist/messages/web-rtc-signaling.js +82 -0
- package/dist/messages/web-socket.d.ts +7 -0
- package/dist/messages/web-socket.js +5 -0
- package/dist/milestone.d.ts +5 -0
- package/dist/milestone.js +2 -0
- package/dist/module-config.d.ts +27 -0
- package/dist/module-config.js +2 -0
- package/dist/orchid.d.ts +19 -0
- package/dist/orchid.js +2 -0
- package/dist/package.json +40 -0
- package/dist/permissions.d.ts +6 -0
- package/dist/permissions.js +168 -0
- package/dist/template.d.ts +50 -0
- package/dist/template.js +21 -0
- package/dist/user.d.ts +184 -0
- package/dist/user.js +56 -0
- package/dist/view.d.ts +775 -0
- package/dist/view.js +74 -0
- package/dist/webrtc-playback.d.ts +20 -0
- package/dist/webrtc-playback.js +14 -0
- package/package.json +40 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sGetLatestFrameRequest = exports.sMediaSearchQueryDto = exports.sGetExportLinkResponse = exports.sGetObjectThumbnailRequest = exports.sGetObjectSnapshotRequest = exports.sGetScenePreviewClipRequest = exports.sGetPreviewImageRequest = exports.sGetRecordingsResponse = exports.sGetRecordingsRequest = exports.sRecordingSequence = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const query_1 = require("./query");
|
|
6
|
+
exports.sRecordingSequence = zod_1.z.object({
|
|
7
|
+
start: zod_1.z.number().nonnegative(),
|
|
8
|
+
end: zod_1.z.number().nonnegative(),
|
|
9
|
+
motion: zod_1.z.number().optional(),
|
|
10
|
+
objects: zod_1.z.number().optional(),
|
|
11
|
+
});
|
|
12
|
+
exports.sGetRecordingsRequest = zod_1.z.object({
|
|
13
|
+
deviceId: zod_1.z.string().nonempty(),
|
|
14
|
+
timeFrom: zod_1.z.number().nonnegative(),
|
|
15
|
+
timeTo: zod_1.z.number().nonnegative(),
|
|
16
|
+
});
|
|
17
|
+
exports.sGetRecordingsResponse = (0, query_1.sPaginatedQueryResponseOf)(exports.sRecordingSequence);
|
|
18
|
+
exports.sGetPreviewImageRequest = zod_1.z.object({
|
|
19
|
+
deviceId: zod_1.z.string().nonempty(),
|
|
20
|
+
time: zod_1.z.number().nonnegative(),
|
|
21
|
+
height: zod_1.z.number().nonnegative(),
|
|
22
|
+
});
|
|
23
|
+
exports.sGetScenePreviewClipRequest = zod_1.z.object({
|
|
24
|
+
deviceId: zod_1.z.string().nonempty(),
|
|
25
|
+
providerAssignedRef: zod_1.z.string().nonempty(),
|
|
26
|
+
});
|
|
27
|
+
exports.sGetObjectSnapshotRequest = zod_1.z.object({
|
|
28
|
+
deviceId: zod_1.z.string().nonempty(),
|
|
29
|
+
providerAssignedRef: zod_1.z.string().nonempty(),
|
|
30
|
+
crop: zod_1.z.boolean(),
|
|
31
|
+
boxes: zod_1.z.boolean(),
|
|
32
|
+
height: zod_1.z.number().nonnegative().optional(),
|
|
33
|
+
quality: zod_1.z.number().nonnegative().optional(),
|
|
34
|
+
});
|
|
35
|
+
exports.sGetObjectThumbnailRequest = zod_1.z.object({
|
|
36
|
+
deviceId: zod_1.z.string().nonempty(),
|
|
37
|
+
providerAssignedRef: zod_1.z.string().nonempty(),
|
|
38
|
+
});
|
|
39
|
+
exports.sGetExportLinkResponse = zod_1.z.object({
|
|
40
|
+
relativeUrl: zod_1.z.string().nonempty(),
|
|
41
|
+
});
|
|
42
|
+
const sSortOptions = zod_1.z.union([zod_1.z.literal('time_asc'), zod_1.z.literal('time_desc')]);
|
|
43
|
+
exports.sMediaSearchQueryDto = zod_1.z
|
|
44
|
+
.object({
|
|
45
|
+
limit: zod_1.z.number().nonnegative(),
|
|
46
|
+
q: zod_1.z.string(),
|
|
47
|
+
deviceId: zod_1.z.array(zod_1.z.string().nonempty()),
|
|
48
|
+
similarTo: zod_1.z.string().optional(),
|
|
49
|
+
label: zod_1.z.array(zod_1.z.string().nonempty()),
|
|
50
|
+
timeFrom: zod_1.z.number().nonnegative(),
|
|
51
|
+
timeTo: zod_1.z.number().nonnegative(),
|
|
52
|
+
sortBy: sSortOptions,
|
|
53
|
+
})
|
|
54
|
+
.partial();
|
|
55
|
+
exports.sGetLatestFrameRequest = zod_1.z.object({
|
|
56
|
+
deviceId: zod_1.z.string().nonempty(),
|
|
57
|
+
width: zod_1.z.number().nonnegative(),
|
|
58
|
+
height: zod_1.z.number().nonnegative(),
|
|
59
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z, ZodTypeAny } from 'zod';
|
|
2
|
+
export type PaginatedQueryRequest<TCriteria> = Partial<TCriteria> & {
|
|
3
|
+
q?: string;
|
|
4
|
+
offset?: number;
|
|
5
|
+
limit?: number;
|
|
6
|
+
};
|
|
7
|
+
export interface PaginatedQueryResponse<T> {
|
|
8
|
+
items: T[];
|
|
9
|
+
total: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const sPaginatedQueryRequestOf: <T extends z.AnyZodObject>(criteriaSchema: T) => z.ZodObject<z.objectUtil.extendShape<{
|
|
12
|
+
q: z.ZodOptional<z.ZodString>;
|
|
13
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
}, T["shape"]>, T["_def"]["unknownKeys"], T["_def"]["catchall"], z.objectOutputType<z.objectUtil.extendShape<{
|
|
16
|
+
q: z.ZodOptional<z.ZodString>;
|
|
17
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
}, T["shape"]>, T["_def"]["catchall"], T["_def"]["unknownKeys"]>, z.objectInputType<z.objectUtil.extendShape<{
|
|
20
|
+
q: z.ZodOptional<z.ZodString>;
|
|
21
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
}, T["shape"]>, T["_def"]["catchall"], T["_def"]["unknownKeys"]>>;
|
|
24
|
+
export declare const sPaginatedQueryResponseOf: <T extends ZodTypeAny>(itemSchema: T) => z.ZodObject<{
|
|
25
|
+
items: z.ZodArray<T, "many">;
|
|
26
|
+
total: z.ZodNumber;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
total: number;
|
|
29
|
+
items: T["_output"][];
|
|
30
|
+
}, {
|
|
31
|
+
total: number;
|
|
32
|
+
items: T["_input"][];
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sPaginatedQueryResponseOf = exports.sPaginatedQueryRequestOf = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const sPaginatedQueryRequestOf = (criteriaSchema) => zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
q: zod_1.z.string().optional().describe('Not supported yet'),
|
|
8
|
+
offset: zod_1.z
|
|
9
|
+
.number()
|
|
10
|
+
.optional()
|
|
11
|
+
.describe('Offset of the first item to return'),
|
|
12
|
+
limit: zod_1.z
|
|
13
|
+
.number()
|
|
14
|
+
.optional()
|
|
15
|
+
.describe('Maximum number of items to return'),
|
|
16
|
+
})
|
|
17
|
+
.merge(criteriaSchema);
|
|
18
|
+
exports.sPaginatedQueryRequestOf = sPaginatedQueryRequestOf;
|
|
19
|
+
const sPaginatedQueryResponseOf = (itemSchema) => zod_1.z.object({
|
|
20
|
+
items: zod_1.z.array(itemSchema).describe('Array of items matching the query'),
|
|
21
|
+
total: zod_1.z
|
|
22
|
+
.number()
|
|
23
|
+
.describe('Total number of items matching the query (only one page is shown at a time)'),
|
|
24
|
+
});
|
|
25
|
+
exports.sPaginatedQueryResponseOf = sPaginatedQueryResponseOf;
|
|
26
|
+
// example usage:
|
|
27
|
+
// import { sPaginatedQueryRequestOf, sPaginatedQueryResponseOf } from 'aware-api-types';
|
|
28
|
+
// import { z } from 'zod';
|
|
29
|
+
// const sUserCriteria = z.object({
|
|
30
|
+
// name: z.string().optional(),
|
|
31
|
+
// email: z.string().optional(),
|
|
32
|
+
// });
|
|
33
|
+
// const sUser = z.object({
|
|
34
|
+
// id: z.string(),
|
|
35
|
+
// name: z.string(),
|
|
36
|
+
// email: z.string(),
|
|
37
|
+
// });
|
|
38
|
+
// const sPaginatedUserQueryRequest = sPaginatedQueryRequestOf(sUserCriteria);
|
|
39
|
+
// const sPaginatedUserQueryResponse = sPaginatedQueryResponseOf(sUser);
|
|
40
|
+
// type Request = z.infer<typeof sPaginatedUserQueryRequest>;
|
|
41
|
+
// type Response = z.infer<typeof sPaginatedUserQueryResponse>;
|
package/dist/app.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const sAppInfo: z.ZodObject<{
|
|
3
|
+
version: z.ZodString;
|
|
4
|
+
releaseDate: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
version: string;
|
|
7
|
+
releaseDate: string;
|
|
8
|
+
}, {
|
|
9
|
+
version: string;
|
|
10
|
+
releaseDate: string;
|
|
11
|
+
}>;
|
|
12
|
+
export type AppInfo = z.infer<typeof sAppInfo>;
|
package/dist/app.js
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
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
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
code: string | null;
|
|
88
|
+
body: {
|
|
89
|
+
onEvent: string;
|
|
90
|
+
commands: {
|
|
91
|
+
target: string;
|
|
92
|
+
params: Record<string, unknown>;
|
|
93
|
+
command: string;
|
|
94
|
+
}[];
|
|
95
|
+
runIf?: string | undefined;
|
|
96
|
+
};
|
|
97
|
+
displayName: string;
|
|
98
|
+
enabled: boolean;
|
|
99
|
+
description?: string | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
code: string | null;
|
|
102
|
+
body: {
|
|
103
|
+
onEvent: string;
|
|
104
|
+
commands: {
|
|
105
|
+
target: string;
|
|
106
|
+
params: Record<string, unknown>;
|
|
107
|
+
command: string;
|
|
108
|
+
}[];
|
|
109
|
+
runIf?: string | undefined;
|
|
110
|
+
};
|
|
111
|
+
displayName: string;
|
|
112
|
+
enabled: boolean;
|
|
113
|
+
description?: string | undefined;
|
|
114
|
+
}>;
|
|
115
|
+
export declare const sAddAutomationRuleRequest: z.ZodObject<{
|
|
116
|
+
displayName: z.ZodString;
|
|
117
|
+
description: z.ZodOptional<z.ZodString>;
|
|
118
|
+
code: z.ZodNullable<z.ZodString>;
|
|
119
|
+
body: z.ZodObject<{
|
|
120
|
+
onEvent: z.ZodString;
|
|
121
|
+
runIf: z.ZodOptional<z.ZodString>;
|
|
122
|
+
commands: z.ZodArray<z.ZodObject<{
|
|
123
|
+
command: z.ZodString;
|
|
124
|
+
target: z.ZodString;
|
|
125
|
+
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
target: string;
|
|
128
|
+
params: Record<string, unknown>;
|
|
129
|
+
command: string;
|
|
130
|
+
}, {
|
|
131
|
+
target: string;
|
|
132
|
+
params: Record<string, unknown>;
|
|
133
|
+
command: string;
|
|
134
|
+
}>, "many">;
|
|
135
|
+
}, "strip", z.ZodTypeAny, {
|
|
136
|
+
onEvent: string;
|
|
137
|
+
commands: {
|
|
138
|
+
target: string;
|
|
139
|
+
params: Record<string, unknown>;
|
|
140
|
+
command: string;
|
|
141
|
+
}[];
|
|
142
|
+
runIf?: string | undefined;
|
|
143
|
+
}, {
|
|
144
|
+
onEvent: string;
|
|
145
|
+
commands: {
|
|
146
|
+
target: string;
|
|
147
|
+
params: Record<string, unknown>;
|
|
148
|
+
command: string;
|
|
149
|
+
}[];
|
|
150
|
+
runIf?: string | undefined;
|
|
151
|
+
}>;
|
|
152
|
+
enabled: z.ZodBoolean;
|
|
153
|
+
}, "strip", z.ZodTypeAny, {
|
|
154
|
+
code: string | null;
|
|
155
|
+
body: {
|
|
156
|
+
onEvent: string;
|
|
157
|
+
commands: {
|
|
158
|
+
target: string;
|
|
159
|
+
params: Record<string, unknown>;
|
|
160
|
+
command: string;
|
|
161
|
+
}[];
|
|
162
|
+
runIf?: string | undefined;
|
|
163
|
+
};
|
|
164
|
+
displayName: string;
|
|
165
|
+
enabled: boolean;
|
|
166
|
+
description?: string | undefined;
|
|
167
|
+
}, {
|
|
168
|
+
code: string | null;
|
|
169
|
+
body: {
|
|
170
|
+
onEvent: string;
|
|
171
|
+
commands: {
|
|
172
|
+
target: string;
|
|
173
|
+
params: Record<string, unknown>;
|
|
174
|
+
command: string;
|
|
175
|
+
}[];
|
|
176
|
+
runIf?: string | undefined;
|
|
177
|
+
};
|
|
178
|
+
displayName: string;
|
|
179
|
+
enabled: boolean;
|
|
180
|
+
description?: string | undefined;
|
|
181
|
+
}>;
|
|
182
|
+
export declare const sUpdateAutomationRule: z.ZodObject<{
|
|
183
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
184
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
185
|
+
code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
186
|
+
body: z.ZodOptional<z.ZodObject<{
|
|
187
|
+
onEvent: z.ZodString;
|
|
188
|
+
runIf: z.ZodOptional<z.ZodString>;
|
|
189
|
+
commands: z.ZodArray<z.ZodObject<{
|
|
190
|
+
command: z.ZodString;
|
|
191
|
+
target: z.ZodString;
|
|
192
|
+
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
193
|
+
}, "strip", z.ZodTypeAny, {
|
|
194
|
+
target: string;
|
|
195
|
+
params: Record<string, unknown>;
|
|
196
|
+
command: string;
|
|
197
|
+
}, {
|
|
198
|
+
target: string;
|
|
199
|
+
params: Record<string, unknown>;
|
|
200
|
+
command: string;
|
|
201
|
+
}>, "many">;
|
|
202
|
+
}, "strip", z.ZodTypeAny, {
|
|
203
|
+
onEvent: string;
|
|
204
|
+
commands: {
|
|
205
|
+
target: string;
|
|
206
|
+
params: Record<string, unknown>;
|
|
207
|
+
command: string;
|
|
208
|
+
}[];
|
|
209
|
+
runIf?: string | undefined;
|
|
210
|
+
}, {
|
|
211
|
+
onEvent: string;
|
|
212
|
+
commands: {
|
|
213
|
+
target: string;
|
|
214
|
+
params: Record<string, unknown>;
|
|
215
|
+
command: string;
|
|
216
|
+
}[];
|
|
217
|
+
runIf?: string | undefined;
|
|
218
|
+
}>>;
|
|
219
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
220
|
+
} & {
|
|
221
|
+
id: z.ZodString;
|
|
222
|
+
}, "strip", z.ZodTypeAny, {
|
|
223
|
+
id: string;
|
|
224
|
+
code?: string | null | undefined;
|
|
225
|
+
body?: {
|
|
226
|
+
onEvent: string;
|
|
227
|
+
commands: {
|
|
228
|
+
target: string;
|
|
229
|
+
params: Record<string, unknown>;
|
|
230
|
+
command: string;
|
|
231
|
+
}[];
|
|
232
|
+
runIf?: string | undefined;
|
|
233
|
+
} | undefined;
|
|
234
|
+
description?: string | undefined;
|
|
235
|
+
displayName?: string | undefined;
|
|
236
|
+
enabled?: boolean | undefined;
|
|
237
|
+
}, {
|
|
238
|
+
id: string;
|
|
239
|
+
code?: string | null | undefined;
|
|
240
|
+
body?: {
|
|
241
|
+
onEvent: string;
|
|
242
|
+
commands: {
|
|
243
|
+
target: string;
|
|
244
|
+
params: Record<string, unknown>;
|
|
245
|
+
command: string;
|
|
246
|
+
}[];
|
|
247
|
+
runIf?: string | undefined;
|
|
248
|
+
} | undefined;
|
|
249
|
+
description?: string | undefined;
|
|
250
|
+
displayName?: string | undefined;
|
|
251
|
+
enabled?: boolean | undefined;
|
|
252
|
+
}>;
|
|
253
|
+
export declare const sAutomationRuleDto: z.ZodObject<{
|
|
254
|
+
displayName: z.ZodString;
|
|
255
|
+
description: z.ZodOptional<z.ZodString>;
|
|
256
|
+
body: z.ZodObject<{
|
|
257
|
+
onEvent: z.ZodString;
|
|
258
|
+
runIf: z.ZodOptional<z.ZodString>;
|
|
259
|
+
commands: z.ZodArray<z.ZodObject<{
|
|
260
|
+
command: z.ZodString;
|
|
261
|
+
target: z.ZodString;
|
|
262
|
+
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
263
|
+
}, "strip", z.ZodTypeAny, {
|
|
264
|
+
target: string;
|
|
265
|
+
params: Record<string, unknown>;
|
|
266
|
+
command: string;
|
|
267
|
+
}, {
|
|
268
|
+
target: string;
|
|
269
|
+
params: Record<string, unknown>;
|
|
270
|
+
command: string;
|
|
271
|
+
}>, "many">;
|
|
272
|
+
}, "strip", z.ZodTypeAny, {
|
|
273
|
+
onEvent: string;
|
|
274
|
+
commands: {
|
|
275
|
+
target: string;
|
|
276
|
+
params: Record<string, unknown>;
|
|
277
|
+
command: string;
|
|
278
|
+
}[];
|
|
279
|
+
runIf?: string | undefined;
|
|
280
|
+
}, {
|
|
281
|
+
onEvent: string;
|
|
282
|
+
commands: {
|
|
283
|
+
target: string;
|
|
284
|
+
params: Record<string, unknown>;
|
|
285
|
+
command: string;
|
|
286
|
+
}[];
|
|
287
|
+
runIf?: string | undefined;
|
|
288
|
+
}>;
|
|
289
|
+
enabled: z.ZodBoolean;
|
|
290
|
+
} & {
|
|
291
|
+
id: z.ZodString;
|
|
292
|
+
code: z.ZodNullable<z.ZodString>;
|
|
293
|
+
createdOn: z.ZodString;
|
|
294
|
+
lastModifiedOn: z.ZodString;
|
|
295
|
+
}, "strip", z.ZodTypeAny, {
|
|
296
|
+
code: string | null;
|
|
297
|
+
id: string;
|
|
298
|
+
body: {
|
|
299
|
+
onEvent: string;
|
|
300
|
+
commands: {
|
|
301
|
+
target: string;
|
|
302
|
+
params: Record<string, unknown>;
|
|
303
|
+
command: string;
|
|
304
|
+
}[];
|
|
305
|
+
runIf?: string | undefined;
|
|
306
|
+
};
|
|
307
|
+
displayName: string;
|
|
308
|
+
enabled: boolean;
|
|
309
|
+
createdOn: string;
|
|
310
|
+
lastModifiedOn: string;
|
|
311
|
+
description?: string | undefined;
|
|
312
|
+
}, {
|
|
313
|
+
code: string | null;
|
|
314
|
+
id: string;
|
|
315
|
+
body: {
|
|
316
|
+
onEvent: string;
|
|
317
|
+
commands: {
|
|
318
|
+
target: string;
|
|
319
|
+
params: Record<string, unknown>;
|
|
320
|
+
command: string;
|
|
321
|
+
}[];
|
|
322
|
+
runIf?: string | undefined;
|
|
323
|
+
};
|
|
324
|
+
displayName: string;
|
|
325
|
+
enabled: boolean;
|
|
326
|
+
createdOn: string;
|
|
327
|
+
lastModifiedOn: string;
|
|
328
|
+
description?: string | undefined;
|
|
329
|
+
}>;
|
|
330
|
+
export type AutomationRuleBody = z.infer<typeof sAutomationRuleBody>;
|
|
331
|
+
export type AutomationRuleProps = z.infer<typeof sAutomationRuleProps>;
|
|
332
|
+
export type AutomationRuleDto = z.infer<typeof sAutomationRuleDto>;
|
|
333
|
+
export type AddAutomationRuleRequest = z.infer<typeof sAddAutomationRuleRequest>;
|
|
334
|
+
export type UpdateAutomationRuleRequest = z.infer<typeof sUpdateAutomationRule>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
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
|
+
});
|
|
38
|
+
exports.sAddAutomationRuleRequest = exports.sAutomationRuleProps;
|
|
39
|
+
exports.sUpdateAutomationRule = exports.sAutomationRuleProps.partial().merge(zod_1.z.object({
|
|
40
|
+
id: zod_1.z.string().describe('The ID of the automation rule'),
|
|
41
|
+
}));
|
|
42
|
+
exports.sAutomationRuleDto = exports.sAutomationRuleProps.merge(zod_1.z.object({
|
|
43
|
+
id: zod_1.z.string().describe('The ID of the automation rule'),
|
|
44
|
+
code: zod_1.z.string().nullable().describe('The code of the automation rule'),
|
|
45
|
+
createdOn: zod_1.z.string().describe('The date the automation rule was created'),
|
|
46
|
+
lastModifiedOn: zod_1.z
|
|
47
|
+
.string()
|
|
48
|
+
.describe('The date the automation rule was last modified'),
|
|
49
|
+
}));
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const CustomFieldTypeEnum: z.ZodEnum<["string", "number", "boolean", "date"]>;
|
|
3
|
+
export declare const CustomFieldExtendsTypeEnum: z.ZodEnum<["person"]>;
|
|
4
|
+
export declare const sCustomFieldDto: z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
type: z.ZodEnum<["string", "number", "boolean", "date"]>;
|
|
8
|
+
extendsType: z.ZodEnum<["person"]>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
name: string;
|
|
11
|
+
type: "string" | "number" | "boolean" | "date";
|
|
12
|
+
id: string;
|
|
13
|
+
extendsType: "person";
|
|
14
|
+
}, {
|
|
15
|
+
name: string;
|
|
16
|
+
type: "string" | "number" | "boolean" | "date";
|
|
17
|
+
id: string;
|
|
18
|
+
extendsType: "person";
|
|
19
|
+
}>;
|
|
20
|
+
export declare const sAddCustomFieldRequest: z.ZodObject<Omit<{
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
type: z.ZodEnum<["string", "number", "boolean", "date"]>;
|
|
24
|
+
extendsType: z.ZodEnum<["person"]>;
|
|
25
|
+
}, "id">, "strip", z.ZodTypeAny, {
|
|
26
|
+
name: string;
|
|
27
|
+
type: "string" | "number" | "boolean" | "date";
|
|
28
|
+
extendsType: "person";
|
|
29
|
+
}, {
|
|
30
|
+
name: string;
|
|
31
|
+
type: "string" | "number" | "boolean" | "date";
|
|
32
|
+
extendsType: "person";
|
|
33
|
+
}>;
|
|
34
|
+
export declare const sUpdateCustomFieldRequest: z.ZodObject<{
|
|
35
|
+
name: z.ZodOptional<z.ZodString>;
|
|
36
|
+
type: z.ZodOptional<z.ZodEnum<["string", "number", "boolean", "date"]>>;
|
|
37
|
+
extendsType: z.ZodOptional<z.ZodEnum<["person"]>>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
name?: string | undefined;
|
|
40
|
+
type?: "string" | "number" | "boolean" | "date" | undefined;
|
|
41
|
+
extendsType?: "person" | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
name?: string | undefined;
|
|
44
|
+
type?: "string" | "number" | "boolean" | "date" | undefined;
|
|
45
|
+
extendsType?: "person" | undefined;
|
|
46
|
+
}>;
|
|
47
|
+
export type CustomFieldDto = z.infer<typeof sCustomFieldDto>;
|
|
48
|
+
export type AddCustomFieldRequest = z.infer<typeof sAddCustomFieldRequest>;
|
|
49
|
+
export type UpdateCustomFieldRequest = z.infer<typeof sUpdateCustomFieldRequest>;
|
|
50
|
+
export type CustomFieldRequestQueryParams = {
|
|
51
|
+
extendsType: CustomFieldDto['extendsType'];
|
|
52
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sUpdateCustomFieldRequest = exports.sAddCustomFieldRequest = exports.sCustomFieldDto = exports.CustomFieldExtendsTypeEnum = exports.CustomFieldTypeEnum = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.CustomFieldTypeEnum = zod_1.z.enum([
|
|
6
|
+
'string',
|
|
7
|
+
'number',
|
|
8
|
+
'boolean',
|
|
9
|
+
'date',
|
|
10
|
+
]);
|
|
11
|
+
exports.CustomFieldExtendsTypeEnum = zod_1.z.enum(['person']);
|
|
12
|
+
exports.sCustomFieldDto = zod_1.z.object({
|
|
13
|
+
id: zod_1.z.string().uuid(),
|
|
14
|
+
name: zod_1.z.string().min(1).max(64),
|
|
15
|
+
type: exports.CustomFieldTypeEnum,
|
|
16
|
+
extendsType: exports.CustomFieldExtendsTypeEnum,
|
|
17
|
+
});
|
|
18
|
+
exports.sAddCustomFieldRequest = exports.sCustomFieldDto.omit({ id: true });
|
|
19
|
+
exports.sUpdateCustomFieldRequest = exports.sAddCustomFieldRequest.partial();
|