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