@wise/dynamic-flow-types 2.28.0 → 2.28.2
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/build/main.js +174 -45
- package/build/main.min.js +1 -1
- package/build/main.mjs +174 -45
- package/build/zod/schemas.ts +354 -354
- package/package.json +6 -6
package/build/zod/schemas.ts
CHANGED
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import type {
|
|
4
4
|
JsonElement,
|
|
5
|
-
|
|
6
|
-
Layout,
|
|
7
|
-
ModalLayout,
|
|
8
|
-
ModalLayoutContent,
|
|
9
|
-
BoxLayout,
|
|
5
|
+
Step,
|
|
10
6
|
Schema,
|
|
7
|
+
Layout,
|
|
11
8
|
AllOfSchema,
|
|
12
9
|
ArraySchema,
|
|
13
10
|
BooleanSchema,
|
|
@@ -17,50 +14,33 @@ import type {
|
|
|
17
14
|
OneOfSchema,
|
|
18
15
|
StringSchema,
|
|
19
16
|
PersistAsync,
|
|
20
|
-
ArraySchemaTuple,
|
|
21
17
|
ArraySchemaList,
|
|
22
|
-
|
|
18
|
+
ArraySchemaTuple,
|
|
19
|
+
ModalLayout,
|
|
20
|
+
ModalLayoutContent,
|
|
21
|
+
ColumnsLayout,
|
|
22
|
+
BoxLayout,
|
|
23
23
|
} from '../next';
|
|
24
24
|
|
|
25
|
-
export const
|
|
26
|
-
z
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
z.literal('warning'),
|
|
37
|
-
z.literal('negative'),
|
|
38
|
-
z.literal('success'),
|
|
39
|
-
z.literal('failure'),
|
|
40
|
-
z.literal('info'),
|
|
41
|
-
z.literal('primary'),
|
|
42
|
-
]);
|
|
43
|
-
|
|
44
|
-
export const columnsLayoutBiasSchema = z.union([
|
|
45
|
-
z.literal('none'),
|
|
46
|
-
z.literal('left'),
|
|
47
|
-
z.literal('right'),
|
|
48
|
-
]);
|
|
49
|
-
|
|
50
|
-
export const statusListLayoutStatusSchema = z.union([
|
|
51
|
-
z.literal('not-done'),
|
|
52
|
-
z.literal('pending'),
|
|
53
|
-
z.literal('done'),
|
|
54
|
-
]);
|
|
55
|
-
|
|
56
|
-
export const alignSchema = z.union([z.literal('left'), z.literal('center'), z.literal('right')]);
|
|
25
|
+
export const jsonElementSchema: z.ZodSchema<JsonElement> = z.lazy(() =>
|
|
26
|
+
z
|
|
27
|
+
.union([
|
|
28
|
+
z.string(),
|
|
29
|
+
z.number(),
|
|
30
|
+
z.boolean(),
|
|
31
|
+
z.record(jsonElementSchema),
|
|
32
|
+
z.array(jsonElementSchema),
|
|
33
|
+
])
|
|
34
|
+
.nullable(),
|
|
35
|
+
);
|
|
57
36
|
|
|
58
|
-
export const
|
|
59
|
-
|
|
37
|
+
export const externalSchema = z.object({
|
|
38
|
+
url: z.string(),
|
|
60
39
|
});
|
|
61
40
|
|
|
62
|
-
export const
|
|
63
|
-
|
|
41
|
+
export const stepErrorSchema = z.object({
|
|
42
|
+
error: z.string().optional(),
|
|
43
|
+
validation: jsonElementSchema.optional(),
|
|
64
44
|
});
|
|
65
45
|
|
|
66
46
|
export const httpMethodSchema = z.union([
|
|
@@ -71,77 +51,23 @@ export const httpMethodSchema = z.union([
|
|
|
71
51
|
z.literal('DELETE'),
|
|
72
52
|
]);
|
|
73
53
|
|
|
74
|
-
export const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
54
|
+
export const errorResponseBodySchema = z.object({
|
|
55
|
+
refreshFormUrl: z.string().optional(),
|
|
56
|
+
analytics: z.record(z.string()).optional(),
|
|
57
|
+
error: z.string().optional(),
|
|
58
|
+
validation: jsonElementSchema.optional(),
|
|
59
|
+
refreshUrl: z.string().optional(),
|
|
78
60
|
});
|
|
79
61
|
|
|
80
|
-
export const
|
|
81
|
-
z.literal('
|
|
82
|
-
z.literal('
|
|
83
|
-
z.literal('
|
|
62
|
+
export const stringSchemaFormatSchema = z.union([
|
|
63
|
+
z.literal('date'),
|
|
64
|
+
z.literal('email'),
|
|
65
|
+
z.literal('numeric'),
|
|
66
|
+
z.literal('password'),
|
|
67
|
+
z.literal('phone-number'),
|
|
68
|
+
z.literal('base64url'),
|
|
84
69
|
]);
|
|
85
70
|
|
|
86
|
-
export const headingLayoutSchema = z.object({
|
|
87
|
-
type: z.literal('heading'),
|
|
88
|
-
text: z.string(),
|
|
89
|
-
size: sizeSchema.optional(),
|
|
90
|
-
align: alignSchema.optional(),
|
|
91
|
-
control: z.string().optional(),
|
|
92
|
-
margin: sizeSchema.optional(),
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
export const formLayoutSchema = z.object({
|
|
96
|
-
type: z.literal('form'),
|
|
97
|
-
schema: formLayoutSchemaReferenceSchema.optional(),
|
|
98
|
-
schemaId: z.string(),
|
|
99
|
-
control: z.string().optional(),
|
|
100
|
-
margin: sizeSchema.optional(),
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
export const imageLayoutSchema = z.object({
|
|
104
|
-
type: z.literal('image'),
|
|
105
|
-
text: z.string().optional(),
|
|
106
|
-
url: z.string(),
|
|
107
|
-
size: sizeSchema.optional(),
|
|
108
|
-
accessibilityDescription: z.string().optional(),
|
|
109
|
-
control: z.string().optional(),
|
|
110
|
-
margin: sizeSchema.optional(),
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
export const infoLayoutSchema = z.object({
|
|
114
|
-
type: z.literal('info'),
|
|
115
|
-
markdown: z.string(),
|
|
116
|
-
align: alignSchema.optional(),
|
|
117
|
-
control: z.string().optional(),
|
|
118
|
-
margin: sizeSchema.optional(),
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
export const loadingIndicatorLayoutSchema = z.object({
|
|
122
|
-
type: z.literal('loading-indicator'),
|
|
123
|
-
size: sizeSchema.optional(),
|
|
124
|
-
control: z.string().optional(),
|
|
125
|
-
margin: sizeSchema.optional(),
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
export const paragraphLayoutSchema = z.object({
|
|
129
|
-
type: z.literal('paragraph'),
|
|
130
|
-
text: z.string(),
|
|
131
|
-
align: alignSchema.optional(),
|
|
132
|
-
control: z.string().optional(),
|
|
133
|
-
margin: sizeSchema.optional(),
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
export const instructionsLayoutItemSchema = z.object({
|
|
137
|
-
text: z.string(),
|
|
138
|
-
context: contextSchema,
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
export const helpSchema = z.object({
|
|
142
|
-
markdown: z.string(),
|
|
143
|
-
});
|
|
144
|
-
|
|
145
71
|
export const imageSchema = z.object({
|
|
146
72
|
text: z.string().optional(),
|
|
147
73
|
url: z.string(),
|
|
@@ -161,6 +87,8 @@ export const validateAsyncSchema = z.object({
|
|
|
161
87
|
url: z.string(),
|
|
162
88
|
});
|
|
163
89
|
|
|
90
|
+
export const uploadSourceSchema = z.union([z.literal('camera'), z.literal('file')]);
|
|
91
|
+
|
|
164
92
|
export const autocompleteTokenSchema = z.union([
|
|
165
93
|
z.literal('on'),
|
|
166
94
|
z.literal('name'),
|
|
@@ -227,51 +155,152 @@ export const autocompleteTokenSchema = z.union([
|
|
|
227
155
|
z.literal('pager'),
|
|
228
156
|
]);
|
|
229
157
|
|
|
230
|
-
export const
|
|
231
|
-
z.
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
z.
|
|
236
|
-
|
|
158
|
+
export const helpSchema = z.object({
|
|
159
|
+
markdown: z.string(),
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
export const iconNamedSchema = z.object({
|
|
163
|
+
name: z.string(),
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
export const iconTextSchema = z.object({
|
|
167
|
+
text: z.string(),
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
export const contextSchema = z.union([
|
|
171
|
+
z.literal('positive'),
|
|
172
|
+
z.literal('neutral'),
|
|
173
|
+
z.literal('warning'),
|
|
174
|
+
z.literal('negative'),
|
|
175
|
+
z.literal('success'),
|
|
176
|
+
z.literal('failure'),
|
|
177
|
+
z.literal('info'),
|
|
178
|
+
z.literal('primary'),
|
|
237
179
|
]);
|
|
238
180
|
|
|
239
|
-
export const
|
|
240
|
-
z
|
|
241
|
-
.union([
|
|
242
|
-
z.string(),
|
|
243
|
-
z.number(),
|
|
244
|
-
z.boolean(),
|
|
245
|
-
z.record(jsonElementSchema),
|
|
246
|
-
z.array(jsonElementSchema),
|
|
247
|
-
])
|
|
248
|
-
.nullable(),
|
|
249
|
-
);
|
|
181
|
+
export const alignSchema = z.union([z.literal('left'), z.literal('center'), z.literal('right')]);
|
|
250
182
|
|
|
251
|
-
export const
|
|
183
|
+
export const sizeSchema = z.union([
|
|
184
|
+
z.literal('xs'),
|
|
185
|
+
z.literal('sm'),
|
|
186
|
+
z.literal('md'),
|
|
187
|
+
z.literal('lg'),
|
|
188
|
+
z.literal('xl'),
|
|
189
|
+
]);
|
|
252
190
|
|
|
253
|
-
export const
|
|
254
|
-
|
|
191
|
+
export const listLayoutStatusSchema = z.union([
|
|
192
|
+
z.literal('warning'),
|
|
193
|
+
z.literal('neutral'),
|
|
194
|
+
z.literal('positive'),
|
|
195
|
+
]);
|
|
196
|
+
|
|
197
|
+
export const modalLayoutTriggerSchema = z.object({
|
|
198
|
+
title: z.string(),
|
|
255
199
|
});
|
|
256
200
|
|
|
257
|
-
export const
|
|
258
|
-
|
|
259
|
-
|
|
201
|
+
export const columnsLayoutBiasSchema = z.union([
|
|
202
|
+
z.literal('none'),
|
|
203
|
+
z.literal('left'),
|
|
204
|
+
z.literal('right'),
|
|
205
|
+
]);
|
|
206
|
+
|
|
207
|
+
export const markdownLayoutSchema = z.object({
|
|
208
|
+
type: z.literal('markdown'),
|
|
209
|
+
content: z.string(),
|
|
210
|
+
align: alignSchema.optional(),
|
|
211
|
+
control: z.string().optional(),
|
|
212
|
+
margin: sizeSchema.optional(),
|
|
260
213
|
});
|
|
261
214
|
|
|
262
|
-
export const
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
215
|
+
export const statusListLayoutStatusSchema = z.union([
|
|
216
|
+
z.literal('not-done'),
|
|
217
|
+
z.literal('pending'),
|
|
218
|
+
z.literal('done'),
|
|
219
|
+
]);
|
|
220
|
+
|
|
221
|
+
export const paragraphLayoutSchema = z.object({
|
|
222
|
+
type: z.literal('paragraph'),
|
|
223
|
+
text: z.string(),
|
|
224
|
+
align: alignSchema.optional(),
|
|
225
|
+
control: z.string().optional(),
|
|
226
|
+
margin: sizeSchema.optional(),
|
|
268
227
|
});
|
|
269
228
|
|
|
270
|
-
export const
|
|
271
|
-
|
|
229
|
+
export const infoLayoutSchema = z.object({
|
|
230
|
+
type: z.literal('info'),
|
|
231
|
+
markdown: z.string(),
|
|
232
|
+
align: alignSchema.optional(),
|
|
233
|
+
control: z.string().optional(),
|
|
234
|
+
margin: sizeSchema.optional(),
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
export const formLayoutSchemaReferenceSchema = z.object({
|
|
238
|
+
$ref: z.string(),
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
export const reviewLayoutFieldSchema = z.object({
|
|
242
|
+
label: z.string(),
|
|
243
|
+
value: z.string(),
|
|
244
|
+
rawValue: z.string().optional(),
|
|
245
|
+
help: helpSchema.optional(),
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
export const instructionsLayoutItemSchema = z.object({
|
|
249
|
+
text: z.string(),
|
|
250
|
+
context: contextSchema,
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
export const dividerLayoutSchema = z.object({
|
|
254
|
+
type: z.literal('divider'),
|
|
255
|
+
control: z.string().optional(),
|
|
256
|
+
margin: sizeSchema.optional(),
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
export const formLayoutSchema = z.object({
|
|
260
|
+
type: z.literal('form'),
|
|
261
|
+
schema: formLayoutSchemaReferenceSchema.optional(),
|
|
262
|
+
schemaId: z.string(),
|
|
263
|
+
control: z.string().optional(),
|
|
264
|
+
margin: sizeSchema.optional(),
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
export const headingLayoutSchema = z.object({
|
|
268
|
+
type: z.literal('heading'),
|
|
269
|
+
text: z.string(),
|
|
270
|
+
size: sizeSchema.optional(),
|
|
271
|
+
align: alignSchema.optional(),
|
|
272
|
+
control: z.string().optional(),
|
|
273
|
+
margin: sizeSchema.optional(),
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
export const instructionsLayoutSchema = z.object({
|
|
277
|
+
type: z.literal('instructions'),
|
|
278
|
+
title: z.string().optional(),
|
|
279
|
+
items: z.array(instructionsLayoutItemSchema),
|
|
280
|
+
control: z.string().optional(),
|
|
281
|
+
margin: sizeSchema.optional(),
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
export const loadingIndicatorLayoutSchema = z.object({
|
|
285
|
+
type: z.literal('loading-indicator'),
|
|
286
|
+
size: sizeSchema.optional(),
|
|
287
|
+
control: z.string().optional(),
|
|
288
|
+
margin: sizeSchema.optional(),
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
export const searchLayoutSchema = z.object({
|
|
292
|
+
type: z.literal('search'),
|
|
293
|
+
title: z.string(),
|
|
272
294
|
method: httpMethodSchema,
|
|
295
|
+
url: z.string(),
|
|
273
296
|
param: z.string(),
|
|
274
|
-
|
|
297
|
+
emptyMessage: z.string().optional(),
|
|
298
|
+
control: z.string().optional(),
|
|
299
|
+
margin: sizeSchema.optional(),
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
export const linkSchema = z.object({
|
|
303
|
+
url: z.string(),
|
|
275
304
|
});
|
|
276
305
|
|
|
277
306
|
export const navigationStackBehaviorSchema = z.union([
|
|
@@ -281,10 +310,6 @@ export const navigationStackBehaviorSchema = z.union([
|
|
|
281
310
|
z.literal('replace-current'),
|
|
282
311
|
]);
|
|
283
312
|
|
|
284
|
-
export const linkSchema = z.object({
|
|
285
|
-
url: z.string(),
|
|
286
|
-
});
|
|
287
|
-
|
|
288
313
|
export const actionTypeSchema = z.union([
|
|
289
314
|
z.literal('primary'),
|
|
290
315
|
z.literal('secondary'),
|
|
@@ -293,14 +318,6 @@ export const actionTypeSchema = z.union([
|
|
|
293
318
|
z.literal('negative'),
|
|
294
319
|
]);
|
|
295
320
|
|
|
296
|
-
export const iconNamedSchema = z.object({
|
|
297
|
-
name: z.string(),
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
export const iconTextSchema = z.object({
|
|
301
|
-
text: z.string(),
|
|
302
|
-
});
|
|
303
|
-
|
|
304
321
|
export const actionSchema = z.object({
|
|
305
322
|
title: z.string().optional(),
|
|
306
323
|
type: actionTypeSchema.optional(),
|
|
@@ -317,56 +334,41 @@ export const actionSchema = z.object({
|
|
|
317
334
|
skipValidation: z.boolean().optional(),
|
|
318
335
|
});
|
|
319
336
|
|
|
320
|
-
export const
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
align: alignSchema.optional(),
|
|
324
|
-
control: z.string().optional(),
|
|
325
|
-
margin: sizeSchema.optional(),
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
export const searchLayoutSchema = z.object({
|
|
329
|
-
type: z.literal('search'),
|
|
330
|
-
title: z.string(),
|
|
331
|
-
method: httpMethodSchema,
|
|
332
|
-
url: z.string(),
|
|
333
|
-
param: z.string(),
|
|
334
|
-
emptyMessage: z.string().optional(),
|
|
335
|
-
control: z.string().optional(),
|
|
336
|
-
margin: sizeSchema.optional(),
|
|
337
|
+
export const linkHandlerSchema = z.object({
|
|
338
|
+
regexPattern: z.string(),
|
|
339
|
+
action: actionSchema,
|
|
337
340
|
});
|
|
338
341
|
|
|
339
|
-
export const
|
|
340
|
-
title: z.string(),
|
|
342
|
+
export const actionResponseBodySchema = z.object({
|
|
341
343
|
action: actionSchema,
|
|
342
344
|
});
|
|
343
345
|
|
|
344
|
-
export const
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
margin: sizeSchema.optional(),
|
|
346
|
+
export const searchSearchRequestSchema = z.object({
|
|
347
|
+
url: z.string(),
|
|
348
|
+
method: httpMethodSchema,
|
|
349
|
+
param: z.string(),
|
|
350
|
+
query: z.string(),
|
|
350
351
|
});
|
|
351
352
|
|
|
352
353
|
export const iconSchema = z.union([iconNamedSchema, iconTextSchema]);
|
|
353
354
|
|
|
354
|
-
export const
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
rawValue: z.string().optional(),
|
|
363
|
-
help: helpSchema.optional(),
|
|
355
|
+
export const imageLayoutSchema = z.object({
|
|
356
|
+
type: z.literal('image'),
|
|
357
|
+
text: z.string().optional(),
|
|
358
|
+
url: z.string(),
|
|
359
|
+
size: sizeSchema.optional(),
|
|
360
|
+
accessibilityDescription: z.string().optional(),
|
|
361
|
+
control: z.string().optional(),
|
|
362
|
+
margin: sizeSchema.optional(),
|
|
364
363
|
});
|
|
365
364
|
|
|
366
|
-
export const
|
|
365
|
+
export const searchResultActionSchema = z.object({
|
|
366
|
+
type: z.literal('action'),
|
|
367
367
|
title: z.string(),
|
|
368
|
-
|
|
369
|
-
|
|
368
|
+
description: z.string().optional(),
|
|
369
|
+
icon: iconSchema.optional(),
|
|
370
|
+
image: imageLayoutSchema.optional(),
|
|
371
|
+
value: actionSchema,
|
|
370
372
|
});
|
|
371
373
|
|
|
372
374
|
export const summarySummariserSchema = z.object({
|
|
@@ -380,31 +382,56 @@ export const summarySummariserSchema = z.object({
|
|
|
380
382
|
providesImage: z.boolean().optional(),
|
|
381
383
|
});
|
|
382
384
|
|
|
383
|
-
export const
|
|
384
|
-
|
|
385
|
-
|
|
385
|
+
export const listLayoutItemSchema = z.object({
|
|
386
|
+
title: z.string(),
|
|
387
|
+
description: z.string().optional(),
|
|
388
|
+
icon: iconSchema,
|
|
389
|
+
status: listLayoutStatusSchema.optional(),
|
|
386
390
|
});
|
|
387
391
|
|
|
388
|
-
export const
|
|
389
|
-
|
|
392
|
+
export const listLayoutSchema = z.object({
|
|
393
|
+
type: z.literal('list'),
|
|
394
|
+
items: z.array(listLayoutItemSchema),
|
|
395
|
+
title: z.string().optional(),
|
|
396
|
+
control: z.string().optional(),
|
|
397
|
+
margin: sizeSchema.optional(),
|
|
390
398
|
});
|
|
391
399
|
|
|
392
|
-
export const
|
|
393
|
-
|
|
400
|
+
export const decisionLayoutOptionSchema = z.object({
|
|
401
|
+
action: actionSchema,
|
|
394
402
|
title: z.string(),
|
|
395
403
|
description: z.string().optional(),
|
|
404
|
+
disabled: z.boolean().optional(),
|
|
396
405
|
icon: iconSchema.optional(),
|
|
397
406
|
image: imageLayoutSchema.optional(),
|
|
398
|
-
value: searchSearchRequestSchema,
|
|
399
407
|
});
|
|
400
408
|
|
|
401
|
-
export const
|
|
402
|
-
type: z.literal('action'),
|
|
409
|
+
export const reviewLayoutCallToActionSchema = z.object({
|
|
403
410
|
title: z.string(),
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
411
|
+
action: actionSchema,
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
export const buttonLayoutSchema = z.object({
|
|
415
|
+
type: z.literal('button'),
|
|
416
|
+
size: sizeSchema.optional(),
|
|
417
|
+
title: z.string().optional(),
|
|
418
|
+
action: actionSchema,
|
|
419
|
+
context: contextSchema.optional(),
|
|
420
|
+
disabled: z.boolean().optional(),
|
|
421
|
+
pinOrder: z.number().optional(),
|
|
422
|
+
control: z.string().optional(),
|
|
423
|
+
margin: sizeSchema.optional(),
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
export const behaviorSchema = z.object({
|
|
427
|
+
action: actionSchema.optional(),
|
|
428
|
+
link: linkSchema.optional(),
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
export const alertLayoutCallToActionSchema = z.object({
|
|
432
|
+
title: z.string(),
|
|
433
|
+
accessibilityDescription: z.string().optional(),
|
|
434
|
+
behavior: behaviorSchema,
|
|
408
435
|
});
|
|
409
436
|
|
|
410
437
|
export const pollingOnErrorSchema = z.object({
|
|
@@ -416,27 +443,30 @@ export const navigationBackBehaviorSchema = z.object({
|
|
|
416
443
|
action: actionSchema,
|
|
417
444
|
});
|
|
418
445
|
|
|
419
|
-
export const summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
|
|
420
|
-
|
|
421
|
-
export const
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
446
|
+
export const summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
|
|
447
|
+
|
|
448
|
+
export const pollingSchema = z.object({
|
|
449
|
+
url: z.string(),
|
|
450
|
+
interval: z.number().optional(),
|
|
451
|
+
delay: z.number().optional(),
|
|
452
|
+
timeout: z.number().optional(),
|
|
453
|
+
maxAttempts: z.number(),
|
|
454
|
+
onError: pollingOnErrorSchema,
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
export const navigationSchema = z.object({
|
|
458
|
+
backButton: navigationBackBehaviorSchema.optional(),
|
|
459
|
+
back: navigationBackBehaviorSchema.optional(),
|
|
460
|
+
stackBehavior: navigationStackBehaviorSchema.optional(),
|
|
431
461
|
});
|
|
432
462
|
|
|
433
|
-
export const
|
|
434
|
-
|
|
463
|
+
export const searchResultSearchSchema = z.object({
|
|
464
|
+
type: z.literal('search'),
|
|
435
465
|
title: z.string(),
|
|
436
466
|
description: z.string().optional(),
|
|
437
|
-
disabled: z.boolean().optional(),
|
|
438
467
|
icon: iconSchema.optional(),
|
|
439
468
|
image: imageLayoutSchema.optional(),
|
|
469
|
+
value: searchSearchRequestSchema,
|
|
440
470
|
});
|
|
441
471
|
|
|
442
472
|
export const alertLayoutSchema = z.object({
|
|
@@ -448,6 +478,20 @@ export const alertLayoutSchema = z.object({
|
|
|
448
478
|
callToAction: alertLayoutCallToActionSchema.optional(),
|
|
449
479
|
});
|
|
450
480
|
|
|
481
|
+
export const itemCallToActionSchema = z.object({
|
|
482
|
+
title: z.string(),
|
|
483
|
+
accessibilityDescription: z.string().optional(),
|
|
484
|
+
behavior: behaviorSchema,
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
export const decisionLayoutSchema = z.object({
|
|
488
|
+
type: z.literal('decision'),
|
|
489
|
+
title: z.string().optional(),
|
|
490
|
+
options: z.array(decisionLayoutOptionSchema),
|
|
491
|
+
control: z.string().optional(),
|
|
492
|
+
margin: sizeSchema.optional(),
|
|
493
|
+
});
|
|
494
|
+
|
|
451
495
|
export const reviewLayoutSchema = z.object({
|
|
452
496
|
type: z.literal('review'),
|
|
453
497
|
orientation: z.string().optional(),
|
|
@@ -459,26 +503,7 @@ export const reviewLayoutSchema = z.object({
|
|
|
459
503
|
margin: sizeSchema.optional(),
|
|
460
504
|
});
|
|
461
505
|
|
|
462
|
-
export const
|
|
463
|
-
title: z.string(),
|
|
464
|
-
description: z.string().optional(),
|
|
465
|
-
icon: iconSchema,
|
|
466
|
-
status: listLayoutStatusSchema.optional(),
|
|
467
|
-
});
|
|
468
|
-
|
|
469
|
-
export const itemCallToActionSchema = z.object({
|
|
470
|
-
title: z.string(),
|
|
471
|
-
accessibilityDescription: z.string().optional(),
|
|
472
|
-
behavior: behaviorSchema,
|
|
473
|
-
});
|
|
474
|
-
|
|
475
|
-
export const statusListLayoutItemSchema = z.object({
|
|
476
|
-
title: z.string(),
|
|
477
|
-
description: z.string().optional(),
|
|
478
|
-
icon: iconSchema,
|
|
479
|
-
status: statusListLayoutStatusSchema.optional(),
|
|
480
|
-
callToAction: itemCallToActionSchema.optional(),
|
|
481
|
-
});
|
|
506
|
+
export const searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
|
|
482
507
|
|
|
483
508
|
export const blobSchemaSchema = z.object({
|
|
484
509
|
type: z.literal('blob'),
|
|
@@ -520,37 +545,12 @@ export const constSchemaSchema = z.object({
|
|
|
520
545
|
disabled: z.boolean().optional(),
|
|
521
546
|
});
|
|
522
547
|
|
|
523
|
-
export const
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
onError: pollingOnErrorSchema,
|
|
530
|
-
});
|
|
531
|
-
|
|
532
|
-
export const navigationSchema = z.object({
|
|
533
|
-
backButton: navigationBackBehaviorSchema.optional(),
|
|
534
|
-
back: navigationBackBehaviorSchema.optional(),
|
|
535
|
-
stackBehavior: navigationStackBehaviorSchema.optional(),
|
|
536
|
-
});
|
|
537
|
-
|
|
538
|
-
export const searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
|
|
539
|
-
|
|
540
|
-
export const decisionLayoutSchema = z.object({
|
|
541
|
-
type: z.literal('decision'),
|
|
542
|
-
title: z.string().optional(),
|
|
543
|
-
options: z.array(decisionLayoutOptionSchema),
|
|
544
|
-
control: z.string().optional(),
|
|
545
|
-
margin: sizeSchema.optional(),
|
|
546
|
-
});
|
|
547
|
-
|
|
548
|
-
export const listLayoutSchema = z.object({
|
|
549
|
-
type: z.literal('list'),
|
|
550
|
-
items: z.array(listLayoutItemSchema),
|
|
551
|
-
title: z.string().optional(),
|
|
552
|
-
control: z.string().optional(),
|
|
553
|
-
margin: sizeSchema.optional(),
|
|
548
|
+
export const statusListLayoutItemSchema = z.object({
|
|
549
|
+
title: z.string(),
|
|
550
|
+
description: z.string().optional(),
|
|
551
|
+
icon: iconSchema,
|
|
552
|
+
status: statusListLayoutStatusSchema.optional(),
|
|
553
|
+
callToAction: itemCallToActionSchema.optional(),
|
|
554
554
|
});
|
|
555
555
|
|
|
556
556
|
export const statusListLayoutSchema = z.object({
|
|
@@ -565,17 +565,43 @@ export const searchResponseBodySchema = z.object({
|
|
|
565
565
|
results: z.array(searchResultSchema),
|
|
566
566
|
});
|
|
567
567
|
|
|
568
|
-
export const
|
|
568
|
+
export const stepSchema: z.ZodSchema<Step> = z.lazy(() =>
|
|
569
569
|
z.object({
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
570
|
+
key: z.string().optional(),
|
|
571
|
+
type: z.string().optional(),
|
|
572
|
+
actions: z.array(actionSchema).optional(),
|
|
573
|
+
refreshFormUrl: z.string().optional(),
|
|
574
|
+
id: z.string(),
|
|
575
|
+
title: z.string(),
|
|
576
|
+
schemas: z.array(schemaSchema),
|
|
577
|
+
layout: z.array(layoutSchema),
|
|
578
|
+
description: z.string().optional(),
|
|
579
|
+
model: jsonElementSchema.optional(),
|
|
580
|
+
external: externalSchema.optional(),
|
|
581
|
+
polling: pollingSchema.optional(),
|
|
582
|
+
linkHandlers: z.array(linkHandlerSchema).optional(),
|
|
583
|
+
analytics: z.record(z.string()).optional(),
|
|
584
|
+
errors: stepErrorSchema.optional(),
|
|
585
|
+
navigation: navigationSchema.optional(),
|
|
586
|
+
refreshUrl: z.string().optional(),
|
|
576
587
|
}),
|
|
577
588
|
);
|
|
578
589
|
|
|
590
|
+
export const schemaSchema: z.ZodSchema<Schema> = z.lazy(() =>
|
|
591
|
+
z.union([
|
|
592
|
+
allOfSchemaSchema,
|
|
593
|
+
arraySchemaSchema,
|
|
594
|
+
blobSchemaSchema,
|
|
595
|
+
booleanSchemaSchema,
|
|
596
|
+
constSchemaSchema,
|
|
597
|
+
integerSchemaSchema,
|
|
598
|
+
numberSchemaSchema,
|
|
599
|
+
objectSchemaSchema,
|
|
600
|
+
oneOfSchemaSchema,
|
|
601
|
+
stringSchemaSchema,
|
|
602
|
+
]),
|
|
603
|
+
);
|
|
604
|
+
|
|
579
605
|
export const layoutSchema: z.ZodSchema<Layout> = z.lazy(() =>
|
|
580
606
|
z.union([
|
|
581
607
|
alertLayoutSchema,
|
|
@@ -600,49 +626,6 @@ export const layoutSchema: z.ZodSchema<Layout> = z.lazy(() =>
|
|
|
600
626
|
]),
|
|
601
627
|
);
|
|
602
628
|
|
|
603
|
-
export const modalLayoutSchema: z.ZodSchema<ModalLayout> = z.lazy(() =>
|
|
604
|
-
z.object({
|
|
605
|
-
type: z.literal('modal'),
|
|
606
|
-
control: z.string().optional(),
|
|
607
|
-
margin: sizeSchema.optional(),
|
|
608
|
-
trigger: modalLayoutTriggerSchema,
|
|
609
|
-
content: modalLayoutContentSchema,
|
|
610
|
-
}),
|
|
611
|
-
);
|
|
612
|
-
|
|
613
|
-
export const modalLayoutContentSchema: z.ZodSchema<ModalLayoutContent> = z.lazy(() =>
|
|
614
|
-
z.object({
|
|
615
|
-
title: z.string().optional(),
|
|
616
|
-
components: z.array(layoutSchema),
|
|
617
|
-
}),
|
|
618
|
-
);
|
|
619
|
-
|
|
620
|
-
export const boxLayoutSchema: z.ZodSchema<BoxLayout> = z.lazy(() =>
|
|
621
|
-
z.object({
|
|
622
|
-
type: z.literal('box'),
|
|
623
|
-
components: z.array(layoutSchema),
|
|
624
|
-
width: sizeSchema.optional(),
|
|
625
|
-
border: z.boolean().optional(),
|
|
626
|
-
control: z.string().optional(),
|
|
627
|
-
margin: sizeSchema.optional(),
|
|
628
|
-
}),
|
|
629
|
-
);
|
|
630
|
-
|
|
631
|
-
export const schemaSchema: z.ZodSchema<Schema> = z.lazy(() =>
|
|
632
|
-
z.union([
|
|
633
|
-
allOfSchemaSchema,
|
|
634
|
-
arraySchemaSchema,
|
|
635
|
-
blobSchemaSchema,
|
|
636
|
-
booleanSchemaSchema,
|
|
637
|
-
constSchemaSchema,
|
|
638
|
-
integerSchemaSchema,
|
|
639
|
-
numberSchemaSchema,
|
|
640
|
-
objectSchemaSchema,
|
|
641
|
-
oneOfSchemaSchema,
|
|
642
|
-
stringSchemaSchema,
|
|
643
|
-
]),
|
|
644
|
-
);
|
|
645
|
-
|
|
646
629
|
export const allOfSchemaSchema: z.ZodSchema<AllOfSchema> = z.lazy(() =>
|
|
647
630
|
z.object({
|
|
648
631
|
disabled: z.boolean().optional(),
|
|
@@ -870,12 +853,17 @@ export const persistAsyncSchema: z.ZodSchema<PersistAsync> = z.lazy(() =>
|
|
|
870
853
|
}),
|
|
871
854
|
);
|
|
872
855
|
|
|
873
|
-
export const
|
|
856
|
+
export const arraySchemaListSchema: z.ZodSchema<ArraySchemaList> = z.lazy(() =>
|
|
874
857
|
z.object({
|
|
875
858
|
type: z.literal('array'),
|
|
876
859
|
promoted: z.boolean().optional(),
|
|
877
860
|
$id: z.string().optional(),
|
|
878
|
-
items:
|
|
861
|
+
items: schemaSchema,
|
|
862
|
+
addItemTitle: z.string(),
|
|
863
|
+
editItemTitle: z.string(),
|
|
864
|
+
minItems: z.number().optional(),
|
|
865
|
+
maxItems: z.number().optional(),
|
|
866
|
+
placeholder: z.string().optional(),
|
|
879
867
|
title: z.string().optional(),
|
|
880
868
|
description: z.string().optional(),
|
|
881
869
|
control: z.string().optional(),
|
|
@@ -883,25 +871,22 @@ export const arraySchemaTupleSchema: z.ZodSchema<ArraySchemaTuple> = z.lazy(() =
|
|
|
883
871
|
icon: iconSchema.optional(),
|
|
884
872
|
image: imageSchema.optional(),
|
|
885
873
|
keywords: z.array(z.string()).optional(),
|
|
886
|
-
summary:
|
|
874
|
+
summary: summarySummariserSchema.optional(),
|
|
887
875
|
analyticsId: z.string().optional(),
|
|
888
876
|
persistAsync: persistAsyncSchema.optional(),
|
|
889
877
|
validationAsync: validateAsyncSchema.optional(),
|
|
890
878
|
alert: alertLayoutSchema.optional(),
|
|
879
|
+
validationMessages: z.record(z.string()).optional(),
|
|
880
|
+
disabled: z.boolean().optional(),
|
|
891
881
|
}),
|
|
892
882
|
);
|
|
893
883
|
|
|
894
|
-
export const
|
|
884
|
+
export const arraySchemaTupleSchema: z.ZodSchema<ArraySchemaTuple> = z.lazy(() =>
|
|
895
885
|
z.object({
|
|
896
886
|
type: z.literal('array'),
|
|
897
887
|
promoted: z.boolean().optional(),
|
|
898
888
|
$id: z.string().optional(),
|
|
899
|
-
items: schemaSchema,
|
|
900
|
-
addItemTitle: z.string(),
|
|
901
|
-
editItemTitle: z.string(),
|
|
902
|
-
minItems: z.number().optional(),
|
|
903
|
-
maxItems: z.number().optional(),
|
|
904
|
-
placeholder: z.string().optional(),
|
|
889
|
+
items: z.array(schemaSchema),
|
|
905
890
|
title: z.string().optional(),
|
|
906
891
|
description: z.string().optional(),
|
|
907
892
|
control: z.string().optional(),
|
|
@@ -909,34 +894,49 @@ export const arraySchemaListSchema: z.ZodSchema<ArraySchemaList> = z.lazy(() =>
|
|
|
909
894
|
icon: iconSchema.optional(),
|
|
910
895
|
image: imageSchema.optional(),
|
|
911
896
|
keywords: z.array(z.string()).optional(),
|
|
912
|
-
summary:
|
|
897
|
+
summary: summaryProviderSchema.optional(),
|
|
913
898
|
analyticsId: z.string().optional(),
|
|
914
899
|
persistAsync: persistAsyncSchema.optional(),
|
|
915
900
|
validationAsync: validateAsyncSchema.optional(),
|
|
916
901
|
alert: alertLayoutSchema.optional(),
|
|
917
|
-
validationMessages: z.record(z.string()).optional(),
|
|
918
|
-
disabled: z.boolean().optional(),
|
|
919
902
|
}),
|
|
920
903
|
);
|
|
921
904
|
|
|
922
|
-
export const
|
|
905
|
+
export const modalLayoutSchema: z.ZodSchema<ModalLayout> = z.lazy(() =>
|
|
923
906
|
z.object({
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
907
|
+
type: z.literal('modal'),
|
|
908
|
+
control: z.string().optional(),
|
|
909
|
+
margin: sizeSchema.optional(),
|
|
910
|
+
trigger: modalLayoutTriggerSchema,
|
|
911
|
+
content: modalLayoutContentSchema,
|
|
912
|
+
}),
|
|
913
|
+
);
|
|
914
|
+
|
|
915
|
+
export const modalLayoutContentSchema: z.ZodSchema<ModalLayoutContent> = z.lazy(() =>
|
|
916
|
+
z.object({
|
|
917
|
+
title: z.string().optional(),
|
|
918
|
+
components: z.array(layoutSchema),
|
|
919
|
+
}),
|
|
920
|
+
);
|
|
921
|
+
|
|
922
|
+
export const columnsLayoutSchema: z.ZodSchema<ColumnsLayout> = z.lazy(() =>
|
|
923
|
+
z.object({
|
|
924
|
+
type: z.literal('columns'),
|
|
925
|
+
left: z.array(layoutSchema),
|
|
926
|
+
right: z.array(layoutSchema),
|
|
927
|
+
bias: columnsLayoutBiasSchema.optional(),
|
|
928
|
+
control: z.string().optional(),
|
|
929
|
+
margin: sizeSchema.optional(),
|
|
930
|
+
}),
|
|
931
|
+
);
|
|
932
|
+
|
|
933
|
+
export const boxLayoutSchema: z.ZodSchema<BoxLayout> = z.lazy(() =>
|
|
934
|
+
z.object({
|
|
935
|
+
type: z.literal('box'),
|
|
936
|
+
components: z.array(layoutSchema),
|
|
937
|
+
width: sizeSchema.optional(),
|
|
938
|
+
border: z.boolean().optional(),
|
|
939
|
+
control: z.string().optional(),
|
|
940
|
+
margin: sizeSchema.optional(),
|
|
941
941
|
}),
|
|
942
942
|
);
|