@wise/dynamic-flow-types 2.6.1 → 2.6.3
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 +4477 -0
- package/build/main.min.js +1 -0
- package/build/next/index.d.ts +6 -0
- package/build/zod/schemas.d.ts +16 -40
- package/build/zod/schemas.ts +906 -0
- package/package.json +9 -4
|
@@ -0,0 +1,906 @@
|
|
|
1
|
+
// Generated by ts-to-zod
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type {
|
|
4
|
+
JsonElement,
|
|
5
|
+
Layout,
|
|
6
|
+
BoxLayout,
|
|
7
|
+
ColumnsLayout,
|
|
8
|
+
ModalLayout,
|
|
9
|
+
ModalLayoutContent,
|
|
10
|
+
PersistAsync,
|
|
11
|
+
Schema,
|
|
12
|
+
AllOfSchema,
|
|
13
|
+
ObjectSchema,
|
|
14
|
+
ArraySchema,
|
|
15
|
+
ArraySchemaList,
|
|
16
|
+
ArraySchemaTuple,
|
|
17
|
+
BooleanSchema,
|
|
18
|
+
IntegerSchema,
|
|
19
|
+
NumberSchema,
|
|
20
|
+
OneOfSchema,
|
|
21
|
+
StringSchema,
|
|
22
|
+
Step,
|
|
23
|
+
} from '../next';
|
|
24
|
+
|
|
25
|
+
export const imageSchema = z.object({
|
|
26
|
+
url: z.string(),
|
|
27
|
+
text: z.string().optional(),
|
|
28
|
+
accessibilityDescription: z.string().optional(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const sizeSchema = z.union([
|
|
32
|
+
z.literal('xs'),
|
|
33
|
+
z.literal('sm'),
|
|
34
|
+
z.literal('md'),
|
|
35
|
+
z.literal('lg'),
|
|
36
|
+
z.literal('xl'),
|
|
37
|
+
]);
|
|
38
|
+
|
|
39
|
+
export const iconNamedSchema = z.object({
|
|
40
|
+
name: z.string(),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const iconTextSchema = z.object({
|
|
44
|
+
text: z.string(),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export const autocompleteTokenSchema = z.union([
|
|
48
|
+
z.literal('on'),
|
|
49
|
+
z.literal('name'),
|
|
50
|
+
z.literal('name-prefix'),
|
|
51
|
+
z.literal('given-name'),
|
|
52
|
+
z.literal('additional-name'),
|
|
53
|
+
z.literal('family-name'),
|
|
54
|
+
z.literal('name-suffix'),
|
|
55
|
+
z.literal('nickname'),
|
|
56
|
+
z.literal('email'),
|
|
57
|
+
z.literal('username'),
|
|
58
|
+
z.literal('new-username'),
|
|
59
|
+
z.literal('new-password'),
|
|
60
|
+
z.literal('password'),
|
|
61
|
+
z.literal('one-time-code'),
|
|
62
|
+
z.literal('job-title'),
|
|
63
|
+
z.literal('organization-name'),
|
|
64
|
+
z.literal('full-street-address'),
|
|
65
|
+
z.literal('street-address-line-1'),
|
|
66
|
+
z.literal('street-address-line-2'),
|
|
67
|
+
z.literal('street-address-line-3'),
|
|
68
|
+
z.literal('address-level-1'),
|
|
69
|
+
z.literal('address-level-2'),
|
|
70
|
+
z.literal('address-level-3'),
|
|
71
|
+
z.literal('address-level-4'),
|
|
72
|
+
z.literal('country-code'),
|
|
73
|
+
z.literal('country-name'),
|
|
74
|
+
z.literal('postal-code'),
|
|
75
|
+
z.literal('credit-card-name'),
|
|
76
|
+
z.literal('credit-card-given-name'),
|
|
77
|
+
z.literal('credit-card-middle-name'),
|
|
78
|
+
z.literal('credit-card-family-name'),
|
|
79
|
+
z.literal('credit-card-number'),
|
|
80
|
+
z.literal('credit-card-expiration'),
|
|
81
|
+
z.literal('credit-card-expiration-month'),
|
|
82
|
+
z.literal('credit-card-expiration-year'),
|
|
83
|
+
z.literal('credit-card-security-code'),
|
|
84
|
+
z.literal('credit-card-type'),
|
|
85
|
+
z.literal('transaction-currency'),
|
|
86
|
+
z.literal('transaction-amount'),
|
|
87
|
+
z.literal('language'),
|
|
88
|
+
z.literal('birthdate'),
|
|
89
|
+
z.literal('birthdate-day'),
|
|
90
|
+
z.literal('birthdate-month'),
|
|
91
|
+
z.literal('birthdate-year'),
|
|
92
|
+
z.literal('gender'),
|
|
93
|
+
z.literal('phone-number'),
|
|
94
|
+
z.literal('phone-country-code'),
|
|
95
|
+
z.literal('phone-national'),
|
|
96
|
+
z.literal('phone-area-code'),
|
|
97
|
+
z.literal('phone-local'),
|
|
98
|
+
z.literal('phone-local-prefix'),
|
|
99
|
+
z.literal('phone-local-suffix'),
|
|
100
|
+
z.literal('phone-extension'),
|
|
101
|
+
z.literal('url'),
|
|
102
|
+
z.literal('photo'),
|
|
103
|
+
z.literal('impp'),
|
|
104
|
+
z.literal('shipping'),
|
|
105
|
+
z.literal('billing'),
|
|
106
|
+
z.literal('home'),
|
|
107
|
+
z.literal('work'),
|
|
108
|
+
z.literal('mobile'),
|
|
109
|
+
z.literal('fax'),
|
|
110
|
+
z.literal('pager'),
|
|
111
|
+
]);
|
|
112
|
+
|
|
113
|
+
export const alignSchema = z.union([z.literal('left'), z.literal('center'), z.literal('right')]);
|
|
114
|
+
|
|
115
|
+
export const contextSchema = z.union([
|
|
116
|
+
z.literal('positive'),
|
|
117
|
+
z.literal('neutral'),
|
|
118
|
+
z.literal('warning'),
|
|
119
|
+
z.literal('negative'),
|
|
120
|
+
z.literal('success'),
|
|
121
|
+
z.literal('failure'),
|
|
122
|
+
z.literal('info'),
|
|
123
|
+
z.literal('primary'),
|
|
124
|
+
]);
|
|
125
|
+
|
|
126
|
+
export const httpMethodSchema = z.union([
|
|
127
|
+
z.literal('GET'),
|
|
128
|
+
z.literal('POST'),
|
|
129
|
+
z.literal('PUT'),
|
|
130
|
+
z.literal('PATCH'),
|
|
131
|
+
z.literal('DELETE'),
|
|
132
|
+
]);
|
|
133
|
+
|
|
134
|
+
export const jsonElementSchema: z.ZodSchema<JsonElement> = z.lazy(() =>
|
|
135
|
+
z
|
|
136
|
+
.union([
|
|
137
|
+
z.string(),
|
|
138
|
+
z.number(),
|
|
139
|
+
z.boolean(),
|
|
140
|
+
z.record(jsonElementSchema),
|
|
141
|
+
z.array(jsonElementSchema),
|
|
142
|
+
])
|
|
143
|
+
.nullable(),
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
export const searchSearchRequestSchema = z.object({
|
|
147
|
+
url: z.string(),
|
|
148
|
+
method: httpMethodSchema,
|
|
149
|
+
param: z.string(),
|
|
150
|
+
query: z.string(),
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
export const imageLayoutSchema = z.object({
|
|
154
|
+
type: z.literal('image'),
|
|
155
|
+
url: z.string(),
|
|
156
|
+
size: sizeSchema.optional(),
|
|
157
|
+
control: z.string().optional(),
|
|
158
|
+
margin: sizeSchema.optional(),
|
|
159
|
+
text: z.string().optional(),
|
|
160
|
+
accessibilityDescription: z.string().optional(),
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
export const listLayoutStatusSchema = z.union([
|
|
164
|
+
z.literal('warning'),
|
|
165
|
+
z.literal('neutral'),
|
|
166
|
+
z.literal('positive'),
|
|
167
|
+
]);
|
|
168
|
+
|
|
169
|
+
export const paragraphLayoutSchema = z.object({
|
|
170
|
+
type: z.literal('paragraph'),
|
|
171
|
+
text: z.string(),
|
|
172
|
+
align: alignSchema.optional(),
|
|
173
|
+
control: z.string().optional(),
|
|
174
|
+
margin: sizeSchema.optional(),
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
export const dividerLayoutSchema = z.object({
|
|
178
|
+
type: z.literal('divider'),
|
|
179
|
+
control: z.string().optional(),
|
|
180
|
+
margin: sizeSchema.optional(),
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
export const instructionsLayoutItemSchema = z.object({
|
|
184
|
+
text: z.string(),
|
|
185
|
+
context: contextSchema,
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
export const helpSchema = z.object({
|
|
189
|
+
markdown: z.string(),
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
export const alertLayoutSchema = z.object({
|
|
193
|
+
type: z.literal('alert'),
|
|
194
|
+
markdown: z.string(),
|
|
195
|
+
context: contextSchema.optional(),
|
|
196
|
+
control: z.string().optional(),
|
|
197
|
+
margin: sizeSchema.optional(),
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
export const headingLayoutSchema = z.object({
|
|
201
|
+
type: z.literal('heading'),
|
|
202
|
+
text: z.string(),
|
|
203
|
+
size: sizeSchema.optional(),
|
|
204
|
+
align: alignSchema.optional(),
|
|
205
|
+
control: z.string().optional(),
|
|
206
|
+
margin: sizeSchema.optional(),
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
export const infoLayoutSchema = z.object({
|
|
210
|
+
type: z.literal('info'),
|
|
211
|
+
markdown: z.string(),
|
|
212
|
+
align: alignSchema.optional(),
|
|
213
|
+
control: z.string().optional(),
|
|
214
|
+
margin: sizeSchema.optional(),
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
export const instructionsLayoutSchema = z.object({
|
|
218
|
+
type: z.literal('instructions'),
|
|
219
|
+
title: z.string().optional(),
|
|
220
|
+
items: z.array(instructionsLayoutItemSchema),
|
|
221
|
+
control: z.string().optional(),
|
|
222
|
+
margin: sizeSchema.optional(),
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
export const loadingIndicatorLayoutSchema = z.object({
|
|
226
|
+
type: z.literal('loading-indicator'),
|
|
227
|
+
size: sizeSchema.optional(),
|
|
228
|
+
control: z.string().optional(),
|
|
229
|
+
margin: sizeSchema.optional(),
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
export const markdownLayoutSchema = z.object({
|
|
233
|
+
type: z.literal('markdown'),
|
|
234
|
+
content: z.string(),
|
|
235
|
+
align: alignSchema.optional(),
|
|
236
|
+
control: z.string().optional(),
|
|
237
|
+
margin: sizeSchema.optional(),
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
export const searchLayoutSchema = z.object({
|
|
241
|
+
type: z.literal('search'),
|
|
242
|
+
title: z.string(),
|
|
243
|
+
method: httpMethodSchema,
|
|
244
|
+
url: z.string(),
|
|
245
|
+
param: z.string(),
|
|
246
|
+
emptyMessage: z.string().optional(),
|
|
247
|
+
control: z.string().optional(),
|
|
248
|
+
margin: sizeSchema.optional(),
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
export const columnsLayoutBiasSchema = z.union([
|
|
252
|
+
z.literal('none'),
|
|
253
|
+
z.literal('left'),
|
|
254
|
+
z.literal('right'),
|
|
255
|
+
]);
|
|
256
|
+
|
|
257
|
+
export const formLayoutSchemaReferenceSchema = z.object({
|
|
258
|
+
$ref: z.string(),
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
export const modalLayoutTriggerSchema = z.object({
|
|
262
|
+
title: z.string(),
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
export const statusListLayoutStatusSchema = z.union([
|
|
266
|
+
z.literal('not-done'),
|
|
267
|
+
z.literal('pending'),
|
|
268
|
+
z.literal('done'),
|
|
269
|
+
]);
|
|
270
|
+
|
|
271
|
+
export const actionTypeSchema = z.union([
|
|
272
|
+
z.literal('primary'),
|
|
273
|
+
z.literal('secondary'),
|
|
274
|
+
z.literal('link'),
|
|
275
|
+
z.literal('positive'),
|
|
276
|
+
z.literal('negative'),
|
|
277
|
+
]);
|
|
278
|
+
|
|
279
|
+
export const stepErrorSchema = z.object({
|
|
280
|
+
error: z.string().optional(),
|
|
281
|
+
validation: jsonElementSchema.optional(),
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
export const validateAsyncSchema = z.object({
|
|
285
|
+
param: z.string(),
|
|
286
|
+
method: httpMethodSchema,
|
|
287
|
+
url: z.string(),
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
export const summaryProviderSchema = z.object({
|
|
291
|
+
providesTitle: z.boolean().optional(),
|
|
292
|
+
providesDescription: z.boolean().optional(),
|
|
293
|
+
providesIcon: z.boolean().optional(),
|
|
294
|
+
providesImage: z.boolean().optional(),
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
export const externalSchema = z.object({
|
|
298
|
+
url: z.string(),
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
export const stringSchemaFormatSchema = z.union([
|
|
302
|
+
z.literal('date'),
|
|
303
|
+
z.literal('email'),
|
|
304
|
+
z.literal('numeric'),
|
|
305
|
+
z.literal('password'),
|
|
306
|
+
z.literal('phone-number'),
|
|
307
|
+
z.literal('base64url'),
|
|
308
|
+
]);
|
|
309
|
+
|
|
310
|
+
export const blobSchemaSourceSchema = z.union([z.literal('file'), z.literal('camera')]);
|
|
311
|
+
|
|
312
|
+
export const stringSchemaSourceSchema = z.union([z.literal('camera'), z.literal('file')]);
|
|
313
|
+
|
|
314
|
+
export const iconSchema = z.union([iconNamedSchema, iconTextSchema]);
|
|
315
|
+
|
|
316
|
+
export const errorResponseBodySchema = z.object({
|
|
317
|
+
error: z.string().optional(),
|
|
318
|
+
validation: jsonElementSchema.optional(),
|
|
319
|
+
refreshUrl: z.string().optional(),
|
|
320
|
+
refreshFormUrl: z.string().optional(),
|
|
321
|
+
analytics: z.record(z.string()).optional(),
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
export const searchResultSearchSchema = z.object({
|
|
325
|
+
type: z.literal('search'),
|
|
326
|
+
title: z.string(),
|
|
327
|
+
description: z.string().optional(),
|
|
328
|
+
icon: iconSchema.optional(),
|
|
329
|
+
image: imageLayoutSchema.optional(),
|
|
330
|
+
value: searchSearchRequestSchema,
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
export const actionSchema = z.object({
|
|
334
|
+
id: z.string().optional(),
|
|
335
|
+
url: z.string().optional(),
|
|
336
|
+
method: httpMethodSchema.optional(),
|
|
337
|
+
exit: z.boolean().optional(),
|
|
338
|
+
result: jsonElementSchema.optional(),
|
|
339
|
+
data: jsonElementSchema.optional(),
|
|
340
|
+
timeout: z.number().optional(),
|
|
341
|
+
title: z.string().optional(),
|
|
342
|
+
type: actionTypeSchema.optional(),
|
|
343
|
+
disabled: z.boolean().optional(),
|
|
344
|
+
$id: z.string().optional(),
|
|
345
|
+
$ref: z.string().optional(),
|
|
346
|
+
skipValidation: z.boolean().optional(),
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
export const actionResponseBodySchema = z.object({
|
|
350
|
+
action: actionSchema,
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
export const listLayoutItemSchema = z.object({
|
|
354
|
+
title: z.string(),
|
|
355
|
+
description: z.string().optional(),
|
|
356
|
+
icon: iconSchema,
|
|
357
|
+
status: listLayoutStatusSchema.optional(),
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
export const reviewLayoutFieldSchema = z.object({
|
|
361
|
+
label: z.string(),
|
|
362
|
+
value: z.string(),
|
|
363
|
+
help: helpSchema.optional(),
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
export const buttonLayoutSchema = z.object({
|
|
367
|
+
type: z.literal('button'),
|
|
368
|
+
title: z.string().optional(),
|
|
369
|
+
action: actionSchema,
|
|
370
|
+
context: contextSchema.optional(),
|
|
371
|
+
disabled: z.boolean().optional(),
|
|
372
|
+
pinOrder: z.number().optional(),
|
|
373
|
+
control: z.string().optional(),
|
|
374
|
+
margin: sizeSchema.optional(),
|
|
375
|
+
size: sizeSchema.optional(),
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
export const formLayoutSchema = z.object({
|
|
379
|
+
type: z.literal('form'),
|
|
380
|
+
schemaId: z.string(),
|
|
381
|
+
control: z.string().optional(),
|
|
382
|
+
margin: sizeSchema.optional(),
|
|
383
|
+
schema: formLayoutSchemaReferenceSchema.optional(),
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
export const listLayoutSchema = z.object({
|
|
387
|
+
type: z.literal('list'),
|
|
388
|
+
items: z.array(listLayoutItemSchema),
|
|
389
|
+
title: z.string().optional(),
|
|
390
|
+
control: z.string().optional(),
|
|
391
|
+
margin: sizeSchema.optional(),
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
export const decisionLayoutOptionSchema = z.object({
|
|
395
|
+
action: actionSchema,
|
|
396
|
+
title: z.string(),
|
|
397
|
+
description: z.string().optional(),
|
|
398
|
+
disabled: z.boolean().optional(),
|
|
399
|
+
icon: iconSchema.optional(),
|
|
400
|
+
image: imageLayoutSchema.optional(),
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
export const reviewLayoutCallToActionSchema = z.object({
|
|
404
|
+
title: z.string(),
|
|
405
|
+
action: actionSchema,
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
export const statusListLayoutItemSchema = z.object({
|
|
409
|
+
title: z.string(),
|
|
410
|
+
description: z.string().optional(),
|
|
411
|
+
icon: iconSchema,
|
|
412
|
+
status: statusListLayoutStatusSchema.optional(),
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
export const pollingOnErrorSchema = z.object({
|
|
416
|
+
action: actionSchema,
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
export const navigationBackBehaviourSchema = z.object({
|
|
420
|
+
title: z.string().optional(),
|
|
421
|
+
action: actionSchema,
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
export const summarySummariserSchema = z.object({
|
|
425
|
+
defaultTitle: z.string().optional(),
|
|
426
|
+
defaultDescription: z.string().optional(),
|
|
427
|
+
defaultIcon: iconSchema.optional(),
|
|
428
|
+
defaultImage: imageLayoutSchema.optional(),
|
|
429
|
+
providesTitle: z.boolean().optional(),
|
|
430
|
+
providesDescription: z.boolean().optional(),
|
|
431
|
+
providesIcon: z.boolean().optional(),
|
|
432
|
+
providesImage: z.boolean().optional(),
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
export const navigationSchema = z.object({
|
|
436
|
+
back: navigationBackBehaviourSchema.optional(),
|
|
437
|
+
backButton: navigationBackBehaviourSchema.optional(),
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
export const linkHandlerSchema = z.object({
|
|
441
|
+
regexPattern: z.string(),
|
|
442
|
+
action: actionSchema,
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
export const summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
|
|
446
|
+
|
|
447
|
+
export const blobSchemaSchema = z.object({
|
|
448
|
+
type: z.literal('blob'),
|
|
449
|
+
disabled: z.boolean().optional(),
|
|
450
|
+
$id: z.string().optional(),
|
|
451
|
+
accepts: z.array(z.string()),
|
|
452
|
+
maxSize: z.number().optional(),
|
|
453
|
+
source: blobSchemaSourceSchema.optional(),
|
|
454
|
+
title: z.string().optional(),
|
|
455
|
+
description: z.string().optional(),
|
|
456
|
+
control: z.string().optional(),
|
|
457
|
+
hidden: z.boolean().optional(),
|
|
458
|
+
icon: iconSchema.optional(),
|
|
459
|
+
image: imageSchema.optional(),
|
|
460
|
+
keywords: z.array(z.string()).optional(),
|
|
461
|
+
summary: summaryProviderSchema.optional(),
|
|
462
|
+
analyticsId: z.string().optional(),
|
|
463
|
+
validationAsync: validateAsyncSchema.optional(),
|
|
464
|
+
validationMessages: z.record(z.string()).optional(),
|
|
465
|
+
alert: alertLayoutSchema.optional(),
|
|
466
|
+
promoted: z.boolean().optional(),
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
export const constSchemaSchema = z.object({
|
|
470
|
+
disabled: z.boolean().optional(),
|
|
471
|
+
hidden: z.boolean().optional(),
|
|
472
|
+
alert: alertLayoutSchema.optional(),
|
|
473
|
+
control: z.string().optional(),
|
|
474
|
+
$id: z.string().optional(),
|
|
475
|
+
const: jsonElementSchema,
|
|
476
|
+
title: z.string().optional(),
|
|
477
|
+
description: z.string().optional(),
|
|
478
|
+
icon: iconSchema.optional(),
|
|
479
|
+
image: imageSchema.optional(),
|
|
480
|
+
keywords: z.array(z.string()).optional(),
|
|
481
|
+
summary: summaryProviderSchema.optional(),
|
|
482
|
+
analyticsId: z.string().optional(),
|
|
483
|
+
promoted: z.boolean().optional(),
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
export const searchResultActionSchema = z.object({
|
|
487
|
+
type: z.literal('action'),
|
|
488
|
+
title: z.string(),
|
|
489
|
+
description: z.string().optional(),
|
|
490
|
+
icon: iconSchema.optional(),
|
|
491
|
+
image: imageLayoutSchema.optional(),
|
|
492
|
+
value: actionSchema,
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
export const decisionLayoutSchema = z.object({
|
|
496
|
+
type: z.literal('decision'),
|
|
497
|
+
options: z.array(decisionLayoutOptionSchema),
|
|
498
|
+
control: z.string().optional(),
|
|
499
|
+
margin: sizeSchema.optional(),
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
export const reviewLayoutSchema = z.object({
|
|
503
|
+
type: z.literal('review'),
|
|
504
|
+
fields: z.array(reviewLayoutFieldSchema),
|
|
505
|
+
title: z.string().optional(),
|
|
506
|
+
callToAction: reviewLayoutCallToActionSchema.optional(),
|
|
507
|
+
control: z.string().optional(),
|
|
508
|
+
margin: sizeSchema.optional(),
|
|
509
|
+
orientation: z.string().optional(),
|
|
510
|
+
action: actionSchema.optional(),
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
export const statusListLayoutSchema = z.object({
|
|
514
|
+
type: z.literal('status-list'),
|
|
515
|
+
items: z.array(statusListLayoutItemSchema),
|
|
516
|
+
title: z.string().optional(),
|
|
517
|
+
control: z.string().optional(),
|
|
518
|
+
margin: sizeSchema.optional(),
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
export const pollingSchema = z.object({
|
|
522
|
+
url: z.string(),
|
|
523
|
+
interval: z.number(),
|
|
524
|
+
maxAttempts: z.number(),
|
|
525
|
+
onError: pollingOnErrorSchema,
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
export const searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
|
|
529
|
+
|
|
530
|
+
export const searchResponseBodySchema = z.object({
|
|
531
|
+
results: z.array(searchResultSchema),
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
export const layoutSchema: z.ZodSchema<Layout> = z.lazy(() =>
|
|
535
|
+
z.union([
|
|
536
|
+
alertLayoutSchema,
|
|
537
|
+
boxLayoutSchema,
|
|
538
|
+
buttonLayoutSchema,
|
|
539
|
+
columnsLayoutSchema,
|
|
540
|
+
decisionLayoutSchema,
|
|
541
|
+
dividerLayoutSchema,
|
|
542
|
+
formLayoutSchema,
|
|
543
|
+
headingLayoutSchema,
|
|
544
|
+
imageLayoutSchema,
|
|
545
|
+
infoLayoutSchema,
|
|
546
|
+
instructionsLayoutSchema,
|
|
547
|
+
listLayoutSchema,
|
|
548
|
+
loadingIndicatorLayoutSchema,
|
|
549
|
+
markdownLayoutSchema,
|
|
550
|
+
modalLayoutSchema,
|
|
551
|
+
paragraphLayoutSchema,
|
|
552
|
+
reviewLayoutSchema,
|
|
553
|
+
searchLayoutSchema,
|
|
554
|
+
statusListLayoutSchema,
|
|
555
|
+
]),
|
|
556
|
+
);
|
|
557
|
+
|
|
558
|
+
export const boxLayoutSchema: z.ZodSchema<BoxLayout> = z.lazy(() =>
|
|
559
|
+
z.object({
|
|
560
|
+
type: z.literal('box'),
|
|
561
|
+
components: z.array(layoutSchema),
|
|
562
|
+
width: sizeSchema.optional(),
|
|
563
|
+
border: z.boolean().optional(),
|
|
564
|
+
control: z.string().optional(),
|
|
565
|
+
margin: sizeSchema.optional(),
|
|
566
|
+
}),
|
|
567
|
+
);
|
|
568
|
+
|
|
569
|
+
export const columnsLayoutSchema: z.ZodSchema<ColumnsLayout> = z.lazy(() =>
|
|
570
|
+
z.object({
|
|
571
|
+
type: z.literal('columns'),
|
|
572
|
+
left: z.array(layoutSchema),
|
|
573
|
+
right: z.array(layoutSchema),
|
|
574
|
+
bias: columnsLayoutBiasSchema.optional(),
|
|
575
|
+
control: z.string().optional(),
|
|
576
|
+
margin: sizeSchema.optional(),
|
|
577
|
+
}),
|
|
578
|
+
);
|
|
579
|
+
|
|
580
|
+
export const modalLayoutSchema: z.ZodSchema<ModalLayout> = z.lazy(() =>
|
|
581
|
+
z.object({
|
|
582
|
+
type: z.literal('modal'),
|
|
583
|
+
control: z.string().optional(),
|
|
584
|
+
margin: sizeSchema.optional(),
|
|
585
|
+
trigger: modalLayoutTriggerSchema,
|
|
586
|
+
content: modalLayoutContentSchema,
|
|
587
|
+
}),
|
|
588
|
+
);
|
|
589
|
+
|
|
590
|
+
export const modalLayoutContentSchema: z.ZodSchema<ModalLayoutContent> = z.lazy(() =>
|
|
591
|
+
z.object({
|
|
592
|
+
components: z.array(layoutSchema),
|
|
593
|
+
}),
|
|
594
|
+
);
|
|
595
|
+
|
|
596
|
+
export const persistAsyncSchema: z.ZodSchema<PersistAsync> = z.lazy(() =>
|
|
597
|
+
z.object({
|
|
598
|
+
param: z.string(),
|
|
599
|
+
idProperty: z.string(),
|
|
600
|
+
schema: schemaSchema,
|
|
601
|
+
url: z.string(),
|
|
602
|
+
method: httpMethodSchema,
|
|
603
|
+
}),
|
|
604
|
+
);
|
|
605
|
+
|
|
606
|
+
export const schemaSchema: z.ZodSchema<Schema> = z.lazy(() =>
|
|
607
|
+
z.union([
|
|
608
|
+
allOfSchemaSchema,
|
|
609
|
+
arraySchemaSchema,
|
|
610
|
+
blobSchemaSchema,
|
|
611
|
+
booleanSchemaSchema,
|
|
612
|
+
constSchemaSchema,
|
|
613
|
+
integerSchemaSchema,
|
|
614
|
+
numberSchemaSchema,
|
|
615
|
+
objectSchemaSchema,
|
|
616
|
+
oneOfSchemaSchema,
|
|
617
|
+
stringSchemaSchema,
|
|
618
|
+
]),
|
|
619
|
+
);
|
|
620
|
+
|
|
621
|
+
export const allOfSchemaSchema: z.ZodSchema<AllOfSchema> = z.lazy(() =>
|
|
622
|
+
z.object({
|
|
623
|
+
disabled: z.boolean().optional(),
|
|
624
|
+
allOf: z.array(schemaSchema),
|
|
625
|
+
$id: z.string().optional(),
|
|
626
|
+
title: z.string().optional(),
|
|
627
|
+
description: z.string().optional(),
|
|
628
|
+
control: z.string().optional(),
|
|
629
|
+
hidden: z.boolean().optional(),
|
|
630
|
+
icon: iconSchema.optional(),
|
|
631
|
+
image: imageSchema.optional(),
|
|
632
|
+
keywords: z.array(z.string()).optional(),
|
|
633
|
+
summary: summaryProviderSchema.optional(),
|
|
634
|
+
analyticsId: z.string().optional(),
|
|
635
|
+
alert: alertLayoutSchema.optional(),
|
|
636
|
+
promoted: z.boolean().optional(),
|
|
637
|
+
}),
|
|
638
|
+
);
|
|
639
|
+
|
|
640
|
+
export const objectSchemaSchema: z.ZodSchema<ObjectSchema> = z.lazy(() =>
|
|
641
|
+
z.object({
|
|
642
|
+
type: z.literal('object'),
|
|
643
|
+
disabled: z.boolean().optional(),
|
|
644
|
+
properties: z.record(schemaSchema),
|
|
645
|
+
displayOrder: z.array(z.string()),
|
|
646
|
+
required: z.array(z.string()).optional(),
|
|
647
|
+
$id: z.string().optional(),
|
|
648
|
+
title: z.string().optional(),
|
|
649
|
+
description: z.string().optional(),
|
|
650
|
+
control: z.string().optional(),
|
|
651
|
+
hidden: z.boolean().optional(),
|
|
652
|
+
icon: iconSchema.optional(),
|
|
653
|
+
image: imageSchema.optional(),
|
|
654
|
+
keywords: z.array(z.string()).optional(),
|
|
655
|
+
summary: summaryProviderSchema.optional(),
|
|
656
|
+
analyticsId: z.string().optional(),
|
|
657
|
+
alert: alertLayoutSchema.optional(),
|
|
658
|
+
promoted: z.boolean().optional(),
|
|
659
|
+
help: helpSchema.optional(),
|
|
660
|
+
}),
|
|
661
|
+
);
|
|
662
|
+
|
|
663
|
+
export const arraySchemaSchema: z.ZodSchema<ArraySchema> = z.lazy(() =>
|
|
664
|
+
z.union([arraySchemaListSchema, arraySchemaTupleSchema]),
|
|
665
|
+
);
|
|
666
|
+
|
|
667
|
+
export const arraySchemaListSchema: z.ZodSchema<ArraySchemaList> = z.lazy(() =>
|
|
668
|
+
z.object({
|
|
669
|
+
type: z.literal('array'),
|
|
670
|
+
$id: z.string().optional(),
|
|
671
|
+
items: schemaSchema,
|
|
672
|
+
addItemTitle: z.string(),
|
|
673
|
+
editItemTitle: z.string(),
|
|
674
|
+
minItems: z.number().optional(),
|
|
675
|
+
maxItems: z.number().optional(),
|
|
676
|
+
title: z.string().optional(),
|
|
677
|
+
description: z.string().optional(),
|
|
678
|
+
control: z.string().optional(),
|
|
679
|
+
hidden: z.boolean().optional(),
|
|
680
|
+
icon: iconSchema.optional(),
|
|
681
|
+
image: imageSchema.optional(),
|
|
682
|
+
keywords: z.array(z.string()).optional(),
|
|
683
|
+
summary: summarySummariserSchema.optional(),
|
|
684
|
+
analyticsId: z.string().optional(),
|
|
685
|
+
persistAsync: persistAsyncSchema.optional(),
|
|
686
|
+
validationAsync: validateAsyncSchema.optional(),
|
|
687
|
+
alert: alertLayoutSchema.optional(),
|
|
688
|
+
validationMessages: z.record(z.string()).optional(),
|
|
689
|
+
disabled: z.boolean().optional(),
|
|
690
|
+
promoted: z.boolean().optional(),
|
|
691
|
+
}),
|
|
692
|
+
);
|
|
693
|
+
|
|
694
|
+
export const arraySchemaTupleSchema: z.ZodSchema<ArraySchemaTuple> = z.lazy(() =>
|
|
695
|
+
z.object({
|
|
696
|
+
type: z.literal('array'),
|
|
697
|
+
$id: z.string().optional(),
|
|
698
|
+
items: z.array(schemaSchema),
|
|
699
|
+
title: z.string().optional(),
|
|
700
|
+
description: z.string().optional(),
|
|
701
|
+
control: z.string().optional(),
|
|
702
|
+
hidden: z.boolean().optional(),
|
|
703
|
+
icon: iconSchema.optional(),
|
|
704
|
+
image: imageSchema.optional(),
|
|
705
|
+
keywords: z.array(z.string()).optional(),
|
|
706
|
+
summary: summaryProviderSchema.optional(),
|
|
707
|
+
analyticsId: z.string().optional(),
|
|
708
|
+
persistAsync: persistAsyncSchema.optional(),
|
|
709
|
+
validationAsync: validateAsyncSchema.optional(),
|
|
710
|
+
alert: alertLayoutSchema.optional(),
|
|
711
|
+
disabled: z.boolean().optional(),
|
|
712
|
+
promoted: z.boolean().optional(),
|
|
713
|
+
}),
|
|
714
|
+
);
|
|
715
|
+
|
|
716
|
+
export const booleanSchemaSchema: z.ZodSchema<BooleanSchema> = z.lazy(() =>
|
|
717
|
+
z.object({
|
|
718
|
+
type: z.literal('boolean'),
|
|
719
|
+
$id: z.string().optional(),
|
|
720
|
+
title: z.string().optional(),
|
|
721
|
+
description: z.string().optional(),
|
|
722
|
+
control: z.string().optional(),
|
|
723
|
+
default: z.boolean().optional(),
|
|
724
|
+
hidden: z.boolean().optional(),
|
|
725
|
+
disabled: z.boolean().optional(),
|
|
726
|
+
icon: iconSchema.optional(),
|
|
727
|
+
image: imageSchema.optional(),
|
|
728
|
+
keywords: z.array(z.string()).optional(),
|
|
729
|
+
summary: summaryProviderSchema.optional(),
|
|
730
|
+
analyticsId: z.string().optional(),
|
|
731
|
+
persistAsync: persistAsyncSchema.optional(),
|
|
732
|
+
refreshStepOnChange: z.boolean().optional(),
|
|
733
|
+
validationAsync: validateAsyncSchema.optional(),
|
|
734
|
+
alert: alertLayoutSchema.optional(),
|
|
735
|
+
autofillKey: z.string().optional(),
|
|
736
|
+
help: helpSchema.optional(),
|
|
737
|
+
autofillProvider: z.string().optional(),
|
|
738
|
+
promoted: z.boolean().optional(),
|
|
739
|
+
refreshFormOnChange: z.boolean().optional(),
|
|
740
|
+
refreshUrl: z.string().optional(),
|
|
741
|
+
refreshFormUrl: z.string().optional(),
|
|
742
|
+
}),
|
|
743
|
+
);
|
|
744
|
+
|
|
745
|
+
export const integerSchemaSchema: z.ZodSchema<IntegerSchema> = z.lazy(() =>
|
|
746
|
+
z.object({
|
|
747
|
+
type: z.literal('integer'),
|
|
748
|
+
placeholder: z.string().optional(),
|
|
749
|
+
minimum: z.number().optional(),
|
|
750
|
+
maximum: z.number().optional(),
|
|
751
|
+
$id: z.string().optional(),
|
|
752
|
+
title: z.string().optional(),
|
|
753
|
+
description: z.string().optional(),
|
|
754
|
+
control: z.string().optional(),
|
|
755
|
+
default: z.number().optional(),
|
|
756
|
+
hidden: z.boolean().optional(),
|
|
757
|
+
disabled: z.boolean().optional(),
|
|
758
|
+
icon: iconSchema.optional(),
|
|
759
|
+
image: imageSchema.optional(),
|
|
760
|
+
keywords: z.array(z.string()).optional(),
|
|
761
|
+
summary: summaryProviderSchema.optional(),
|
|
762
|
+
analyticsId: z.string().optional(),
|
|
763
|
+
persistAsync: persistAsyncSchema.optional(),
|
|
764
|
+
refreshStepOnChange: z.boolean().optional(),
|
|
765
|
+
validationAsync: validateAsyncSchema.optional(),
|
|
766
|
+
validationMessages: z.record(z.string()).optional(),
|
|
767
|
+
alert: alertLayoutSchema.optional(),
|
|
768
|
+
autocompleteHint: z.array(autocompleteTokenSchema).optional(),
|
|
769
|
+
autofillKey: z.string().optional(),
|
|
770
|
+
help: helpSchema.optional(),
|
|
771
|
+
autofillProvider: z.string().optional(),
|
|
772
|
+
promoted: z.boolean().optional(),
|
|
773
|
+
refreshFormOnChange: z.boolean().optional(),
|
|
774
|
+
refreshUrl: z.string().optional(),
|
|
775
|
+
refreshFormUrl: z.string().optional(),
|
|
776
|
+
}),
|
|
777
|
+
);
|
|
778
|
+
|
|
779
|
+
export const numberSchemaSchema: z.ZodSchema<NumberSchema> = z.lazy(() =>
|
|
780
|
+
z.object({
|
|
781
|
+
type: z.literal('number'),
|
|
782
|
+
placeholder: z.string().optional(),
|
|
783
|
+
minimum: z.number().optional(),
|
|
784
|
+
maximum: z.number().optional(),
|
|
785
|
+
$id: z.string().optional(),
|
|
786
|
+
title: z.string().optional(),
|
|
787
|
+
description: z.string().optional(),
|
|
788
|
+
control: z.string().optional(),
|
|
789
|
+
default: z.number().optional(),
|
|
790
|
+
hidden: z.boolean().optional(),
|
|
791
|
+
disabled: z.boolean().optional(),
|
|
792
|
+
icon: iconSchema.optional(),
|
|
793
|
+
image: imageSchema.optional(),
|
|
794
|
+
keywords: z.array(z.string()).optional(),
|
|
795
|
+
summary: summaryProviderSchema.optional(),
|
|
796
|
+
analyticsId: z.string().optional(),
|
|
797
|
+
persistAsync: persistAsyncSchema.optional(),
|
|
798
|
+
refreshStepOnChange: z.boolean().optional(),
|
|
799
|
+
validationAsync: validateAsyncSchema.optional(),
|
|
800
|
+
validationMessages: z.record(z.string()).optional(),
|
|
801
|
+
alert: alertLayoutSchema.optional(),
|
|
802
|
+
autocompleteHint: z.array(autocompleteTokenSchema).optional(),
|
|
803
|
+
autofillKey: z.string().optional(),
|
|
804
|
+
help: helpSchema.optional(),
|
|
805
|
+
autofillProvider: z.string().optional(),
|
|
806
|
+
promoted: z.boolean().optional(),
|
|
807
|
+
refreshFormOnChange: z.boolean().optional(),
|
|
808
|
+
refreshUrl: z.string().optional(),
|
|
809
|
+
refreshFormUrl: z.string().optional(),
|
|
810
|
+
}),
|
|
811
|
+
);
|
|
812
|
+
|
|
813
|
+
export const oneOfSchemaSchema: z.ZodSchema<OneOfSchema> = z.lazy(() =>
|
|
814
|
+
z.object({
|
|
815
|
+
disabled: z.boolean().optional(),
|
|
816
|
+
oneOf: z.array(schemaSchema),
|
|
817
|
+
placeholder: z.string().optional(),
|
|
818
|
+
$id: z.string().optional(),
|
|
819
|
+
title: z.string().optional(),
|
|
820
|
+
description: z.string().optional(),
|
|
821
|
+
control: z.string().optional(),
|
|
822
|
+
default: jsonElementSchema.optional(),
|
|
823
|
+
hidden: z.boolean().optional(),
|
|
824
|
+
icon: iconSchema.optional(),
|
|
825
|
+
image: imageSchema.optional(),
|
|
826
|
+
keywords: z.array(z.string()).optional(),
|
|
827
|
+
summary: summaryProviderSchema.optional(),
|
|
828
|
+
analyticsId: z.string().optional(),
|
|
829
|
+
refreshStepOnChange: z.boolean().optional(),
|
|
830
|
+
alert: alertLayoutSchema.optional(),
|
|
831
|
+
help: helpSchema.optional(),
|
|
832
|
+
autocompleteHint: z.array(autocompleteTokenSchema).optional(),
|
|
833
|
+
autofillKey: z.string().optional(),
|
|
834
|
+
validationMessages: z.record(z.string()).optional(),
|
|
835
|
+
autofillProvider: z.string().optional(),
|
|
836
|
+
promoted: z.boolean().optional(),
|
|
837
|
+
refreshFormOnChange: z.boolean().optional(),
|
|
838
|
+
refreshUrl: z.string().optional(),
|
|
839
|
+
refreshFormUrl: z.string().optional(),
|
|
840
|
+
promotion: jsonElementSchema.optional(),
|
|
841
|
+
}),
|
|
842
|
+
);
|
|
843
|
+
|
|
844
|
+
export const stringSchemaSchema: z.ZodSchema<StringSchema> = z.lazy(() =>
|
|
845
|
+
z.object({
|
|
846
|
+
type: z.literal('string'),
|
|
847
|
+
format: stringSchemaFormatSchema.optional(),
|
|
848
|
+
displayFormat: z.string().optional(),
|
|
849
|
+
placeholder: z.string().optional(),
|
|
850
|
+
minLength: z.number().optional(),
|
|
851
|
+
maxLength: z.number().optional(),
|
|
852
|
+
minimum: z.string().optional(),
|
|
853
|
+
maximum: z.string().optional(),
|
|
854
|
+
pattern: z.string().optional(),
|
|
855
|
+
$id: z.string().optional(),
|
|
856
|
+
title: z.string().optional(),
|
|
857
|
+
description: z.string().optional(),
|
|
858
|
+
control: z.string().optional(),
|
|
859
|
+
default: z.string().optional(),
|
|
860
|
+
hidden: z.boolean().optional(),
|
|
861
|
+
disabled: z.boolean().optional(),
|
|
862
|
+
icon: iconSchema.optional(),
|
|
863
|
+
image: imageSchema.optional(),
|
|
864
|
+
keywords: z.array(z.string()).optional(),
|
|
865
|
+
summary: summaryProviderSchema.optional(),
|
|
866
|
+
analyticsId: z.string().optional(),
|
|
867
|
+
persistAsync: persistAsyncSchema.optional(),
|
|
868
|
+
refreshStepOnChange: z.boolean().optional(),
|
|
869
|
+
validationAsync: validateAsyncSchema.optional(),
|
|
870
|
+
validationMessages: z.record(z.string()).optional(),
|
|
871
|
+
alert: alertLayoutSchema.optional(),
|
|
872
|
+
autocompleteHint: z.array(autocompleteTokenSchema).optional(),
|
|
873
|
+
autofillKey: z.string().optional(),
|
|
874
|
+
help: helpSchema.optional(),
|
|
875
|
+
autofillProvider: z.string().optional(),
|
|
876
|
+
promoted: z.boolean().optional(),
|
|
877
|
+
refreshFormOnChange: z.boolean().optional(),
|
|
878
|
+
refreshUrl: z.string().optional(),
|
|
879
|
+
refreshFormUrl: z.string().optional(),
|
|
880
|
+
cameraConfig: z.unknown().optional(),
|
|
881
|
+
accepts: z.array(z.string()).optional(),
|
|
882
|
+
maxSize: z.number().optional(),
|
|
883
|
+
source: stringSchemaSourceSchema.optional(),
|
|
884
|
+
}),
|
|
885
|
+
);
|
|
886
|
+
|
|
887
|
+
export const stepSchema: z.ZodSchema<Step> = z.lazy(() =>
|
|
888
|
+
z.object({
|
|
889
|
+
id: z.string(),
|
|
890
|
+
title: z.string(),
|
|
891
|
+
schemas: z.array(schemaSchema),
|
|
892
|
+
layout: z.array(layoutSchema),
|
|
893
|
+
model: jsonElementSchema.optional(),
|
|
894
|
+
external: externalSchema.optional(),
|
|
895
|
+
polling: pollingSchema.optional(),
|
|
896
|
+
linkHandlers: z.array(linkHandlerSchema).optional(),
|
|
897
|
+
analytics: z.record(z.string()).optional(),
|
|
898
|
+
errors: stepErrorSchema.optional(),
|
|
899
|
+
navigation: navigationSchema.optional(),
|
|
900
|
+
refreshUrl: z.string().optional(),
|
|
901
|
+
key: z.string().optional(),
|
|
902
|
+
type: z.string().optional(),
|
|
903
|
+
actions: z.array(actionSchema).optional(),
|
|
904
|
+
refreshFormUrl: z.string().optional(),
|
|
905
|
+
}),
|
|
906
|
+
);
|