@wise/dynamic-flow-types 2.29.0 → 2.30.0
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/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,76 +51,29 @@ 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
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
});
|
|
71
|
+
export const autocapitalizationTypeSchema = z.union([
|
|
72
|
+
z.literal('none'),
|
|
73
|
+
z.literal('characters'),
|
|
74
|
+
z.literal('sentences'),
|
|
75
|
+
z.literal('words'),
|
|
76
|
+
]);
|
|
144
77
|
|
|
145
78
|
export const imageSchema = z.object({
|
|
146
79
|
text: z.string().optional(),
|
|
@@ -161,6 +94,8 @@ export const validateAsyncSchema = z.object({
|
|
|
161
94
|
url: z.string(),
|
|
162
95
|
});
|
|
163
96
|
|
|
97
|
+
export const uploadSourceSchema = z.union([z.literal('camera'), z.literal('file')]);
|
|
98
|
+
|
|
164
99
|
export const autocompleteTokenSchema = z.union([
|
|
165
100
|
z.literal('on'),
|
|
166
101
|
z.literal('name'),
|
|
@@ -227,51 +162,152 @@ export const autocompleteTokenSchema = z.union([
|
|
|
227
162
|
z.literal('pager'),
|
|
228
163
|
]);
|
|
229
164
|
|
|
230
|
-
export const
|
|
231
|
-
z.
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
z.
|
|
236
|
-
|
|
165
|
+
export const helpSchema = z.object({
|
|
166
|
+
markdown: z.string(),
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
export const iconNamedSchema = z.object({
|
|
170
|
+
name: z.string(),
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
export const iconTextSchema = z.object({
|
|
174
|
+
text: z.string(),
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
export const contextSchema = z.union([
|
|
178
|
+
z.literal('positive'),
|
|
179
|
+
z.literal('neutral'),
|
|
180
|
+
z.literal('warning'),
|
|
181
|
+
z.literal('negative'),
|
|
182
|
+
z.literal('success'),
|
|
183
|
+
z.literal('failure'),
|
|
184
|
+
z.literal('info'),
|
|
185
|
+
z.literal('primary'),
|
|
237
186
|
]);
|
|
238
187
|
|
|
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
|
-
);
|
|
188
|
+
export const alignSchema = z.union([z.literal('left'), z.literal('center'), z.literal('right')]);
|
|
250
189
|
|
|
251
|
-
export const
|
|
190
|
+
export const sizeSchema = z.union([
|
|
191
|
+
z.literal('xs'),
|
|
192
|
+
z.literal('sm'),
|
|
193
|
+
z.literal('md'),
|
|
194
|
+
z.literal('lg'),
|
|
195
|
+
z.literal('xl'),
|
|
196
|
+
]);
|
|
252
197
|
|
|
253
|
-
export const
|
|
254
|
-
|
|
198
|
+
export const listLayoutStatusSchema = z.union([
|
|
199
|
+
z.literal('warning'),
|
|
200
|
+
z.literal('neutral'),
|
|
201
|
+
z.literal('positive'),
|
|
202
|
+
]);
|
|
203
|
+
|
|
204
|
+
export const modalLayoutTriggerSchema = z.object({
|
|
205
|
+
title: z.string(),
|
|
255
206
|
});
|
|
256
207
|
|
|
257
|
-
export const
|
|
258
|
-
|
|
259
|
-
|
|
208
|
+
export const columnsLayoutBiasSchema = z.union([
|
|
209
|
+
z.literal('none'),
|
|
210
|
+
z.literal('left'),
|
|
211
|
+
z.literal('right'),
|
|
212
|
+
]);
|
|
213
|
+
|
|
214
|
+
export const markdownLayoutSchema = z.object({
|
|
215
|
+
type: z.literal('markdown'),
|
|
216
|
+
content: z.string(),
|
|
217
|
+
align: alignSchema.optional(),
|
|
218
|
+
control: z.string().optional(),
|
|
219
|
+
margin: sizeSchema.optional(),
|
|
260
220
|
});
|
|
261
221
|
|
|
262
|
-
export const
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
222
|
+
export const statusListLayoutStatusSchema = z.union([
|
|
223
|
+
z.literal('not-done'),
|
|
224
|
+
z.literal('pending'),
|
|
225
|
+
z.literal('done'),
|
|
226
|
+
]);
|
|
227
|
+
|
|
228
|
+
export const paragraphLayoutSchema = z.object({
|
|
229
|
+
type: z.literal('paragraph'),
|
|
230
|
+
text: z.string(),
|
|
231
|
+
align: alignSchema.optional(),
|
|
232
|
+
control: z.string().optional(),
|
|
233
|
+
margin: sizeSchema.optional(),
|
|
268
234
|
});
|
|
269
235
|
|
|
270
|
-
export const
|
|
271
|
-
|
|
236
|
+
export const infoLayoutSchema = z.object({
|
|
237
|
+
type: z.literal('info'),
|
|
238
|
+
markdown: z.string(),
|
|
239
|
+
align: alignSchema.optional(),
|
|
240
|
+
control: z.string().optional(),
|
|
241
|
+
margin: sizeSchema.optional(),
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
export const formLayoutSchemaReferenceSchema = z.object({
|
|
245
|
+
$ref: z.string(),
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
export const reviewLayoutFieldSchema = z.object({
|
|
249
|
+
label: z.string(),
|
|
250
|
+
value: z.string(),
|
|
251
|
+
rawValue: z.string().optional(),
|
|
252
|
+
help: helpSchema.optional(),
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
export const instructionsLayoutItemSchema = z.object({
|
|
256
|
+
text: z.string(),
|
|
257
|
+
context: contextSchema,
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
export const dividerLayoutSchema = z.object({
|
|
261
|
+
type: z.literal('divider'),
|
|
262
|
+
control: z.string().optional(),
|
|
263
|
+
margin: sizeSchema.optional(),
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
export const formLayoutSchema = z.object({
|
|
267
|
+
type: z.literal('form'),
|
|
268
|
+
schema: formLayoutSchemaReferenceSchema.optional(),
|
|
269
|
+
schemaId: z.string(),
|
|
270
|
+
control: z.string().optional(),
|
|
271
|
+
margin: sizeSchema.optional(),
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
export const headingLayoutSchema = z.object({
|
|
275
|
+
type: z.literal('heading'),
|
|
276
|
+
text: z.string(),
|
|
277
|
+
size: sizeSchema.optional(),
|
|
278
|
+
align: alignSchema.optional(),
|
|
279
|
+
control: z.string().optional(),
|
|
280
|
+
margin: sizeSchema.optional(),
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
export const instructionsLayoutSchema = z.object({
|
|
284
|
+
type: z.literal('instructions'),
|
|
285
|
+
title: z.string().optional(),
|
|
286
|
+
items: z.array(instructionsLayoutItemSchema),
|
|
287
|
+
control: z.string().optional(),
|
|
288
|
+
margin: sizeSchema.optional(),
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
export const loadingIndicatorLayoutSchema = z.object({
|
|
292
|
+
type: z.literal('loading-indicator'),
|
|
293
|
+
size: sizeSchema.optional(),
|
|
294
|
+
control: z.string().optional(),
|
|
295
|
+
margin: sizeSchema.optional(),
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
export const searchLayoutSchema = z.object({
|
|
299
|
+
type: z.literal('search'),
|
|
300
|
+
title: z.string(),
|
|
272
301
|
method: httpMethodSchema,
|
|
302
|
+
url: z.string(),
|
|
273
303
|
param: z.string(),
|
|
274
|
-
|
|
304
|
+
emptyMessage: z.string().optional(),
|
|
305
|
+
control: z.string().optional(),
|
|
306
|
+
margin: sizeSchema.optional(),
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
export const linkSchema = z.object({
|
|
310
|
+
url: z.string(),
|
|
275
311
|
});
|
|
276
312
|
|
|
277
313
|
export const navigationStackBehaviorSchema = z.union([
|
|
@@ -281,10 +317,6 @@ export const navigationStackBehaviorSchema = z.union([
|
|
|
281
317
|
z.literal('replace-current'),
|
|
282
318
|
]);
|
|
283
319
|
|
|
284
|
-
export const linkSchema = z.object({
|
|
285
|
-
url: z.string(),
|
|
286
|
-
});
|
|
287
|
-
|
|
288
320
|
export const actionTypeSchema = z.union([
|
|
289
321
|
z.literal('primary'),
|
|
290
322
|
z.literal('secondary'),
|
|
@@ -293,14 +325,6 @@ export const actionTypeSchema = z.union([
|
|
|
293
325
|
z.literal('negative'),
|
|
294
326
|
]);
|
|
295
327
|
|
|
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
328
|
export const actionSchema = z.object({
|
|
305
329
|
title: z.string().optional(),
|
|
306
330
|
type: actionTypeSchema.optional(),
|
|
@@ -317,56 +341,41 @@ export const actionSchema = z.object({
|
|
|
317
341
|
skipValidation: z.boolean().optional(),
|
|
318
342
|
});
|
|
319
343
|
|
|
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(),
|
|
344
|
+
export const linkHandlerSchema = z.object({
|
|
345
|
+
regexPattern: z.string(),
|
|
346
|
+
action: actionSchema,
|
|
337
347
|
});
|
|
338
348
|
|
|
339
|
-
export const
|
|
340
|
-
title: z.string(),
|
|
349
|
+
export const actionResponseBodySchema = z.object({
|
|
341
350
|
action: actionSchema,
|
|
342
351
|
});
|
|
343
352
|
|
|
344
|
-
export const
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
margin: sizeSchema.optional(),
|
|
353
|
+
export const searchSearchRequestSchema = z.object({
|
|
354
|
+
url: z.string(),
|
|
355
|
+
method: httpMethodSchema,
|
|
356
|
+
param: z.string(),
|
|
357
|
+
query: z.string(),
|
|
350
358
|
});
|
|
351
359
|
|
|
352
360
|
export const iconSchema = z.union([iconNamedSchema, iconTextSchema]);
|
|
353
361
|
|
|
354
|
-
export const
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
rawValue: z.string().optional(),
|
|
363
|
-
help: helpSchema.optional(),
|
|
362
|
+
export const imageLayoutSchema = z.object({
|
|
363
|
+
type: z.literal('image'),
|
|
364
|
+
text: z.string().optional(),
|
|
365
|
+
url: z.string(),
|
|
366
|
+
size: sizeSchema.optional(),
|
|
367
|
+
accessibilityDescription: z.string().optional(),
|
|
368
|
+
control: z.string().optional(),
|
|
369
|
+
margin: sizeSchema.optional(),
|
|
364
370
|
});
|
|
365
371
|
|
|
366
|
-
export const
|
|
372
|
+
export const searchResultActionSchema = z.object({
|
|
373
|
+
type: z.literal('action'),
|
|
367
374
|
title: z.string(),
|
|
368
|
-
|
|
369
|
-
|
|
375
|
+
description: z.string().optional(),
|
|
376
|
+
icon: iconSchema.optional(),
|
|
377
|
+
image: imageLayoutSchema.optional(),
|
|
378
|
+
value: actionSchema,
|
|
370
379
|
});
|
|
371
380
|
|
|
372
381
|
export const summarySummariserSchema = z.object({
|
|
@@ -380,31 +389,56 @@ export const summarySummariserSchema = z.object({
|
|
|
380
389
|
providesImage: z.boolean().optional(),
|
|
381
390
|
});
|
|
382
391
|
|
|
383
|
-
export const
|
|
384
|
-
|
|
385
|
-
|
|
392
|
+
export const listLayoutItemSchema = z.object({
|
|
393
|
+
title: z.string(),
|
|
394
|
+
description: z.string().optional(),
|
|
395
|
+
icon: iconSchema,
|
|
396
|
+
status: listLayoutStatusSchema.optional(),
|
|
386
397
|
});
|
|
387
398
|
|
|
388
|
-
export const
|
|
389
|
-
|
|
399
|
+
export const listLayoutSchema = z.object({
|
|
400
|
+
type: z.literal('list'),
|
|
401
|
+
items: z.array(listLayoutItemSchema),
|
|
402
|
+
title: z.string().optional(),
|
|
403
|
+
control: z.string().optional(),
|
|
404
|
+
margin: sizeSchema.optional(),
|
|
390
405
|
});
|
|
391
406
|
|
|
392
|
-
export const
|
|
393
|
-
|
|
407
|
+
export const decisionLayoutOptionSchema = z.object({
|
|
408
|
+
action: actionSchema,
|
|
394
409
|
title: z.string(),
|
|
395
410
|
description: z.string().optional(),
|
|
411
|
+
disabled: z.boolean().optional(),
|
|
396
412
|
icon: iconSchema.optional(),
|
|
397
413
|
image: imageLayoutSchema.optional(),
|
|
398
|
-
value: searchSearchRequestSchema,
|
|
399
414
|
});
|
|
400
415
|
|
|
401
|
-
export const
|
|
402
|
-
type: z.literal('action'),
|
|
416
|
+
export const reviewLayoutCallToActionSchema = z.object({
|
|
403
417
|
title: z.string(),
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
418
|
+
action: actionSchema,
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
export const buttonLayoutSchema = z.object({
|
|
422
|
+
type: z.literal('button'),
|
|
423
|
+
size: sizeSchema.optional(),
|
|
424
|
+
title: z.string().optional(),
|
|
425
|
+
action: actionSchema,
|
|
426
|
+
context: contextSchema.optional(),
|
|
427
|
+
disabled: z.boolean().optional(),
|
|
428
|
+
pinOrder: z.number().optional(),
|
|
429
|
+
control: z.string().optional(),
|
|
430
|
+
margin: sizeSchema.optional(),
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
export const behaviorSchema = z.object({
|
|
434
|
+
action: actionSchema.optional(),
|
|
435
|
+
link: linkSchema.optional(),
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
export const alertLayoutCallToActionSchema = z.object({
|
|
439
|
+
title: z.string(),
|
|
440
|
+
accessibilityDescription: z.string().optional(),
|
|
441
|
+
behavior: behaviorSchema,
|
|
408
442
|
});
|
|
409
443
|
|
|
410
444
|
export const pollingOnErrorSchema = z.object({
|
|
@@ -416,27 +450,30 @@ export const navigationBackBehaviorSchema = z.object({
|
|
|
416
450
|
action: actionSchema,
|
|
417
451
|
});
|
|
418
452
|
|
|
419
|
-
export const summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
|
|
420
|
-
|
|
421
|
-
export const
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
453
|
+
export const summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
|
|
454
|
+
|
|
455
|
+
export const pollingSchema = z.object({
|
|
456
|
+
url: z.string(),
|
|
457
|
+
interval: z.number().optional(),
|
|
458
|
+
delay: z.number().optional(),
|
|
459
|
+
timeout: z.number().optional(),
|
|
460
|
+
maxAttempts: z.number(),
|
|
461
|
+
onError: pollingOnErrorSchema,
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
export const navigationSchema = z.object({
|
|
465
|
+
backButton: navigationBackBehaviorSchema.optional(),
|
|
466
|
+
back: navigationBackBehaviorSchema.optional(),
|
|
467
|
+
stackBehavior: navigationStackBehaviorSchema.optional(),
|
|
431
468
|
});
|
|
432
469
|
|
|
433
|
-
export const
|
|
434
|
-
|
|
470
|
+
export const searchResultSearchSchema = z.object({
|
|
471
|
+
type: z.literal('search'),
|
|
435
472
|
title: z.string(),
|
|
436
473
|
description: z.string().optional(),
|
|
437
|
-
disabled: z.boolean().optional(),
|
|
438
474
|
icon: iconSchema.optional(),
|
|
439
475
|
image: imageLayoutSchema.optional(),
|
|
476
|
+
value: searchSearchRequestSchema,
|
|
440
477
|
});
|
|
441
478
|
|
|
442
479
|
export const alertLayoutSchema = z.object({
|
|
@@ -448,6 +485,20 @@ export const alertLayoutSchema = z.object({
|
|
|
448
485
|
callToAction: alertLayoutCallToActionSchema.optional(),
|
|
449
486
|
});
|
|
450
487
|
|
|
488
|
+
export const itemCallToActionSchema = z.object({
|
|
489
|
+
title: z.string(),
|
|
490
|
+
accessibilityDescription: z.string().optional(),
|
|
491
|
+
behavior: behaviorSchema,
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
export const decisionLayoutSchema = z.object({
|
|
495
|
+
type: z.literal('decision'),
|
|
496
|
+
title: z.string().optional(),
|
|
497
|
+
options: z.array(decisionLayoutOptionSchema),
|
|
498
|
+
control: z.string().optional(),
|
|
499
|
+
margin: sizeSchema.optional(),
|
|
500
|
+
});
|
|
501
|
+
|
|
451
502
|
export const reviewLayoutSchema = z.object({
|
|
452
503
|
type: z.literal('review'),
|
|
453
504
|
orientation: z.string().optional(),
|
|
@@ -459,26 +510,7 @@ export const reviewLayoutSchema = z.object({
|
|
|
459
510
|
margin: sizeSchema.optional(),
|
|
460
511
|
});
|
|
461
512
|
|
|
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
|
-
});
|
|
513
|
+
export const searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
|
|
482
514
|
|
|
483
515
|
export const blobSchemaSchema = z.object({
|
|
484
516
|
type: z.literal('blob'),
|
|
@@ -520,37 +552,12 @@ export const constSchemaSchema = z.object({
|
|
|
520
552
|
disabled: z.boolean().optional(),
|
|
521
553
|
});
|
|
522
554
|
|
|
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(),
|
|
555
|
+
export const statusListLayoutItemSchema = z.object({
|
|
556
|
+
title: z.string(),
|
|
557
|
+
description: z.string().optional(),
|
|
558
|
+
icon: iconSchema,
|
|
559
|
+
status: statusListLayoutStatusSchema.optional(),
|
|
560
|
+
callToAction: itemCallToActionSchema.optional(),
|
|
554
561
|
});
|
|
555
562
|
|
|
556
563
|
export const statusListLayoutSchema = z.object({
|
|
@@ -565,17 +572,43 @@ export const searchResponseBodySchema = z.object({
|
|
|
565
572
|
results: z.array(searchResultSchema),
|
|
566
573
|
});
|
|
567
574
|
|
|
568
|
-
export const
|
|
575
|
+
export const stepSchema: z.ZodSchema<Step> = z.lazy(() =>
|
|
569
576
|
z.object({
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
577
|
+
key: z.string().optional(),
|
|
578
|
+
type: z.string().optional(),
|
|
579
|
+
actions: z.array(actionSchema).optional(),
|
|
580
|
+
refreshFormUrl: z.string().optional(),
|
|
581
|
+
id: z.string(),
|
|
582
|
+
title: z.string(),
|
|
583
|
+
schemas: z.array(schemaSchema),
|
|
584
|
+
layout: z.array(layoutSchema),
|
|
585
|
+
description: z.string().optional(),
|
|
586
|
+
model: jsonElementSchema.optional(),
|
|
587
|
+
external: externalSchema.optional(),
|
|
588
|
+
polling: pollingSchema.optional(),
|
|
589
|
+
linkHandlers: z.array(linkHandlerSchema).optional(),
|
|
590
|
+
analytics: z.record(z.string()).optional(),
|
|
591
|
+
errors: stepErrorSchema.optional(),
|
|
592
|
+
navigation: navigationSchema.optional(),
|
|
593
|
+
refreshUrl: z.string().optional(),
|
|
576
594
|
}),
|
|
577
595
|
);
|
|
578
596
|
|
|
597
|
+
export const schemaSchema: z.ZodSchema<Schema> = z.lazy(() =>
|
|
598
|
+
z.union([
|
|
599
|
+
allOfSchemaSchema,
|
|
600
|
+
arraySchemaSchema,
|
|
601
|
+
blobSchemaSchema,
|
|
602
|
+
booleanSchemaSchema,
|
|
603
|
+
constSchemaSchema,
|
|
604
|
+
integerSchemaSchema,
|
|
605
|
+
numberSchemaSchema,
|
|
606
|
+
objectSchemaSchema,
|
|
607
|
+
oneOfSchemaSchema,
|
|
608
|
+
stringSchemaSchema,
|
|
609
|
+
]),
|
|
610
|
+
);
|
|
611
|
+
|
|
579
612
|
export const layoutSchema: z.ZodSchema<Layout> = z.lazy(() =>
|
|
580
613
|
z.union([
|
|
581
614
|
alertLayoutSchema,
|
|
@@ -600,49 +633,6 @@ export const layoutSchema: z.ZodSchema<Layout> = z.lazy(() =>
|
|
|
600
633
|
]),
|
|
601
634
|
);
|
|
602
635
|
|
|
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
636
|
export const allOfSchemaSchema: z.ZodSchema<AllOfSchema> = z.lazy(() =>
|
|
647
637
|
z.object({
|
|
648
638
|
disabled: z.boolean().optional(),
|
|
@@ -833,6 +823,7 @@ export const stringSchemaSchema: z.ZodSchema<StringSchema> = z.lazy(() =>
|
|
|
833
823
|
minimum: z.string().optional(),
|
|
834
824
|
maximum: z.string().optional(),
|
|
835
825
|
pattern: z.string().optional(),
|
|
826
|
+
autocapitalization: autocapitalizationTypeSchema.optional(),
|
|
836
827
|
$id: z.string().optional(),
|
|
837
828
|
title: z.string().optional(),
|
|
838
829
|
description: z.string().optional(),
|
|
@@ -870,12 +861,17 @@ export const persistAsyncSchema: z.ZodSchema<PersistAsync> = z.lazy(() =>
|
|
|
870
861
|
}),
|
|
871
862
|
);
|
|
872
863
|
|
|
873
|
-
export const
|
|
864
|
+
export const arraySchemaListSchema: z.ZodSchema<ArraySchemaList> = z.lazy(() =>
|
|
874
865
|
z.object({
|
|
875
866
|
type: z.literal('array'),
|
|
876
867
|
promoted: z.boolean().optional(),
|
|
877
868
|
$id: z.string().optional(),
|
|
878
|
-
items:
|
|
869
|
+
items: schemaSchema,
|
|
870
|
+
addItemTitle: z.string(),
|
|
871
|
+
editItemTitle: z.string(),
|
|
872
|
+
minItems: z.number().optional(),
|
|
873
|
+
maxItems: z.number().optional(),
|
|
874
|
+
placeholder: z.string().optional(),
|
|
879
875
|
title: z.string().optional(),
|
|
880
876
|
description: z.string().optional(),
|
|
881
877
|
control: z.string().optional(),
|
|
@@ -883,25 +879,22 @@ export const arraySchemaTupleSchema: z.ZodSchema<ArraySchemaTuple> = z.lazy(() =
|
|
|
883
879
|
icon: iconSchema.optional(),
|
|
884
880
|
image: imageSchema.optional(),
|
|
885
881
|
keywords: z.array(z.string()).optional(),
|
|
886
|
-
summary:
|
|
882
|
+
summary: summarySummariserSchema.optional(),
|
|
887
883
|
analyticsId: z.string().optional(),
|
|
888
884
|
persistAsync: persistAsyncSchema.optional(),
|
|
889
885
|
validationAsync: validateAsyncSchema.optional(),
|
|
890
886
|
alert: alertLayoutSchema.optional(),
|
|
887
|
+
validationMessages: z.record(z.string()).optional(),
|
|
888
|
+
disabled: z.boolean().optional(),
|
|
891
889
|
}),
|
|
892
890
|
);
|
|
893
891
|
|
|
894
|
-
export const
|
|
892
|
+
export const arraySchemaTupleSchema: z.ZodSchema<ArraySchemaTuple> = z.lazy(() =>
|
|
895
893
|
z.object({
|
|
896
894
|
type: z.literal('array'),
|
|
897
895
|
promoted: z.boolean().optional(),
|
|
898
896
|
$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(),
|
|
897
|
+
items: z.array(schemaSchema),
|
|
905
898
|
title: z.string().optional(),
|
|
906
899
|
description: z.string().optional(),
|
|
907
900
|
control: z.string().optional(),
|
|
@@ -909,34 +902,49 @@ export const arraySchemaListSchema: z.ZodSchema<ArraySchemaList> = z.lazy(() =>
|
|
|
909
902
|
icon: iconSchema.optional(),
|
|
910
903
|
image: imageSchema.optional(),
|
|
911
904
|
keywords: z.array(z.string()).optional(),
|
|
912
|
-
summary:
|
|
905
|
+
summary: summaryProviderSchema.optional(),
|
|
913
906
|
analyticsId: z.string().optional(),
|
|
914
907
|
persistAsync: persistAsyncSchema.optional(),
|
|
915
908
|
validationAsync: validateAsyncSchema.optional(),
|
|
916
909
|
alert: alertLayoutSchema.optional(),
|
|
917
|
-
validationMessages: z.record(z.string()).optional(),
|
|
918
|
-
disabled: z.boolean().optional(),
|
|
919
910
|
}),
|
|
920
911
|
);
|
|
921
912
|
|
|
922
|
-
export const
|
|
913
|
+
export const modalLayoutSchema: z.ZodSchema<ModalLayout> = z.lazy(() =>
|
|
923
914
|
z.object({
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
915
|
+
type: z.literal('modal'),
|
|
916
|
+
control: z.string().optional(),
|
|
917
|
+
margin: sizeSchema.optional(),
|
|
918
|
+
trigger: modalLayoutTriggerSchema,
|
|
919
|
+
content: modalLayoutContentSchema,
|
|
920
|
+
}),
|
|
921
|
+
);
|
|
922
|
+
|
|
923
|
+
export const modalLayoutContentSchema: z.ZodSchema<ModalLayoutContent> = z.lazy(() =>
|
|
924
|
+
z.object({
|
|
925
|
+
title: z.string().optional(),
|
|
926
|
+
components: z.array(layoutSchema),
|
|
927
|
+
}),
|
|
928
|
+
);
|
|
929
|
+
|
|
930
|
+
export const columnsLayoutSchema: z.ZodSchema<ColumnsLayout> = z.lazy(() =>
|
|
931
|
+
z.object({
|
|
932
|
+
type: z.literal('columns'),
|
|
933
|
+
left: z.array(layoutSchema),
|
|
934
|
+
right: z.array(layoutSchema),
|
|
935
|
+
bias: columnsLayoutBiasSchema.optional(),
|
|
936
|
+
control: z.string().optional(),
|
|
937
|
+
margin: sizeSchema.optional(),
|
|
938
|
+
}),
|
|
939
|
+
);
|
|
940
|
+
|
|
941
|
+
export const boxLayoutSchema: z.ZodSchema<BoxLayout> = z.lazy(() =>
|
|
942
|
+
z.object({
|
|
943
|
+
type: z.literal('box'),
|
|
944
|
+
components: z.array(layoutSchema),
|
|
945
|
+
width: sizeSchema.optional(),
|
|
946
|
+
border: z.boolean().optional(),
|
|
947
|
+
control: z.string().optional(),
|
|
948
|
+
margin: sizeSchema.optional(),
|
|
941
949
|
}),
|
|
942
950
|
);
|