@wise/dynamic-flow-types 3.4.0 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,58 +2,114 @@
2
2
  import { z } from 'zod';
3
3
  import type {
4
4
  JsonElement,
5
- ArraySchemaList,
5
+ Step,
6
6
  Schema,
7
- PersistAsync,
8
- AlertLayout,
9
- IntegerSchema,
10
- AllOfSchema,
7
+ Layout,
8
+ Polling,
9
+ LinkHandler,
10
+ AdditionalInfo,
11
+ Behavior,
11
12
  ConstSchema,
13
+ AlertLayout,
14
+ BooleanSchema,
15
+ PersistAsync,
12
16
  ArraySchema,
17
+ ArraySchemaList,
13
18
  ArraySchemaTuple,
14
- ObjectSchema,
15
19
  StringSchema,
16
- OneOfSchema,
17
20
  BlobSchema,
21
+ AllOfSchema,
22
+ IntegerSchema,
18
23
  NumberSchema,
19
- BooleanSchema,
20
- ModalResponseBody,
21
- Layout,
24
+ ObjectSchema,
25
+ OneOfSchema,
26
+ PollingOnError,
27
+ ModalBehavior,
28
+ ModalLayoutContent,
22
29
  ListLayoutItem,
23
- AdditionalInfo,
24
30
  StatusListLayoutItem,
25
31
  ItemCallToAction,
26
- AlertLayoutCallToAction,
27
- Behavior,
28
- BoxLayout,
29
32
  DecisionLayout,
30
33
  DecisionLayoutOption,
31
- ColumnsLayout,
32
- SectionLayout,
33
- SectionLayoutCallToAction,
34
- ListLayout,
35
- ListLayoutCallToAction,
36
34
  ReviewLayoutCallToAction,
37
- StatusListLayout,
38
35
  ModalLayout,
39
- ModalLayoutContent,
40
- ReviewLayout,
36
+ StatusListLayout,
41
37
  ReviewLayoutField,
38
+ SectionLayoutCallToAction,
39
+ AlertLayoutCallToAction,
40
+ ListLayoutCallToAction,
41
+ SectionLayout,
42
42
  ButtonLayout,
43
- Step,
44
- Polling,
45
- LinkHandler,
46
- ModalBehavior,
47
- PollingOnError,
43
+ ReviewLayout,
44
+ ColumnsLayout,
45
+ BoxLayout,
46
+ ListLayout,
47
+ ModalResponseBody,
48
48
  } from '../next';
49
49
 
50
- export const stringSchemaFormatSchema = z.union([
51
- z.literal('date'),
52
- z.literal('email'),
53
- z.literal('numeric'),
54
- z.literal('password'),
55
- z.literal('phone-number'),
56
- z.literal('base64url'),
50
+ export const jsonElementSchema: z.ZodSchema<JsonElement> = z.lazy(() =>
51
+ z
52
+ .union([
53
+ z.string(),
54
+ z.number(),
55
+ z.boolean(),
56
+ z.record(jsonElementSchema),
57
+ z.array(jsonElementSchema),
58
+ ])
59
+ .nullable(),
60
+ );
61
+
62
+ export const externalSchema = z.object({
63
+ url: z.string(),
64
+ });
65
+
66
+ export const stepErrorSchema = z.object({
67
+ error: z.string().optional(),
68
+ validation: jsonElementSchema.optional(),
69
+ });
70
+
71
+ export const iconNamedSchema = z.object({
72
+ name: z.string(),
73
+ });
74
+
75
+ export const iconTextSchema = z.object({
76
+ text: z.string(),
77
+ });
78
+
79
+ export const contextSchema = z.union([
80
+ z.literal('positive'),
81
+ z.literal('neutral'),
82
+ z.literal('warning'),
83
+ z.literal('negative'),
84
+ z.literal('success'),
85
+ z.literal('failure'),
86
+ z.literal('info'),
87
+ z.literal('primary'),
88
+ ]);
89
+
90
+ export const alignSchema = z.union([z.literal('left'), z.literal('center'), z.literal('right')]);
91
+
92
+ export const httpMethodSchema = z.union([
93
+ z.literal('GET'),
94
+ z.literal('POST'),
95
+ z.literal('PUT'),
96
+ z.literal('PATCH'),
97
+ z.literal('DELETE'),
98
+ ]);
99
+
100
+ export const sizeSchema = z.union([
101
+ z.literal('xs'),
102
+ z.literal('sm'),
103
+ z.literal('md'),
104
+ z.literal('lg'),
105
+ z.literal('xl'),
106
+ ]);
107
+
108
+ export const autocapitalizationTypeSchema = z.union([
109
+ z.literal('none'),
110
+ z.literal('characters'),
111
+ z.literal('sentences'),
112
+ z.literal('words'),
57
113
  ]);
58
114
 
59
115
  export const imageSchema = z.object({
@@ -63,13 +119,6 @@ export const imageSchema = z.object({
63
119
  accessibilityDescription: z.string().optional(),
64
120
  });
65
121
 
66
- export const summaryProviderSchema = z.object({
67
- providesTitle: z.boolean().optional(),
68
- providesDescription: z.boolean().optional(),
69
- providesIcon: z.boolean().optional(),
70
- providesImage: z.boolean().optional(),
71
- });
72
-
73
122
  export const autocompleteTokenSchema = z.union([
74
123
  z.literal('on'),
75
124
  z.literal('name'),
@@ -136,101 +185,84 @@ export const autocompleteTokenSchema = z.union([
136
185
  z.literal('pager'),
137
186
  ]);
138
187
 
139
- export const helpSchema = z.object({
140
- markdown: z.string(),
188
+ export const supportingValuesSchema = z.object({
189
+ value: z.string().optional(),
190
+ subvalue: z.string().optional(),
141
191
  });
142
192
 
143
- export const jsonElementSchema: z.ZodSchema<JsonElement> = z.lazy(() =>
144
- z
145
- .union([
146
- z.string(),
147
- z.number(),
148
- z.boolean(),
149
- z.record(jsonElementSchema),
150
- z.array(jsonElementSchema),
151
- ])
152
- .nullable(),
153
- );
193
+ export const inlineAlertSchema = z.object({
194
+ content: z.string(),
195
+ context: contextSchema.optional(),
196
+ });
154
197
 
155
- export const autocapitalizationTypeSchema = z.union([
156
- z.literal('none'),
157
- z.literal('characters'),
158
- z.literal('sentences'),
159
- z.literal('words'),
160
- ]);
198
+ export const summaryProviderSchema = z.object({
199
+ providesTitle: z.boolean().optional(),
200
+ providesDescription: z.boolean().optional(),
201
+ providesIcon: z.boolean().optional(),
202
+ providesImage: z.boolean().optional(),
203
+ });
161
204
 
162
- export const uploadSourceSchema = z.union([z.literal('camera'), z.literal('file')]);
205
+ export const validateAsyncSchema = z.object({
206
+ param: z.string(),
207
+ method: httpMethodSchema,
208
+ url: z.string(),
209
+ });
163
210
 
164
- export const errorResponseBodySchema = z.object({
165
- refreshFormUrl: z.string().optional(),
166
- analytics: z.record(z.string()).optional(),
167
- error: z.string().optional(),
168
- validation: jsonElementSchema.optional(),
169
- refreshUrl: z.string().optional(),
211
+ export const helpSchema = z.object({
212
+ markdown: z.string(),
170
213
  });
171
214
 
172
- export const httpMethodSchema = z.union([
173
- z.literal('GET'),
174
- z.literal('POST'),
175
- z.literal('PUT'),
176
- z.literal('PATCH'),
177
- z.literal('DELETE'),
215
+ export const stringSchemaFormatSchema = z.union([
216
+ z.literal('date'),
217
+ z.literal('email'),
218
+ z.literal('numeric'),
219
+ z.literal('password'),
220
+ z.literal('phone-number'),
221
+ z.literal('base64url'),
178
222
  ]);
179
223
 
180
- export const formLayoutSchemaReferenceSchema = z.object({
181
- $ref: z.string(),
182
- });
224
+ export const uploadSourceSchema = z.union([z.literal('camera'), z.literal('file')]);
183
225
 
184
- export const sizeSchema = z.union([
185
- z.literal('xs'),
186
- z.literal('sm'),
187
- z.literal('md'),
188
- z.literal('lg'),
189
- z.literal('xl'),
190
- ]);
226
+ export const linkBehaviorSchema = z.object({
227
+ type: z.literal('link'),
228
+ url: z.string(),
229
+ });
191
230
 
192
- export const listLayoutStatusSchema = z.union([
193
- z.literal('warning'),
194
- z.literal('neutral'),
231
+ export const actionTypeSchema = z.union([
232
+ z.literal('primary'),
233
+ z.literal('secondary'),
234
+ z.literal('link'),
195
235
  z.literal('positive'),
236
+ z.literal('negative'),
196
237
  ]);
197
238
 
198
- export const supportingValuesSchema = z.object({
199
- value: z.string().optional(),
200
- subvalue: z.string().optional(),
239
+ export const linkSchema = z.object({
240
+ url: z.string(),
201
241
  });
202
242
 
203
- export const statusListLayoutStatusSchema = z.union([
204
- z.literal('not-done'),
205
- z.literal('pending'),
206
- z.literal('done'),
243
+ export const navigationStackBehaviorSchema = z.union([
244
+ z.literal('default'),
245
+ z.literal('remove-previous'),
246
+ z.literal('remove-all'),
247
+ z.literal('replace-current'),
207
248
  ]);
208
249
 
209
- export const columnsLayoutBiasSchema = z.union([
210
- z.literal('none'),
211
- z.literal('left'),
212
- z.literal('right'),
213
- ]);
250
+ export const dismissBehaviorSchema = z.object({
251
+ type: z.literal('dismiss'),
252
+ });
214
253
 
215
- export const alignSchema = z.union([z.literal('left'), z.literal('center'), z.literal('right')]);
254
+ export const refreshBehaviorSchema = z.object({
255
+ type: z.literal('refresh'),
256
+ });
216
257
 
217
- export const contextSchema = z.union([
218
- z.literal('positive'),
219
- z.literal('neutral'),
258
+ export const listLayoutStatusSchema = z.union([
220
259
  z.literal('warning'),
221
- z.literal('negative'),
222
- z.literal('success'),
223
- z.literal('failure'),
224
- z.literal('info'),
225
- z.literal('primary'),
260
+ z.literal('neutral'),
261
+ z.literal('positive'),
226
262
  ]);
227
263
 
228
- export const markdownLayoutSchema = z.object({
229
- type: z.literal('markdown'),
230
- content: z.string(),
231
- align: alignSchema.optional(),
232
- control: z.string().optional(),
233
- margin: sizeSchema.optional(),
264
+ export const modalLayoutTriggerSchema = z.object({
265
+ title: z.string(),
234
266
  });
235
267
 
236
268
  export const loadingIndicatorLayoutSchema = z.object({
@@ -240,16 +272,16 @@ export const loadingIndicatorLayoutSchema = z.object({
240
272
  margin: sizeSchema.optional(),
241
273
  });
242
274
 
243
- export const imageLayoutSchema = z.object({
244
- type: z.literal('image'),
245
- text: z.string().optional(),
246
- url: z.string().optional(),
247
- accessibilityDescription: z.string().optional(),
248
- content: imageSchema.optional(),
249
- size: sizeSchema.optional(),
275
+ export const statusListLayoutStatusSchema = z.union([
276
+ z.literal('not-done'),
277
+ z.literal('pending'),
278
+ z.literal('done'),
279
+ ]);
280
+
281
+ export const dividerLayoutSchema = z.object({
282
+ type: z.literal('divider'),
250
283
  control: z.string().optional(),
251
284
  margin: sizeSchema.optional(),
252
- align: alignSchema.optional(),
253
285
  });
254
286
 
255
287
  export const headingLayoutSchema = z.object({
@@ -261,25 +293,48 @@ export const headingLayoutSchema = z.object({
261
293
  margin: sizeSchema.optional(),
262
294
  });
263
295
 
264
- export const searchLayoutSchema = z.object({
265
- type: z.literal('search'),
266
- title: z.string(),
267
- method: httpMethodSchema,
268
- url: z.string(),
269
- param: z.string(),
270
- emptyMessage: z.string().optional(),
296
+ export const formLayoutSchemaReferenceSchema = z.object({
297
+ $ref: z.string(),
298
+ });
299
+
300
+ export const imageLayoutSchema = z.object({
301
+ type: z.literal('image'),
302
+ text: z.string().optional(),
303
+ url: z.string().optional(),
304
+ accessibilityDescription: z.string().optional(),
305
+ content: imageSchema.optional(),
306
+ size: sizeSchema.optional(),
271
307
  control: z.string().optional(),
272
308
  margin: sizeSchema.optional(),
309
+ align: alignSchema.optional(),
273
310
  });
274
311
 
275
- export const dividerLayoutSchema = z.object({
276
- type: z.literal('divider'),
312
+ export const columnsLayoutBiasSchema = z.union([
313
+ z.literal('none'),
314
+ z.literal('left'),
315
+ z.literal('right'),
316
+ ]);
317
+
318
+ export const instructionsLayoutItemSchema = z.object({
319
+ text: z.string(),
320
+ context: contextSchema,
321
+ tag: z.string().optional(),
322
+ });
323
+
324
+ export const markdownLayoutSchema = z.object({
325
+ type: z.literal('markdown'),
326
+ content: z.string(),
327
+ align: alignSchema.optional(),
277
328
  control: z.string().optional(),
278
329
  margin: sizeSchema.optional(),
279
330
  });
280
331
 
281
- export const modalLayoutTriggerSchema = z.object({
282
- title: z.string(),
332
+ export const infoLayoutSchema = z.object({
333
+ type: z.literal('info'),
334
+ markdown: z.string(),
335
+ align: alignSchema.optional(),
336
+ control: z.string().optional(),
337
+ margin: sizeSchema.optional(),
283
338
  });
284
339
 
285
340
  export const paragraphLayoutSchema = z.object({
@@ -290,68 +345,38 @@ export const paragraphLayoutSchema = z.object({
290
345
  margin: sizeSchema.optional(),
291
346
  });
292
347
 
293
- export const iconNamedSchema = z.object({
294
- name: z.string(),
348
+ export const searchLayoutSchema = z.object({
349
+ type: z.literal('search'),
350
+ title: z.string(),
351
+ method: httpMethodSchema,
352
+ url: z.string(),
353
+ param: z.string(),
354
+ emptyMessage: z.string().optional(),
355
+ control: z.string().optional(),
356
+ margin: sizeSchema.optional(),
295
357
  });
296
358
 
297
- export const iconTextSchema = z.object({
298
- text: z.string(),
359
+ export const formLayoutSchema = z.object({
360
+ type: z.literal('form'),
361
+ schema: formLayoutSchemaReferenceSchema.optional(),
362
+ schemaId: z.string(),
363
+ control: z.string().optional(),
364
+ margin: sizeSchema.optional(),
299
365
  });
300
366
 
301
- export const externalSchema = z.object({
367
+ export const searchSearchRequestSchema = z.object({
302
368
  url: z.string(),
369
+ method: httpMethodSchema,
370
+ param: z.string(),
371
+ query: z.string(),
303
372
  });
304
373
 
305
- export const stepErrorSchema = z.object({
374
+ export const errorResponseBodySchema = z.object({
375
+ refreshFormUrl: z.string().optional(),
376
+ analytics: z.record(z.string()).optional(),
306
377
  error: z.string().optional(),
307
378
  validation: jsonElementSchema.optional(),
308
- });
309
-
310
- export const dismissBehaviorSchema = z.object({
311
- type: z.literal('dismiss'),
312
- });
313
-
314
- export const linkBehaviorSchema = z.object({
315
- type: z.literal('link'),
316
- url: z.string(),
317
- });
318
-
319
- export const navigationStackBehaviorSchema = z.union([
320
- z.literal('default'),
321
- z.literal('remove-previous'),
322
- z.literal('remove-all'),
323
- z.literal('replace-current'),
324
- ]);
325
-
326
- export const linkSchema = z.object({
327
- url: z.string(),
328
- });
329
-
330
- export const actionTypeSchema = z.union([
331
- z.literal('primary'),
332
- z.literal('secondary'),
333
- z.literal('link'),
334
- z.literal('positive'),
335
- z.literal('negative'),
336
- ]);
337
-
338
- export const iconSchema = z.union([iconNamedSchema, iconTextSchema]);
339
-
340
- export const summarySummariserSchema = z.object({
341
- defaultTitle: z.string().optional(),
342
- defaultDescription: z.string().optional(),
343
- defaultIcon: iconSchema.optional(),
344
- defaultImage: imageSchema.optional(),
345
- providesTitle: z.boolean().optional(),
346
- providesDescription: z.boolean().optional(),
347
- providesIcon: z.boolean().optional(),
348
- providesImage: z.boolean().optional(),
349
- });
350
-
351
- export const validateAsyncSchema = z.object({
352
- param: z.string(),
353
- method: httpMethodSchema,
354
- url: z.string(),
379
+ refreshUrl: z.string().optional(),
355
380
  });
356
381
 
357
382
  export const actionSchema = z.object({
@@ -370,66 +395,17 @@ export const actionSchema = z.object({
370
395
  skipValidation: z.boolean().optional(),
371
396
  });
372
397
 
373
- export const searchSearchRequestSchema = z.object({
374
- url: z.string(),
375
- method: httpMethodSchema,
376
- param: z.string(),
377
- query: z.string(),
378
- });
379
-
380
- export const searchResultActionSchema = z.object({
381
- type: z.literal('action'),
382
- title: z.string(),
383
- description: z.string().optional(),
384
- icon: iconSchema.optional(),
385
- image: imageSchema.optional(),
386
- value: actionSchema,
387
- });
388
-
389
- export const searchResultSearchSchema = z.object({
390
- type: z.literal('search'),
391
- title: z.string(),
392
- description: z.string().optional(),
393
- icon: iconSchema.optional(),
394
- image: imageSchema.optional(),
395
- value: searchSearchRequestSchema,
396
- });
397
-
398
- export const searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
399
-
400
- export const formLayoutSchema = z.object({
401
- type: z.literal('form'),
402
- schema: formLayoutSchemaReferenceSchema.optional(),
403
- schemaId: z.string(),
404
- control: z.string().optional(),
405
- margin: sizeSchema.optional(),
406
- });
407
-
408
- export const inlineAlertSchema = z.object({
409
- content: z.string(),
410
- context: contextSchema.optional(),
411
- });
412
-
413
- export const infoLayoutSchema = z.object({
414
- type: z.literal('info'),
415
- markdown: z.string(),
416
- align: alignSchema.optional(),
417
- control: z.string().optional(),
418
- margin: sizeSchema.optional(),
419
- });
420
-
421
- export const instructionsLayoutItemSchema = z.object({
422
- text: z.string(),
423
- context: contextSchema,
424
- tag: z.string().optional(),
425
- });
398
+ export const iconSchema = z.union([iconNamedSchema, iconTextSchema]);
426
399
 
427
- export const instructionsLayoutSchema = z.object({
428
- type: z.literal('instructions'),
429
- title: z.string().optional(),
430
- items: z.array(instructionsLayoutItemSchema),
431
- control: z.string().optional(),
432
- margin: sizeSchema.optional(),
400
+ export const summarySummariserSchema = z.object({
401
+ defaultTitle: z.string().optional(),
402
+ defaultDescription: z.string().optional(),
403
+ defaultIcon: iconSchema.optional(),
404
+ defaultImage: imageSchema.optional(),
405
+ providesTitle: z.boolean().optional(),
406
+ providesDescription: z.boolean().optional(),
407
+ providesIcon: z.boolean().optional(),
408
+ providesImage: z.boolean().optional(),
433
409
  });
434
410
 
435
411
  export const suggestionsValueSchema = z.object({
@@ -445,6 +421,8 @@ export const actionBehaviorSchema = z.object({
445
421
  action: actionSchema,
446
422
  });
447
423
 
424
+ export const summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
425
+
448
426
  export const containerBehaviorSchema = z.object({
449
427
  action: actionSchema.optional(),
450
428
  link: linkSchema.optional(),
@@ -455,51 +433,73 @@ export const navigationBackBehaviorSchema = z.object({
455
433
  action: actionSchema,
456
434
  });
457
435
 
458
- export const summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
459
-
460
- export const suggestionsSchema = z.object({
461
- values: z.array(suggestionsValueSchema),
436
+ export const instructionsLayoutSchema = z.object({
437
+ type: z.literal('instructions'),
438
+ title: z.string().optional(),
439
+ items: z.array(instructionsLayoutItemSchema),
440
+ control: z.string().optional(),
441
+ margin: sizeSchema.optional(),
462
442
  });
463
443
 
464
444
  export const actionResponseBodySchema = z.object({
465
445
  action: actionSchema,
466
446
  });
467
447
 
468
- export const searchResponseBodySchema = z.object({
469
- results: z.array(searchResultSchema),
448
+ export const searchResultSearchSchema = z.object({
449
+ type: z.literal('search'),
450
+ title: z.string(),
451
+ description: z.string().optional(),
452
+ icon: iconSchema.optional(),
453
+ image: imageSchema.optional(),
454
+ value: searchSearchRequestSchema,
470
455
  });
471
456
 
457
+ export const searchResultActionSchema = z.object({
458
+ type: z.literal('action'),
459
+ title: z.string(),
460
+ description: z.string().optional(),
461
+ icon: iconSchema.optional(),
462
+ image: imageSchema.optional(),
463
+ value: actionSchema,
464
+ });
465
+
466
+ export const searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
467
+
472
468
  export const navigationSchema = z.object({
473
469
  backButton: navigationBackBehaviorSchema.optional(),
474
470
  back: navigationBackBehaviorSchema.optional(),
475
471
  stackBehavior: navigationStackBehaviorSchema.optional(),
476
472
  });
477
473
 
478
- export const arraySchemaListSchema: z.ZodSchema<ArraySchemaList> = z.lazy(() =>
474
+ export const suggestionsSchema = z.object({
475
+ values: z.array(suggestionsValueSchema),
476
+ });
477
+
478
+ export const searchResponseBodySchema = z.object({
479
+ results: z.array(searchResultSchema),
480
+ });
481
+
482
+ export const stepSchema: z.ZodSchema<Step> = z.lazy(() =>
479
483
  z.object({
480
- type: z.literal('array'),
481
- promoted: z.boolean().optional(),
482
- $id: z.string().optional(),
483
- items: schemaSchema,
484
- addItemTitle: z.string(),
485
- editItemTitle: z.string(),
486
- minItems: z.number().optional(),
487
- maxItems: z.number().optional(),
488
- placeholder: z.string().optional(),
489
- title: z.string().optional(),
484
+ key: z.string().optional(),
485
+ type: z.string().optional(),
486
+ actions: z.array(actionSchema).optional(),
487
+ refreshFormUrl: z.string().optional(),
488
+ id: z.string(),
489
+ title: z.string(),
490
+ schemas: z.array(schemaSchema),
491
+ layout: z.array(layoutSchema),
490
492
  description: z.string().optional(),
491
- control: z.string().optional(),
492
- hidden: z.boolean().optional(),
493
- icon: iconSchema.optional(),
494
- image: imageSchema.optional(),
495
- keywords: z.array(z.string()).optional(),
496
- summary: summarySummariserSchema.optional(),
497
- analyticsId: z.string().optional(),
498
- persistAsync: persistAsyncSchema.optional(),
499
- validationAsync: validateAsyncSchema.optional(),
500
- alert: alertLayoutSchema.optional(),
501
- validationMessages: z.record(z.string()).optional(),
502
- disabled: z.boolean().optional(),
493
+ model: jsonElementSchema.optional(),
494
+ external: externalSchema.optional(),
495
+ polling: pollingSchema.optional(),
496
+ linkHandlers: z.array(linkHandlerSchema).optional(),
497
+ analytics: z.record(z.string()).optional(),
498
+ errors: stepErrorSchema.optional(),
499
+ navigation: navigationSchema.optional(),
500
+ refreshUrl: z.string().optional(),
501
+ control: z.string().optional(),
502
+ refreshAfter: z.string().optional(),
503
503
  }),
504
504
  );
505
505
 
@@ -518,13 +518,84 @@ export const schemaSchema: z.ZodSchema<Schema> = z.lazy(() =>
518
518
  ]),
519
519
  );
520
520
 
521
- export const persistAsyncSchema: z.ZodSchema<PersistAsync> = z.lazy(() =>
521
+ export const layoutSchema: z.ZodSchema<Layout> = z.lazy(() =>
522
+ z.union([
523
+ alertLayoutSchema,
524
+ boxLayoutSchema,
525
+ buttonLayoutSchema,
526
+ columnsLayoutSchema,
527
+ decisionLayoutSchema,
528
+ dividerLayoutSchema,
529
+ formLayoutSchema,
530
+ headingLayoutSchema,
531
+ imageLayoutSchema,
532
+ infoLayoutSchema,
533
+ instructionsLayoutSchema,
534
+ listLayoutSchema,
535
+ loadingIndicatorLayoutSchema,
536
+ markdownLayoutSchema,
537
+ modalLayoutSchema,
538
+ paragraphLayoutSchema,
539
+ reviewLayoutSchema,
540
+ searchLayoutSchema,
541
+ sectionLayoutSchema,
542
+ statusListLayoutSchema,
543
+ ]),
544
+ );
545
+
546
+ export const pollingSchema: z.ZodSchema<Polling> = z.lazy(() =>
522
547
  z.object({
523
- param: z.string(),
524
- idProperty: z.string(),
525
- schema: schemaSchema,
548
+ interval: z.number().optional(),
526
549
  url: z.string(),
527
- method: httpMethodSchema,
550
+ delay: z.number().optional(),
551
+ timeout: z.number().optional(),
552
+ maxAttempts: z.number(),
553
+ onError: pollingOnErrorSchema,
554
+ }),
555
+ );
556
+
557
+ export const linkHandlerSchema: z.ZodSchema<LinkHandler> = z.lazy(() =>
558
+ z.object({
559
+ regexPattern: z.string(),
560
+ behavior: behaviorSchema.optional(),
561
+ }),
562
+ );
563
+
564
+ export const additionalInfoSchema: z.ZodSchema<AdditionalInfo> = z.lazy(() =>
565
+ z.object({
566
+ text: z.string(),
567
+ behavior: behaviorSchema.optional(),
568
+ accessibilityDescription: z.string().optional(),
569
+ }),
570
+ );
571
+
572
+ export const behaviorSchema: z.ZodSchema<Behavior> = z.lazy(() =>
573
+ z.union([
574
+ actionBehaviorSchema,
575
+ containerBehaviorSchema,
576
+ dismissBehaviorSchema,
577
+ linkBehaviorSchema,
578
+ modalBehaviorSchema,
579
+ refreshBehaviorSchema,
580
+ ]),
581
+ );
582
+
583
+ export const constSchemaSchema: z.ZodSchema<ConstSchema> = z.lazy(() =>
584
+ z.object({
585
+ hidden: z.boolean().optional(),
586
+ alert: alertLayoutSchema.optional(),
587
+ control: z.string().optional(),
588
+ promoted: z.boolean().optional(),
589
+ $id: z.string().optional(),
590
+ const: jsonElementSchema,
591
+ title: z.string().optional(),
592
+ description: z.string().optional(),
593
+ icon: iconSchema.optional(),
594
+ image: imageSchema.optional(),
595
+ keywords: z.array(z.string()).optional(),
596
+ summary: summaryProviderSchema.optional(),
597
+ analyticsId: z.string().optional(),
598
+ disabled: z.boolean().optional(),
528
599
  }),
529
600
  );
530
601
 
@@ -539,22 +610,19 @@ export const alertLayoutSchema: z.ZodSchema<AlertLayout> = z.lazy(() =>
539
610
  }),
540
611
  );
541
612
 
542
- export const integerSchemaSchema: z.ZodSchema<IntegerSchema> = z.lazy(() =>
613
+ export const booleanSchemaSchema: z.ZodSchema<BooleanSchema> = z.lazy(() =>
543
614
  z.object({
544
- type: z.literal('integer'),
615
+ type: z.literal('boolean'),
545
616
  autofillProvider: z.string().optional(),
546
617
  promoted: z.boolean().optional(),
547
618
  refreshFormOnChange: z.boolean().optional(),
548
619
  refreshUrl: z.string().optional(),
549
620
  refreshFormUrl: z.string().optional(),
550
- placeholder: z.string().optional(),
551
- minimum: z.number().optional(),
552
- maximum: z.number().optional(),
553
621
  $id: z.string().optional(),
554
622
  title: z.string().optional(),
555
623
  description: z.string().optional(),
556
624
  control: z.string().optional(),
557
- default: z.number().optional(),
625
+ default: z.boolean().optional(),
558
626
  hidden: z.boolean().optional(),
559
627
  disabled: z.boolean().optional(),
560
628
  icon: iconSchema.optional(),
@@ -565,49 +633,20 @@ export const integerSchemaSchema: z.ZodSchema<IntegerSchema> = z.lazy(() =>
565
633
  persistAsync: persistAsyncSchema.optional(),
566
634
  refreshStepOnChange: z.boolean().optional(),
567
635
  validationAsync: validateAsyncSchema.optional(),
568
- validationMessages: z.record(z.string()).optional(),
569
636
  alert: alertLayoutSchema.optional(),
570
- autocompleteHint: z.array(autocompleteTokenSchema).optional(),
571
637
  autofillKey: z.string().optional(),
572
638
  help: helpSchema.optional(),
639
+ onChange: behaviorSchema.optional(),
573
640
  }),
574
641
  );
575
642
 
576
- export const allOfSchemaSchema: z.ZodSchema<AllOfSchema> = z.lazy(() =>
577
- z.object({
578
- disabled: z.boolean().optional(),
579
- promoted: z.boolean().optional(),
580
- allOf: z.array(schemaSchema),
581
- $id: z.string().optional(),
582
- title: z.string().optional(),
583
- description: z.string().optional(),
584
- control: z.string().optional(),
585
- hidden: z.boolean().optional(),
586
- icon: iconSchema.optional(),
587
- image: imageSchema.optional(),
588
- keywords: z.array(z.string()).optional(),
589
- summary: summaryProviderSchema.optional(),
590
- analyticsId: z.string().optional(),
591
- alert: alertLayoutSchema.optional(),
592
- }),
593
- );
594
-
595
- export const constSchemaSchema: z.ZodSchema<ConstSchema> = z.lazy(() =>
643
+ export const persistAsyncSchema: z.ZodSchema<PersistAsync> = z.lazy(() =>
596
644
  z.object({
597
- hidden: z.boolean().optional(),
598
- alert: alertLayoutSchema.optional(),
599
- control: z.string().optional(),
600
- promoted: z.boolean().optional(),
601
- $id: z.string().optional(),
602
- const: jsonElementSchema,
603
- title: z.string().optional(),
604
- description: z.string().optional(),
605
- icon: iconSchema.optional(),
606
- image: imageSchema.optional(),
607
- keywords: z.array(z.string()).optional(),
608
- summary: summaryProviderSchema.optional(),
609
- analyticsId: z.string().optional(),
610
- disabled: z.boolean().optional(),
645
+ param: z.string(),
646
+ idProperty: z.string(),
647
+ schema: schemaSchema,
648
+ url: z.string(),
649
+ method: httpMethodSchema,
611
650
  }),
612
651
  );
613
652
 
@@ -615,12 +654,17 @@ export const arraySchemaSchema: z.ZodSchema<ArraySchema> = z.lazy(() =>
615
654
  z.union([arraySchemaListSchema, arraySchemaTupleSchema]),
616
655
  );
617
656
 
618
- export const arraySchemaTupleSchema: z.ZodSchema<ArraySchemaTuple> = z.lazy(() =>
657
+ export const arraySchemaListSchema: z.ZodSchema<ArraySchemaList> = z.lazy(() =>
619
658
  z.object({
620
659
  type: z.literal('array'),
621
660
  promoted: z.boolean().optional(),
622
661
  $id: z.string().optional(),
623
- items: z.array(schemaSchema),
662
+ items: schemaSchema,
663
+ addItemTitle: z.string(),
664
+ editItemTitle: z.string(),
665
+ minItems: z.number().optional(),
666
+ maxItems: z.number().optional(),
667
+ placeholder: z.string().optional(),
624
668
  title: z.string().optional(),
625
669
  description: z.string().optional(),
626
670
  control: z.string().optional(),
@@ -628,24 +672,22 @@ export const arraySchemaTupleSchema: z.ZodSchema<ArraySchemaTuple> = z.lazy(() =
628
672
  icon: iconSchema.optional(),
629
673
  image: imageSchema.optional(),
630
674
  keywords: z.array(z.string()).optional(),
631
- summary: summaryProviderSchema.optional(),
675
+ summary: summarySummariserSchema.optional(),
632
676
  analyticsId: z.string().optional(),
633
677
  persistAsync: persistAsyncSchema.optional(),
634
678
  validationAsync: validateAsyncSchema.optional(),
635
679
  alert: alertLayoutSchema.optional(),
680
+ validationMessages: z.record(z.string()).optional(),
681
+ disabled: z.boolean().optional(),
636
682
  }),
637
683
  );
638
684
 
639
- export const objectSchemaSchema: z.ZodSchema<ObjectSchema> = z.lazy(() =>
685
+ export const arraySchemaTupleSchema: z.ZodSchema<ArraySchemaTuple> = z.lazy(() =>
640
686
  z.object({
641
- type: z.literal('object'),
642
- disabled: z.boolean().optional(),
687
+ type: z.literal('array'),
643
688
  promoted: z.boolean().optional(),
644
- help: helpSchema.optional(),
645
- properties: z.record(schemaSchema),
646
- displayOrder: z.array(z.string()),
647
- required: z.array(z.string()).optional(),
648
689
  $id: z.string().optional(),
690
+ items: z.array(schemaSchema),
649
691
  title: z.string().optional(),
650
692
  description: z.string().optional(),
651
693
  control: z.string().optional(),
@@ -655,6 +697,8 @@ export const objectSchemaSchema: z.ZodSchema<ObjectSchema> = z.lazy(() =>
655
697
  keywords: z.array(z.string()).optional(),
656
698
  summary: summaryProviderSchema.optional(),
657
699
  analyticsId: z.string().optional(),
700
+ persistAsync: persistAsyncSchema.optional(),
701
+ validationAsync: validateAsyncSchema.optional(),
658
702
  alert: alertLayoutSchema.optional(),
659
703
  }),
660
704
  );
@@ -702,62 +746,86 @@ export const stringSchemaSchema: z.ZodSchema<StringSchema> = z.lazy(() =>
702
746
  autofillKey: z.string().optional(),
703
747
  help: helpSchema.optional(),
704
748
  suggestions: suggestionsSchema.optional(),
749
+ onChange: behaviorSchema.optional(),
705
750
  }),
706
751
  );
707
752
 
708
- export const oneOfSchemaSchema: z.ZodSchema<OneOfSchema> = z.lazy(() =>
753
+ export const blobSchemaSchema: z.ZodSchema<BlobSchema> = z.lazy(() =>
709
754
  z.object({
710
- autofillProvider: z.string().optional(),
755
+ type: z.literal('blob'),
711
756
  promoted: z.boolean().optional(),
712
- refreshFormOnChange: z.boolean().optional(),
713
- refreshUrl: z.string().optional(),
714
- refreshFormUrl: z.string().optional(),
715
- promotion: jsonElementSchema.optional(),
716
- oneOf: z.array(schemaSchema),
717
- placeholder: z.string().optional(),
718
757
  $id: z.string().optional(),
719
758
  title: z.string().optional(),
720
759
  description: z.string().optional(),
721
760
  control: z.string().optional(),
722
- default: jsonElementSchema.optional(),
723
761
  hidden: z.boolean().optional(),
724
762
  icon: iconSchema.optional(),
725
763
  image: imageSchema.optional(),
726
764
  keywords: z.array(z.string()).optional(),
727
765
  summary: summaryProviderSchema.optional(),
728
766
  analyticsId: z.string().optional(),
729
- refreshStepOnChange: z.boolean().optional(),
730
- alert: alertLayoutSchema.optional(),
731
- help: helpSchema.optional(),
732
- autocompleteHint: z.array(autocompleteTokenSchema).optional(),
733
- autofillKey: z.string().optional(),
767
+ validationAsync: validateAsyncSchema.optional(),
734
768
  validationMessages: z.record(z.string()).optional(),
769
+ alert: alertLayoutSchema.optional(),
770
+ cameraConfig: jsonElementSchema.optional(),
771
+ accepts: z.array(z.string()).optional(),
772
+ maxSize: z.number().optional(),
773
+ source: uploadSourceSchema.optional(),
735
774
  disabled: z.boolean().optional(),
736
775
  }),
737
776
  );
738
777
 
739
- export const blobSchemaSchema: z.ZodSchema<BlobSchema> = z.lazy(() =>
778
+ export const allOfSchemaSchema: z.ZodSchema<AllOfSchema> = z.lazy(() =>
740
779
  z.object({
741
- type: z.literal('blob'),
780
+ disabled: z.boolean().optional(),
781
+ promoted: z.boolean().optional(),
782
+ allOf: z.array(schemaSchema),
783
+ $id: z.string().optional(),
784
+ title: z.string().optional(),
785
+ description: z.string().optional(),
786
+ control: z.string().optional(),
787
+ hidden: z.boolean().optional(),
788
+ icon: iconSchema.optional(),
789
+ image: imageSchema.optional(),
790
+ keywords: z.array(z.string()).optional(),
791
+ summary: summaryProviderSchema.optional(),
792
+ analyticsId: z.string().optional(),
793
+ alert: alertLayoutSchema.optional(),
794
+ }),
795
+ );
796
+
797
+ export const integerSchemaSchema: z.ZodSchema<IntegerSchema> = z.lazy(() =>
798
+ z.object({
799
+ type: z.literal('integer'),
800
+ autofillProvider: z.string().optional(),
742
801
  promoted: z.boolean().optional(),
802
+ refreshFormOnChange: z.boolean().optional(),
803
+ refreshUrl: z.string().optional(),
804
+ refreshFormUrl: z.string().optional(),
805
+ placeholder: z.string().optional(),
806
+ minimum: z.number().optional(),
807
+ maximum: z.number().optional(),
743
808
  $id: z.string().optional(),
744
809
  title: z.string().optional(),
745
810
  description: z.string().optional(),
746
811
  control: z.string().optional(),
812
+ default: z.number().optional(),
747
813
  hidden: z.boolean().optional(),
814
+ disabled: z.boolean().optional(),
748
815
  icon: iconSchema.optional(),
749
816
  image: imageSchema.optional(),
750
817
  keywords: z.array(z.string()).optional(),
751
818
  summary: summaryProviderSchema.optional(),
752
819
  analyticsId: z.string().optional(),
820
+ persistAsync: persistAsyncSchema.optional(),
821
+ refreshStepOnChange: z.boolean().optional(),
753
822
  validationAsync: validateAsyncSchema.optional(),
754
823
  validationMessages: z.record(z.string()).optional(),
755
824
  alert: alertLayoutSchema.optional(),
756
- cameraConfig: jsonElementSchema.optional(),
757
- accepts: z.array(z.string()).optional(),
758
- maxSize: z.number().optional(),
759
- source: uploadSourceSchema.optional(),
760
- disabled: z.boolean().optional(),
825
+ autocompleteHint: z.array(autocompleteTokenSchema).optional(),
826
+ autofillKey: z.string().optional(),
827
+ help: helpSchema.optional(),
828
+ onChange: behaviorSchema.optional(),
761
829
  }),
762
830
  );
763
831
 
@@ -792,68 +860,85 @@ export const numberSchemaSchema: z.ZodSchema<NumberSchema> = z.lazy(() =>
792
860
  autocompleteHint: z.array(autocompleteTokenSchema).optional(),
793
861
  autofillKey: z.string().optional(),
794
862
  help: helpSchema.optional(),
863
+ onChange: behaviorSchema.optional(),
795
864
  }),
796
865
  );
797
866
 
798
- export const booleanSchemaSchema: z.ZodSchema<BooleanSchema> = z.lazy(() =>
867
+ export const objectSchemaSchema: z.ZodSchema<ObjectSchema> = z.lazy(() =>
868
+ z.object({
869
+ type: z.literal('object'),
870
+ disabled: z.boolean().optional(),
871
+ promoted: z.boolean().optional(),
872
+ help: helpSchema.optional(),
873
+ properties: z.record(schemaSchema),
874
+ displayOrder: z.array(z.string()),
875
+ required: z.array(z.string()).optional(),
876
+ $id: z.string().optional(),
877
+ title: z.string().optional(),
878
+ description: z.string().optional(),
879
+ control: z.string().optional(),
880
+ hidden: z.boolean().optional(),
881
+ icon: iconSchema.optional(),
882
+ image: imageSchema.optional(),
883
+ keywords: z.array(z.string()).optional(),
884
+ summary: summaryProviderSchema.optional(),
885
+ analyticsId: z.string().optional(),
886
+ alert: alertLayoutSchema.optional(),
887
+ }),
888
+ );
889
+
890
+ export const oneOfSchemaSchema: z.ZodSchema<OneOfSchema> = z.lazy(() =>
799
891
  z.object({
800
- type: z.literal('boolean'),
801
892
  autofillProvider: z.string().optional(),
802
893
  promoted: z.boolean().optional(),
803
894
  refreshFormOnChange: z.boolean().optional(),
804
895
  refreshUrl: z.string().optional(),
805
896
  refreshFormUrl: z.string().optional(),
897
+ promotion: jsonElementSchema.optional(),
898
+ oneOf: z.array(schemaSchema),
899
+ placeholder: z.string().optional(),
806
900
  $id: z.string().optional(),
807
901
  title: z.string().optional(),
808
902
  description: z.string().optional(),
809
903
  control: z.string().optional(),
810
- default: z.boolean().optional(),
904
+ default: jsonElementSchema.optional(),
811
905
  hidden: z.boolean().optional(),
812
- disabled: z.boolean().optional(),
813
906
  icon: iconSchema.optional(),
814
907
  image: imageSchema.optional(),
815
908
  keywords: z.array(z.string()).optional(),
816
909
  summary: summaryProviderSchema.optional(),
817
910
  analyticsId: z.string().optional(),
818
- persistAsync: persistAsyncSchema.optional(),
819
911
  refreshStepOnChange: z.boolean().optional(),
820
- validationAsync: validateAsyncSchema.optional(),
821
912
  alert: alertLayoutSchema.optional(),
822
- autofillKey: z.string().optional(),
823
913
  help: helpSchema.optional(),
914
+ autocompleteHint: z.array(autocompleteTokenSchema).optional(),
915
+ autofillKey: z.string().optional(),
916
+ validationMessages: z.record(z.string()).optional(),
917
+ disabled: z.boolean().optional(),
918
+ onChange: behaviorSchema.optional(),
824
919
  }),
825
920
  );
826
921
 
827
- export const modalResponseBodySchema: z.ZodSchema<ModalResponseBody> = z.lazy(() =>
922
+ export const pollingOnErrorSchema: z.ZodSchema<PollingOnError> = z.lazy(() =>
923
+ z.object({
924
+ action: actionSchema.optional(),
925
+ behavior: behaviorSchema.optional(),
926
+ }),
927
+ );
928
+
929
+ export const modalBehaviorSchema: z.ZodSchema<ModalBehavior> = z.lazy(() =>
828
930
  z.object({
931
+ type: z.literal('modal'),
829
932
  title: z.string().optional(),
830
933
  content: z.array(layoutSchema),
831
934
  }),
832
935
  );
833
936
 
834
- export const layoutSchema: z.ZodSchema<Layout> = z.lazy(() =>
835
- z.union([
836
- alertLayoutSchema,
837
- boxLayoutSchema,
838
- buttonLayoutSchema,
839
- columnsLayoutSchema,
840
- decisionLayoutSchema,
841
- dividerLayoutSchema,
842
- formLayoutSchema,
843
- headingLayoutSchema,
844
- imageLayoutSchema,
845
- infoLayoutSchema,
846
- instructionsLayoutSchema,
847
- listLayoutSchema,
848
- loadingIndicatorLayoutSchema,
849
- markdownLayoutSchema,
850
- modalLayoutSchema,
851
- paragraphLayoutSchema,
852
- reviewLayoutSchema,
853
- searchLayoutSchema,
854
- sectionLayoutSchema,
855
- statusListLayoutSchema,
856
- ]),
937
+ export const modalLayoutContentSchema: z.ZodSchema<ModalLayoutContent> = z.lazy(() =>
938
+ z.object({
939
+ title: z.string().optional(),
940
+ components: z.array(layoutSchema),
941
+ }),
857
942
  );
858
943
 
859
944
  export const listLayoutItemSchema: z.ZodSchema<ListLayoutItem> = z.lazy(() =>
@@ -873,14 +958,6 @@ export const listLayoutItemSchema: z.ZodSchema<ListLayoutItem> = z.lazy(() =>
873
958
  }),
874
959
  );
875
960
 
876
- export const additionalInfoSchema: z.ZodSchema<AdditionalInfo> = z.lazy(() =>
877
- z.object({
878
- text: z.string(),
879
- behavior: behaviorSchema.optional(),
880
- accessibilityDescription: z.string().optional(),
881
- }),
882
- );
883
-
884
961
  export const statusListLayoutItemSchema: z.ZodSchema<StatusListLayoutItem> = z.lazy(() =>
885
962
  z.object({
886
963
  title: z.string(),
@@ -900,35 +977,6 @@ export const itemCallToActionSchema: z.ZodSchema<ItemCallToAction> = z.lazy(() =
900
977
  }),
901
978
  );
902
979
 
903
- export const alertLayoutCallToActionSchema: z.ZodSchema<AlertLayoutCallToAction> = z.lazy(() =>
904
- z.object({
905
- title: z.string(),
906
- accessibilityDescription: z.string().optional(),
907
- behavior: behaviorSchema,
908
- }),
909
- );
910
-
911
- export const behaviorSchema: z.ZodSchema<Behavior> = z.lazy(() =>
912
- z.union([
913
- actionBehaviorSchema,
914
- containerBehaviorSchema,
915
- dismissBehaviorSchema,
916
- linkBehaviorSchema,
917
- modalBehaviorSchema,
918
- ]),
919
- );
920
-
921
- export const boxLayoutSchema: z.ZodSchema<BoxLayout> = z.lazy(() =>
922
- z.object({
923
- type: z.literal('box'),
924
- components: z.array(layoutSchema),
925
- width: sizeSchema.optional(),
926
- border: z.boolean().optional(),
927
- control: z.string().optional(),
928
- margin: sizeSchema.optional(),
929
- }),
930
- );
931
-
932
980
  export const decisionLayoutSchema: z.ZodSchema<DecisionLayout> = z.lazy(() =>
933
981
  z.object({
934
982
  type: z.literal('decision'),
@@ -955,48 +1003,51 @@ export const decisionLayoutOptionSchema: z.ZodSchema<DecisionLayoutOption> = z.l
955
1003
  }),
956
1004
  );
957
1005
 
958
- export const columnsLayoutSchema: z.ZodSchema<ColumnsLayout> = z.lazy(() =>
1006
+ export const reviewLayoutCallToActionSchema: z.ZodSchema<ReviewLayoutCallToAction> = z.lazy(() =>
959
1007
  z.object({
960
- type: z.literal('columns'),
961
- left: z.array(layoutSchema),
962
- right: z.array(layoutSchema),
963
- bias: columnsLayoutBiasSchema.optional(),
964
- control: z.string().optional(),
965
- margin: sizeSchema.optional(),
1008
+ action: actionSchema.optional(),
1009
+ title: z.string(),
1010
+ accessibilityDescription: z.string().optional(),
1011
+ behavior: behaviorSchema.optional(),
966
1012
  }),
967
1013
  );
968
1014
 
969
- export const sectionLayoutSchema: z.ZodSchema<SectionLayout> = z.lazy(() =>
1015
+ export const modalLayoutSchema: z.ZodSchema<ModalLayout> = z.lazy(() =>
970
1016
  z.object({
971
- type: z.literal('section'),
972
- components: z.array(layoutSchema),
973
- title: z.string(),
974
- callToAction: sectionLayoutCallToActionSchema.optional(),
1017
+ type: z.literal('modal'),
975
1018
  control: z.string().optional(),
976
1019
  margin: sizeSchema.optional(),
1020
+ trigger: modalLayoutTriggerSchema,
1021
+ content: modalLayoutContentSchema,
977
1022
  }),
978
1023
  );
979
1024
 
980
- export const sectionLayoutCallToActionSchema: z.ZodSchema<SectionLayoutCallToAction> = z.lazy(() =>
1025
+ export const statusListLayoutSchema: z.ZodSchema<StatusListLayout> = z.lazy(() =>
981
1026
  z.object({
982
- title: z.string(),
983
- accessibilityDescription: z.string().optional(),
984
- behavior: behaviorSchema,
1027
+ type: z.literal('status-list'),
1028
+ items: z.array(statusListLayoutItemSchema),
1029
+ title: z.string().optional(),
1030
+ control: z.string().optional(),
1031
+ margin: sizeSchema.optional(),
985
1032
  }),
986
1033
  );
987
1034
 
988
- export const listLayoutSchema: z.ZodSchema<ListLayout> = z.lazy(() =>
1035
+ export const reviewLayoutFieldSchema: z.ZodSchema<ReviewLayoutField> = z.lazy(() =>
989
1036
  z.object({
990
- type: z.literal('list'),
991
- title: z.string().optional(),
992
- callToAction: listLayoutCallToActionSchema.optional(),
993
- items: z.array(listLayoutItemSchema),
994
- control: z.string().optional(),
995
- margin: sizeSchema.optional(),
1037
+ label: z.string(),
1038
+ value: z.string(),
1039
+ rawValue: z.string().optional(),
1040
+ help: helpSchema.optional(),
1041
+ tag: z.string().optional(),
1042
+ icon: iconSchema.optional(),
1043
+ image: imageSchema.optional(),
1044
+ additionalInfo: additionalInfoSchema.optional(),
1045
+ inlineAlert: inlineAlertSchema.optional(),
1046
+ callToAction: reviewLayoutCallToActionSchema.optional(),
996
1047
  }),
997
1048
  );
998
1049
 
999
- export const listLayoutCallToActionSchema: z.ZodSchema<ListLayoutCallToAction> = z.lazy(() =>
1050
+ export const sectionLayoutCallToActionSchema: z.ZodSchema<SectionLayoutCallToAction> = z.lazy(() =>
1000
1051
  z.object({
1001
1052
  title: z.string(),
1002
1053
  accessibilityDescription: z.string().optional(),
@@ -1004,39 +1055,45 @@ export const listLayoutCallToActionSchema: z.ZodSchema<ListLayoutCallToAction> =
1004
1055
  }),
1005
1056
  );
1006
1057
 
1007
- export const reviewLayoutCallToActionSchema: z.ZodSchema<ReviewLayoutCallToAction> = z.lazy(() =>
1058
+ export const alertLayoutCallToActionSchema: z.ZodSchema<AlertLayoutCallToAction> = z.lazy(() =>
1008
1059
  z.object({
1009
- action: actionSchema.optional(),
1010
1060
  title: z.string(),
1011
1061
  accessibilityDescription: z.string().optional(),
1012
- behavior: behaviorSchema.optional(),
1062
+ behavior: behaviorSchema,
1013
1063
  }),
1014
1064
  );
1015
1065
 
1016
- export const statusListLayoutSchema: z.ZodSchema<StatusListLayout> = z.lazy(() =>
1066
+ export const listLayoutCallToActionSchema: z.ZodSchema<ListLayoutCallToAction> = z.lazy(() =>
1017
1067
  z.object({
1018
- type: z.literal('status-list'),
1019
- items: z.array(statusListLayoutItemSchema),
1020
- title: z.string().optional(),
1021
- control: z.string().optional(),
1022
- margin: sizeSchema.optional(),
1068
+ title: z.string(),
1069
+ accessibilityDescription: z.string().optional(),
1070
+ behavior: behaviorSchema,
1023
1071
  }),
1024
1072
  );
1025
1073
 
1026
- export const modalLayoutSchema: z.ZodSchema<ModalLayout> = z.lazy(() =>
1074
+ export const sectionLayoutSchema: z.ZodSchema<SectionLayout> = z.lazy(() =>
1027
1075
  z.object({
1028
- type: z.literal('modal'),
1076
+ type: z.literal('section'),
1077
+ components: z.array(layoutSchema),
1078
+ title: z.string(),
1079
+ callToAction: sectionLayoutCallToActionSchema.optional(),
1029
1080
  control: z.string().optional(),
1030
1081
  margin: sizeSchema.optional(),
1031
- trigger: modalLayoutTriggerSchema,
1032
- content: modalLayoutContentSchema,
1033
1082
  }),
1034
1083
  );
1035
1084
 
1036
- export const modalLayoutContentSchema: z.ZodSchema<ModalLayoutContent> = z.lazy(() =>
1085
+ export const buttonLayoutSchema: z.ZodSchema<ButtonLayout> = z.lazy(() =>
1037
1086
  z.object({
1087
+ type: z.literal('button'),
1088
+ action: actionSchema.optional(),
1089
+ size: sizeSchema.optional(),
1038
1090
  title: z.string().optional(),
1039
- components: z.array(layoutSchema),
1091
+ behavior: behaviorSchema.optional(),
1092
+ context: contextSchema.optional(),
1093
+ disabled: z.boolean().optional(),
1094
+ pinOrder: z.number().optional(),
1095
+ control: z.string().optional(),
1096
+ margin: sizeSchema.optional(),
1040
1097
  }),
1041
1098
  );
1042
1099
 
@@ -1053,89 +1110,42 @@ export const reviewLayoutSchema: z.ZodSchema<ReviewLayout> = z.lazy(() =>
1053
1110
  }),
1054
1111
  );
1055
1112
 
1056
- export const reviewLayoutFieldSchema: z.ZodSchema<ReviewLayoutField> = z.lazy(() =>
1057
- z.object({
1058
- label: z.string(),
1059
- value: z.string(),
1060
- rawValue: z.string().optional(),
1061
- help: helpSchema.optional(),
1062
- tag: z.string().optional(),
1063
- icon: iconSchema.optional(),
1064
- image: imageSchema.optional(),
1065
- additionalInfo: additionalInfoSchema.optional(),
1066
- inlineAlert: inlineAlertSchema.optional(),
1067
- callToAction: reviewLayoutCallToActionSchema.optional(),
1068
- }),
1069
- );
1070
-
1071
- export const buttonLayoutSchema: z.ZodSchema<ButtonLayout> = z.lazy(() =>
1113
+ export const columnsLayoutSchema: z.ZodSchema<ColumnsLayout> = z.lazy(() =>
1072
1114
  z.object({
1073
- type: z.literal('button'),
1074
- action: actionSchema.optional(),
1075
- size: sizeSchema.optional(),
1076
- title: z.string().optional(),
1077
- behavior: behaviorSchema.optional(),
1078
- context: contextSchema.optional(),
1079
- disabled: z.boolean().optional(),
1080
- pinOrder: z.number().optional(),
1115
+ type: z.literal('columns'),
1116
+ left: z.array(layoutSchema),
1117
+ right: z.array(layoutSchema),
1118
+ bias: columnsLayoutBiasSchema.optional(),
1081
1119
  control: z.string().optional(),
1082
1120
  margin: sizeSchema.optional(),
1083
1121
  }),
1084
1122
  );
1085
1123
 
1086
- export const stepSchema: z.ZodSchema<Step> = z.lazy(() =>
1124
+ export const boxLayoutSchema: z.ZodSchema<BoxLayout> = z.lazy(() =>
1087
1125
  z.object({
1088
- key: z.string().optional(),
1089
- type: z.string().optional(),
1090
- actions: z.array(actionSchema).optional(),
1091
- refreshFormUrl: z.string().optional(),
1092
- id: z.string(),
1093
- title: z.string(),
1094
- schemas: z.array(schemaSchema),
1095
- layout: z.array(layoutSchema),
1096
- description: z.string().optional(),
1097
- model: jsonElementSchema.optional(),
1098
- external: externalSchema.optional(),
1099
- polling: pollingSchema.optional(),
1100
- linkHandlers: z.array(linkHandlerSchema).optional(),
1101
- analytics: z.record(z.string()).optional(),
1102
- errors: stepErrorSchema.optional(),
1103
- navigation: navigationSchema.optional(),
1104
- refreshUrl: z.string().optional(),
1126
+ type: z.literal('box'),
1127
+ components: z.array(layoutSchema),
1128
+ width: sizeSchema.optional(),
1129
+ border: z.boolean().optional(),
1105
1130
  control: z.string().optional(),
1106
- refreshAfter: z.string().optional(),
1107
- }),
1108
- );
1109
-
1110
- export const pollingSchema: z.ZodSchema<Polling> = z.lazy(() =>
1111
- z.object({
1112
- interval: z.number().optional(),
1113
- url: z.string(),
1114
- delay: z.number().optional(),
1115
- timeout: z.number().optional(),
1116
- maxAttempts: z.number(),
1117
- onError: pollingOnErrorSchema,
1131
+ margin: sizeSchema.optional(),
1118
1132
  }),
1119
1133
  );
1120
1134
 
1121
- export const linkHandlerSchema: z.ZodSchema<LinkHandler> = z.lazy(() =>
1135
+ export const listLayoutSchema: z.ZodSchema<ListLayout> = z.lazy(() =>
1122
1136
  z.object({
1123
- regexPattern: z.string(),
1124
- behavior: behaviorSchema.optional(),
1137
+ type: z.literal('list'),
1138
+ title: z.string().optional(),
1139
+ callToAction: listLayoutCallToActionSchema.optional(),
1140
+ items: z.array(listLayoutItemSchema),
1141
+ control: z.string().optional(),
1142
+ margin: sizeSchema.optional(),
1125
1143
  }),
1126
1144
  );
1127
1145
 
1128
- export const modalBehaviorSchema: z.ZodSchema<ModalBehavior> = z.lazy(() =>
1146
+ export const modalResponseBodySchema: z.ZodSchema<ModalResponseBody> = z.lazy(() =>
1129
1147
  z.object({
1130
- type: z.literal('modal'),
1131
1148
  title: z.string().optional(),
1132
1149
  content: z.array(layoutSchema),
1133
1150
  }),
1134
1151
  );
1135
-
1136
- export const pollingOnErrorSchema: z.ZodSchema<PollingOnError> = z.lazy(() =>
1137
- z.object({
1138
- action: actionSchema.optional(),
1139
- behavior: behaviorSchema.optional(),
1140
- }),
1141
- );