@wise/dynamic-flow-types 3.2.0 → 3.3.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,44 +2,47 @@
2
2
  import { z } from 'zod';
3
3
  import type {
4
4
  JsonElement,
5
- BooleanSchema,
6
- PersistAsync,
7
- AlertLayout,
5
+ ModalResponseBody,
6
+ Layout,
8
7
  Schema,
9
8
  AllOfSchema,
10
9
  ArraySchema,
11
10
  BlobSchema,
11
+ BooleanSchema,
12
12
  ConstSchema,
13
13
  IntegerSchema,
14
14
  NumberSchema,
15
15
  ObjectSchema,
16
16
  OneOfSchema,
17
17
  StringSchema,
18
- ArraySchemaTuple,
18
+ PersistAsync,
19
+ AlertLayout,
19
20
  ArraySchemaList,
20
- PollingOnError,
21
+ ArraySchemaTuple,
22
+ AdditionalInfo,
21
23
  Behavior,
22
- Polling,
23
- ModalBehavior,
24
- Layout,
25
- LinkHandler,
26
- DecisionLayout,
27
24
  DecisionLayoutOption,
28
- StatusListLayout,
29
- StatusListLayoutItem,
30
- ListLayoutCallToAction,
25
+ ListLayoutItem,
26
+ ItemCallToAction,
31
27
  BoxLayout,
28
+ AlertLayoutCallToAction,
32
29
  ButtonLayout,
30
+ ReviewLayout,
31
+ ReviewLayoutField,
32
+ ReviewLayoutCallToAction,
33
33
  ColumnsLayout,
34
+ DecisionLayout,
34
35
  ListLayout,
35
36
  ModalLayout,
36
- ReviewLayout,
37
- ItemCallToAction,
38
- AlertLayoutCallToAction,
39
- ReviewLayoutCallToAction,
37
+ StatusListLayout,
38
+ StatusListLayoutItem,
40
39
  ModalLayoutContent,
40
+ ListLayoutCallToAction,
41
41
  Step,
42
- ModalResponseBody,
42
+ Polling,
43
+ LinkHandler,
44
+ ModalBehavior,
45
+ PollingOnError,
43
46
  } from '../next';
44
47
 
45
48
  export const imageSchema = z.object({
@@ -49,16 +52,25 @@ export const imageSchema = z.object({
49
52
  accessibilityDescription: z.string().optional(),
50
53
  });
51
54
 
52
- export const summaryProviderSchema = z.object({
53
- providesTitle: z.boolean().optional(),
54
- providesDescription: z.boolean().optional(),
55
- providesIcon: z.boolean().optional(),
56
- providesImage: z.boolean().optional(),
57
- });
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
+ ]);
58
62
 
59
- export const helpSchema = z.object({
60
- markdown: z.string(),
61
- });
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
+ );
62
74
 
63
75
  export const stringSchemaFormatSchema = z.union([
64
76
  z.literal('date'),
@@ -76,17 +88,18 @@ export const autocapitalizationTypeSchema = z.union([
76
88
  z.literal('words'),
77
89
  ]);
78
90
 
79
- export const jsonElementSchema: z.ZodSchema<JsonElement> = z.lazy(() =>
80
- z
81
- .union([
82
- z.string(),
83
- z.number(),
84
- z.boolean(),
85
- z.record(jsonElementSchema),
86
- z.array(jsonElementSchema),
87
- ])
88
- .nullable(),
89
- );
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
+ });
90
103
 
91
104
  export const uploadSourceSchema = z.union([z.literal('camera'), z.literal('file')]);
92
105
 
@@ -156,49 +169,32 @@ export const autocompleteTokenSchema = z.union([
156
169
  z.literal('pager'),
157
170
  ]);
158
171
 
159
- export const navigationStackBehaviorSchema = z.union([
160
- z.literal('default'),
161
- z.literal('remove-previous'),
162
- z.literal('remove-all'),
163
- z.literal('replace-current'),
164
- ]);
165
-
166
- export const linkBehaviorSchema = z.object({
167
- type: z.literal('link'),
168
- url: z.string(),
169
- });
170
-
171
- export const externalSchema = z.object({
172
- url: z.string(),
173
- });
174
-
175
- export const httpMethodSchema = z.union([
176
- z.literal('GET'),
177
- z.literal('POST'),
178
- z.literal('PUT'),
179
- z.literal('PATCH'),
180
- z.literal('DELETE'),
181
- ]);
182
-
183
- export const linkSchema = z.object({
184
- url: z.string(),
172
+ export const helpSchema = z.object({
173
+ markdown: z.string(),
185
174
  });
186
175
 
187
- export const dismissBehaviorSchema = z.object({
188
- type: z.literal('dismiss'),
176
+ export const iconTextSchema = z.object({
177
+ text: z.string(),
189
178
  });
190
179
 
191
- export const actionTypeSchema = z.union([
192
- z.literal('primary'),
193
- z.literal('secondary'),
194
- z.literal('link'),
180
+ export const contextSchema = z.union([
195
181
  z.literal('positive'),
182
+ z.literal('neutral'),
183
+ z.literal('warning'),
196
184
  z.literal('negative'),
185
+ z.literal('success'),
186
+ z.literal('failure'),
187
+ z.literal('info'),
188
+ z.literal('primary'),
197
189
  ]);
198
190
 
199
- export const stepErrorSchema = z.object({
200
- error: z.string().optional(),
201
- validation: jsonElementSchema.optional(),
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(),
202
198
  });
203
199
 
204
200
  export const sizeSchema = z.union([
@@ -209,48 +205,40 @@ export const sizeSchema = z.union([
209
205
  z.literal('xl'),
210
206
  ]);
211
207
 
208
+ export const inlineAlertSchema = z.object({
209
+ content: z.string(),
210
+ context: contextSchema.optional(),
211
+ });
212
+
212
213
  export const alignSchema = z.union([z.literal('left'), z.literal('center'), z.literal('right')]);
213
214
 
214
- export const statusListLayoutStatusSchema = z.union([
215
- z.literal('not-done'),
216
- z.literal('pending'),
217
- z.literal('done'),
218
- ]);
215
+ export const instructionsLayoutItemSchema = z.object({
216
+ text: z.string(),
217
+ context: contextSchema,
218
+ tag: z.string().optional(),
219
+ });
219
220
 
220
221
  export const formLayoutSchemaReferenceSchema = z.object({
221
222
  $ref: z.string(),
222
223
  });
223
224
 
224
- export const formLayoutSchema = z.object({
225
- type: z.literal('form'),
226
- schema: formLayoutSchemaReferenceSchema.optional(),
227
- schemaId: z.string(),
228
- control: z.string().optional(),
229
- margin: sizeSchema.optional(),
230
- });
231
-
232
225
  export const listLayoutStatusSchema = z.union([
233
226
  z.literal('warning'),
234
227
  z.literal('neutral'),
235
228
  z.literal('positive'),
236
229
  ]);
237
230
 
238
- export const columnsLayoutBiasSchema = z.union([
239
- z.literal('none'),
240
- z.literal('left'),
241
- z.literal('right'),
242
- ]);
243
-
244
- export const contextSchema = z.union([
245
- z.literal('positive'),
246
- z.literal('neutral'),
247
- z.literal('warning'),
248
- z.literal('negative'),
249
- z.literal('success'),
250
- z.literal('failure'),
251
- z.literal('info'),
252
- z.literal('primary'),
253
- ]);
231
+ export const imageLayoutSchema = z.object({
232
+ type: z.literal('image'),
233
+ text: z.string().optional(),
234
+ url: z.string().optional(),
235
+ accessibilityDescription: z.string().optional(),
236
+ content: imageSchema.optional(),
237
+ size: sizeSchema.optional(),
238
+ control: z.string().optional(),
239
+ margin: sizeSchema.optional(),
240
+ align: alignSchema.optional(),
241
+ });
254
242
 
255
243
  export const dividerLayoutSchema = z.object({
256
244
  type: z.literal('divider'),
@@ -258,6 +246,12 @@ export const dividerLayoutSchema = z.object({
258
246
  margin: sizeSchema.optional(),
259
247
  });
260
248
 
249
+ export const statusListLayoutStatusSchema = z.union([
250
+ z.literal('not-done'),
251
+ z.literal('pending'),
252
+ z.literal('done'),
253
+ ]);
254
+
261
255
  export const headingLayoutSchema = z.object({
262
256
  type: z.literal('heading'),
263
257
  text: z.string(),
@@ -313,56 +307,51 @@ export const modalLayoutTriggerSchema = z.object({
313
307
  title: z.string(),
314
308
  });
315
309
 
316
- export const reviewLayoutFieldSchema = z.object({
317
- label: z.string(),
318
- value: z.string(),
319
- rawValue: z.string().optional(),
320
- help: helpSchema.optional(),
321
- tag: z.string().optional(),
322
- });
323
-
324
- export const iconTextSchema = z.object({
325
- text: z.string(),
326
- });
310
+ export const columnsLayoutBiasSchema = z.union([
311
+ z.literal('none'),
312
+ z.literal('left'),
313
+ z.literal('right'),
314
+ ]);
327
315
 
328
- export const iconNamedSchema = z.object({
329
- name: z.string(),
316
+ export const externalSchema = z.object({
317
+ url: z.string(),
330
318
  });
331
319
 
332
- export const errorResponseBodySchema = z.object({
333
- refreshFormUrl: z.string().optional(),
334
- analytics: z.record(z.string()).optional(),
320
+ export const stepErrorSchema = z.object({
335
321
  error: z.string().optional(),
336
322
  validation: jsonElementSchema.optional(),
337
- refreshUrl: z.string().optional(),
338
323
  });
339
324
 
340
- export const searchSearchRequestSchema = z.object({
325
+ export const linkSchema = z.object({
341
326
  url: z.string(),
342
- method: httpMethodSchema,
343
- param: z.string(),
344
- query: z.string(),
345
327
  });
346
328
 
347
- export const iconSchema = z.union([iconNamedSchema, iconTextSchema]);
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
+ ]);
348
335
 
349
- export const validateAsyncSchema = z.object({
350
- param: z.string(),
351
- method: httpMethodSchema,
352
- url: z.string(),
336
+ export const dismissBehaviorSchema = z.object({
337
+ type: z.literal('dismiss'),
353
338
  });
354
339
 
355
- export const summarySummariserSchema = z.object({
356
- defaultTitle: z.string().optional(),
357
- defaultDescription: z.string().optional(),
358
- defaultIcon: iconSchema.optional(),
359
- defaultImage: imageSchema.optional(),
360
- providesTitle: z.boolean().optional(),
361
- providesDescription: z.boolean().optional(),
362
- providesIcon: z.boolean().optional(),
363
- providesImage: z.boolean().optional(),
340
+ export const linkBehaviorSchema = z.object({
341
+ type: z.literal('link'),
342
+ url: z.string(),
364
343
  });
365
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
+
366
355
  export const actionSchema = z.object({
367
356
  title: z.string().optional(),
368
357
  type: actionTypeSchema.optional(),
@@ -379,69 +368,77 @@ export const actionSchema = z.object({
379
368
  skipValidation: z.boolean().optional(),
380
369
  });
381
370
 
382
- export const suggestionsValueSchema = z.object({
383
- label: z.string(),
384
- value: jsonElementSchema,
385
- icon: iconSchema.optional(),
386
- image: imageSchema.optional(),
387
- 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(),
388
376
  });
389
377
 
390
- export const containerBehaviorSchema = z.object({
391
- action: actionSchema.optional(),
392
- link: linkSchema.optional(),
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(),
393
384
  });
394
385
 
395
- export const actionBehaviorSchema = z.object({
396
- type: z.literal('action'),
386
+ export const actionResponseBodySchema = z.object({
397
387
  action: actionSchema,
398
388
  });
399
389
 
400
- export const summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
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(),
399
+ });
401
400
 
402
- export const instructionsLayoutItemSchema = z.object({
403
- text: z.string(),
404
- context: contextSchema,
405
- tag: z.string().optional(),
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(),
406
407
  });
407
408
 
408
- export const imageLayoutSchema = z.object({
409
- type: z.literal('image'),
410
- text: z.string().optional(),
411
- url: z.string().optional(),
412
- accessibilityDescription: z.string().optional(),
413
- content: imageSchema.optional(),
414
- size: sizeSchema.optional(),
409
+ export const formLayoutSchema = z.object({
410
+ type: z.literal('form'),
411
+ schema: formLayoutSchemaReferenceSchema.optional(),
412
+ schemaId: z.string(),
415
413
  control: z.string().optional(),
416
414
  margin: sizeSchema.optional(),
417
- align: alignSchema.optional(),
418
415
  });
419
416
 
420
- export const listLayoutItemSchema = z.object({
421
- description: z.string().optional(),
422
- status: listLayoutStatusSchema.optional(),
423
- icon: iconSchema.optional(),
424
- image: imageSchema.optional(),
417
+ export const containerBehaviorSchema = z.object({
418
+ action: actionSchema.optional(),
419
+ link: linkSchema.optional(),
420
+ });
421
+
422
+ export const navigationBackBehaviorSchema = z.object({
425
423
  title: z.string().optional(),
426
- subtitle: z.string().optional(),
427
- value: z.string().optional(),
428
- subvalue: z.string().optional(),
429
- tag: z.string().optional(),
424
+ action: actionSchema,
430
425
  });
431
426
 
432
- export const actionResponseBodySchema = z.object({
427
+ export const actionBehaviorSchema = z.object({
428
+ type: z.literal('action'),
433
429
  action: actionSchema,
434
430
  });
435
431
 
436
- export const searchResultSearchSchema = z.object({
437
- type: z.literal('search'),
438
- title: z.string(),
439
- description: z.string().optional(),
432
+ export const suggestionsValueSchema = z.object({
433
+ label: z.string(),
434
+ value: jsonElementSchema,
440
435
  icon: iconSchema.optional(),
441
436
  image: imageSchema.optional(),
442
- value: searchSearchRequestSchema,
437
+ tag: z.string().optional(),
443
438
  });
444
439
 
440
+ export const summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
441
+
445
442
  export const searchResultActionSchema = z.object({
446
443
  type: z.literal('action'),
447
444
  title: z.string(),
@@ -451,83 +448,60 @@ export const searchResultActionSchema = z.object({
451
448
  value: actionSchema,
452
449
  });
453
450
 
454
- export const suggestionsSchema = z.object({
455
- values: z.array(suggestionsValueSchema),
456
- });
457
-
458
- export const navigationBackBehaviorSchema = z.object({
459
- title: z.string().optional(),
460
- action: actionSchema,
451
+ export const searchResultSearchSchema = z.object({
452
+ type: z.literal('search'),
453
+ title: z.string(),
454
+ description: z.string().optional(),
455
+ icon: iconSchema.optional(),
456
+ image: imageSchema.optional(),
457
+ value: searchSearchRequestSchema,
461
458
  });
462
459
 
463
- export const instructionsLayoutSchema = z.object({
464
- type: z.literal('instructions'),
465
- title: z.string().optional(),
466
- items: z.array(instructionsLayoutItemSchema),
467
- control: z.string().optional(),
468
- margin: sizeSchema.optional(),
460
+ export const suggestionsSchema = z.object({
461
+ values: z.array(suggestionsValueSchema),
469
462
  });
470
463
 
471
- export const searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
472
-
473
464
  export const navigationSchema = z.object({
474
465
  backButton: navigationBackBehaviorSchema.optional(),
475
466
  back: navigationBackBehaviorSchema.optional(),
476
467
  stackBehavior: navigationStackBehaviorSchema.optional(),
477
468
  });
478
469
 
470
+ export const searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
471
+
479
472
  export const searchResponseBodySchema = z.object({
480
473
  results: z.array(searchResultSchema),
481
474
  });
482
475
 
483
- export const booleanSchemaSchema: z.ZodSchema<BooleanSchema> = z.lazy(() =>
476
+ export const modalResponseBodySchema: z.ZodSchema<ModalResponseBody> = z.lazy(() =>
484
477
  z.object({
485
- type: z.literal('boolean'),
486
- autofillProvider: z.string().optional(),
487
- promoted: z.boolean().optional(),
488
- refreshFormOnChange: z.boolean().optional(),
489
- refreshUrl: z.string().optional(),
490
- refreshFormUrl: z.string().optional(),
491
- $id: z.string().optional(),
492
478
  title: z.string().optional(),
493
- description: z.string().optional(),
494
- control: z.string().optional(),
495
- default: z.boolean().optional(),
496
- hidden: z.boolean().optional(),
497
- disabled: z.boolean().optional(),
498
- icon: iconSchema.optional(),
499
- image: imageSchema.optional(),
500
- keywords: z.array(z.string()).optional(),
501
- summary: summaryProviderSchema.optional(),
502
- analyticsId: z.string().optional(),
503
- persistAsync: persistAsyncSchema.optional(),
504
- refreshStepOnChange: z.boolean().optional(),
505
- validationAsync: validateAsyncSchema.optional(),
506
- alert: alertLayoutSchema.optional(),
507
- autofillKey: z.string().optional(),
508
- help: helpSchema.optional(),
509
- }),
510
- );
511
-
512
- export const persistAsyncSchema: z.ZodSchema<PersistAsync> = z.lazy(() =>
513
- z.object({
514
- param: z.string(),
515
- idProperty: z.string(),
516
- schema: schemaSchema,
517
- url: z.string(),
518
- method: httpMethodSchema,
479
+ content: z.array(layoutSchema),
519
480
  }),
520
481
  );
521
482
 
522
- export const alertLayoutSchema: z.ZodSchema<AlertLayout> = z.lazy(() =>
523
- z.object({
524
- type: z.literal('alert'),
525
- markdown: z.string(),
526
- context: contextSchema.optional(),
527
- control: z.string().optional(),
528
- margin: sizeSchema.optional(),
529
- callToAction: alertLayoutCallToActionSchema.optional(),
530
- }),
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
+ ]),
531
505
  );
532
506
 
533
507
  export const schemaSchema: z.ZodSchema<Schema> = z.lazy(() =>
@@ -583,13 +557,42 @@ export const blobSchemaSchema: z.ZodSchema<BlobSchema> = z.lazy(() =>
583
557
  summary: summaryProviderSchema.optional(),
584
558
  analyticsId: z.string().optional(),
585
559
  validationAsync: validateAsyncSchema.optional(),
586
- validationMessages: z.record(z.string()).optional(),
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(),
566
+ disabled: z.boolean().optional(),
567
+ }),
568
+ );
569
+
570
+ export const booleanSchemaSchema: z.ZodSchema<BooleanSchema> = z.lazy(() =>
571
+ z.object({
572
+ type: z.literal('boolean'),
573
+ autofillProvider: z.string().optional(),
574
+ promoted: z.boolean().optional(),
575
+ refreshFormOnChange: z.boolean().optional(),
576
+ refreshUrl: z.string().optional(),
577
+ refreshFormUrl: z.string().optional(),
578
+ $id: z.string().optional(),
579
+ title: z.string().optional(),
580
+ description: z.string().optional(),
581
+ control: z.string().optional(),
582
+ default: z.boolean().optional(),
583
+ hidden: z.boolean().optional(),
584
+ disabled: z.boolean().optional(),
585
+ icon: iconSchema.optional(),
586
+ image: imageSchema.optional(),
587
+ keywords: z.array(z.string()).optional(),
588
+ summary: summaryProviderSchema.optional(),
589
+ analyticsId: z.string().optional(),
590
+ persistAsync: persistAsyncSchema.optional(),
591
+ refreshStepOnChange: z.boolean().optional(),
592
+ validationAsync: validateAsyncSchema.optional(),
587
593
  alert: alertLayoutSchema.optional(),
588
- cameraConfig: jsonElementSchema.optional(),
589
- accepts: z.array(z.string()).optional(),
590
- maxSize: z.number().optional(),
591
- source: uploadSourceSchema.optional(),
592
- disabled: z.boolean().optional(),
594
+ autofillKey: z.string().optional(),
595
+ help: helpSchema.optional(),
593
596
  }),
594
597
  );
595
598
 
@@ -780,12 +783,38 @@ export const stringSchemaSchema: z.ZodSchema<StringSchema> = z.lazy(() =>
780
783
  }),
781
784
  );
782
785
 
783
- export const arraySchemaTupleSchema: z.ZodSchema<ArraySchemaTuple> = z.lazy(() =>
786
+ export const persistAsyncSchema: z.ZodSchema<PersistAsync> = z.lazy(() =>
787
+ z.object({
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(),
801
+ control: z.string().optional(),
802
+ margin: sizeSchema.optional(),
803
+ callToAction: alertLayoutCallToActionSchema.optional(),
804
+ }),
805
+ );
806
+
807
+ export const arraySchemaListSchema: z.ZodSchema<ArraySchemaList> = z.lazy(() =>
784
808
  z.object({
785
809
  type: z.literal('array'),
786
810
  promoted: z.boolean().optional(),
787
811
  $id: z.string().optional(),
788
- items: z.array(schemaSchema),
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(),
789
818
  title: z.string().optional(),
790
819
  description: z.string().optional(),
791
820
  control: z.string().optional(),
@@ -793,25 +822,22 @@ export const arraySchemaTupleSchema: z.ZodSchema<ArraySchemaTuple> = z.lazy(() =
793
822
  icon: iconSchema.optional(),
794
823
  image: imageSchema.optional(),
795
824
  keywords: z.array(z.string()).optional(),
796
- summary: summaryProviderSchema.optional(),
825
+ summary: summarySummariserSchema.optional(),
797
826
  analyticsId: z.string().optional(),
798
827
  persistAsync: persistAsyncSchema.optional(),
799
828
  validationAsync: validateAsyncSchema.optional(),
800
829
  alert: alertLayoutSchema.optional(),
830
+ validationMessages: z.record(z.string()).optional(),
831
+ disabled: z.boolean().optional(),
801
832
  }),
802
833
  );
803
834
 
804
- export const arraySchemaListSchema: z.ZodSchema<ArraySchemaList> = z.lazy(() =>
835
+ export const arraySchemaTupleSchema: z.ZodSchema<ArraySchemaTuple> = z.lazy(() =>
805
836
  z.object({
806
837
  type: z.literal('array'),
807
838
  promoted: z.boolean().optional(),
808
839
  $id: z.string().optional(),
809
- items: schemaSchema,
810
- addItemTitle: z.string(),
811
- editItemTitle: z.string(),
812
- minItems: z.number().optional(),
813
- maxItems: z.number().optional(),
814
- placeholder: z.string().optional(),
840
+ items: z.array(schemaSchema),
815
841
  title: z.string().optional(),
816
842
  description: z.string().optional(),
817
843
  control: z.string().optional(),
@@ -819,20 +845,19 @@ export const arraySchemaListSchema: z.ZodSchema<ArraySchemaList> = z.lazy(() =>
819
845
  icon: iconSchema.optional(),
820
846
  image: imageSchema.optional(),
821
847
  keywords: z.array(z.string()).optional(),
822
- summary: summarySummariserSchema.optional(),
848
+ summary: summaryProviderSchema.optional(),
823
849
  analyticsId: z.string().optional(),
824
850
  persistAsync: persistAsyncSchema.optional(),
825
851
  validationAsync: validateAsyncSchema.optional(),
826
852
  alert: alertLayoutSchema.optional(),
827
- validationMessages: z.record(z.string()).optional(),
828
- disabled: z.boolean().optional(),
829
853
  }),
830
854
  );
831
855
 
832
- export const pollingOnErrorSchema: z.ZodSchema<PollingOnError> = z.lazy(() =>
856
+ export const additionalInfoSchema: z.ZodSchema<AdditionalInfo> = z.lazy(() =>
833
857
  z.object({
834
- action: actionSchema.optional(),
858
+ text: z.string(),
835
859
  behavior: behaviorSchema.optional(),
860
+ accessibilityDescription: z.string().optional(),
836
861
  }),
837
862
  );
838
863
 
@@ -846,66 +871,6 @@ export const behaviorSchema: z.ZodSchema<Behavior> = z.lazy(() =>
846
871
  ]),
847
872
  );
848
873
 
849
- export const pollingSchema: z.ZodSchema<Polling> = z.lazy(() =>
850
- z.object({
851
- interval: z.number().optional(),
852
- url: z.string(),
853
- delay: z.number().optional(),
854
- timeout: z.number().optional(),
855
- maxAttempts: z.number(),
856
- onError: pollingOnErrorSchema,
857
- }),
858
- );
859
-
860
- export const modalBehaviorSchema: z.ZodSchema<ModalBehavior> = z.lazy(() =>
861
- z.object({
862
- type: z.literal('modal'),
863
- title: z.string().optional(),
864
- content: z.array(layoutSchema),
865
- }),
866
- );
867
-
868
- export const layoutSchema: z.ZodSchema<Layout> = z.lazy(() =>
869
- z.union([
870
- alertLayoutSchema,
871
- boxLayoutSchema,
872
- buttonLayoutSchema,
873
- columnsLayoutSchema,
874
- decisionLayoutSchema,
875
- dividerLayoutSchema,
876
- formLayoutSchema,
877
- headingLayoutSchema,
878
- imageLayoutSchema,
879
- infoLayoutSchema,
880
- instructionsLayoutSchema,
881
- listLayoutSchema,
882
- loadingIndicatorLayoutSchema,
883
- markdownLayoutSchema,
884
- modalLayoutSchema,
885
- paragraphLayoutSchema,
886
- reviewLayoutSchema,
887
- searchLayoutSchema,
888
- statusListLayoutSchema,
889
- ]),
890
- );
891
-
892
- export const linkHandlerSchema: z.ZodSchema<LinkHandler> = z.lazy(() =>
893
- z.object({
894
- regexPattern: z.string(),
895
- behavior: behaviorSchema.optional(),
896
- }),
897
- );
898
-
899
- export const decisionLayoutSchema: z.ZodSchema<DecisionLayout> = z.lazy(() =>
900
- z.object({
901
- type: z.literal('decision'),
902
- title: z.string().optional(),
903
- options: z.array(decisionLayoutOptionSchema),
904
- control: z.string().optional(),
905
- margin: sizeSchema.optional(),
906
- }),
907
- );
908
-
909
874
  export const decisionLayoutOptionSchema: z.ZodSchema<DecisionLayoutOption> = z.lazy(() =>
910
875
  z.object({
911
876
  action: actionSchema.optional(),
@@ -916,31 +881,30 @@ export const decisionLayoutOptionSchema: z.ZodSchema<DecisionLayoutOption> = z.l
916
881
  image: imageSchema.optional(),
917
882
  behavior: behaviorSchema.optional(),
918
883
  tag: z.string().optional(),
884
+ additionalText: z.string().optional(),
885
+ supportingValues: supportingValuesSchema.optional(),
886
+ inlineAlert: inlineAlertSchema.optional(),
919
887
  }),
920
888
  );
921
889
 
922
- export const statusListLayoutSchema: z.ZodSchema<StatusListLayout> = z.lazy(() =>
890
+ export const listLayoutItemSchema: z.ZodSchema<ListLayoutItem> = z.lazy(() =>
923
891
  z.object({
924
- type: z.literal('status-list'),
925
- items: z.array(statusListLayoutItemSchema),
892
+ status: listLayoutStatusSchema.optional(),
893
+ icon: iconSchema.optional(),
894
+ image: imageSchema.optional(),
926
895
  title: z.string().optional(),
927
- control: z.string().optional(),
928
- margin: sizeSchema.optional(),
929
- }),
930
- );
931
-
932
- export const statusListLayoutItemSchema: z.ZodSchema<StatusListLayoutItem> = z.lazy(() =>
933
- z.object({
934
- title: z.string(),
935
- description: z.string().optional(),
936
- icon: iconSchema,
937
- status: statusListLayoutStatusSchema.optional(),
938
- callToAction: itemCallToActionSchema.optional(),
896
+ subtitle: z.string().optional(),
897
+ value: z.string().optional(),
898
+ subvalue: z.string().optional(),
939
899
  tag: z.string().optional(),
900
+ additionalInfo: additionalInfoSchema.optional(),
901
+ supportingValues: supportingValuesSchema.optional(),
902
+ inlineAlert: inlineAlertSchema.optional(),
903
+ description: z.string().optional(),
940
904
  }),
941
905
  );
942
906
 
943
- export const listLayoutCallToActionSchema: z.ZodSchema<ListLayoutCallToAction> = z.lazy(() =>
907
+ export const itemCallToActionSchema: z.ZodSchema<ItemCallToAction> = z.lazy(() =>
944
908
  z.object({
945
909
  title: z.string(),
946
910
  accessibilityDescription: z.string().optional(),
@@ -959,6 +923,14 @@ export const boxLayoutSchema: z.ZodSchema<BoxLayout> = z.lazy(() =>
959
923
  }),
960
924
  );
961
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
+
962
934
  export const buttonLayoutSchema: z.ZodSchema<ButtonLayout> = z.lazy(() =>
963
935
  z.object({
964
936
  type: z.literal('button'),
@@ -974,6 +946,43 @@ export const buttonLayoutSchema: z.ZodSchema<ButtonLayout> = z.lazy(() =>
974
946
  }),
975
947
  );
976
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
+
977
986
  export const columnsLayoutSchema: z.ZodSchema<ColumnsLayout> = z.lazy(() =>
978
987
  z.object({
979
988
  type: z.literal('columns'),
@@ -985,6 +994,16 @@ export const columnsLayoutSchema: z.ZodSchema<ColumnsLayout> = z.lazy(() =>
985
994
  }),
986
995
  );
987
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
+
988
1007
  export const listLayoutSchema: z.ZodSchema<ListLayout> = z.lazy(() =>
989
1008
  z.object({
990
1009
  type: z.literal('list'),
@@ -1006,48 +1025,39 @@ export const modalLayoutSchema: z.ZodSchema<ModalLayout> = z.lazy(() =>
1006
1025
  }),
1007
1026
  );
1008
1027
 
1009
- export const reviewLayoutSchema: z.ZodSchema<ReviewLayout> = z.lazy(() =>
1028
+ export const statusListLayoutSchema: z.ZodSchema<StatusListLayout> = z.lazy(() =>
1010
1029
  z.object({
1011
- type: z.literal('review'),
1012
- orientation: z.string().optional(),
1013
- action: actionSchema.optional(),
1014
- fields: z.array(reviewLayoutFieldSchema),
1030
+ type: z.literal('status-list'),
1031
+ items: z.array(statusListLayoutItemSchema),
1015
1032
  title: z.string().optional(),
1016
- callToAction: reviewLayoutCallToActionSchema.optional(),
1017
1033
  control: z.string().optional(),
1018
1034
  margin: sizeSchema.optional(),
1019
1035
  }),
1020
1036
  );
1021
1037
 
1022
- export const itemCallToActionSchema: z.ZodSchema<ItemCallToAction> = z.lazy(() =>
1038
+ export const statusListLayoutItemSchema: z.ZodSchema<StatusListLayoutItem> = z.lazy(() =>
1023
1039
  z.object({
1024
1040
  title: z.string(),
1025
- accessibilityDescription: z.string().optional(),
1026
- behavior: behaviorSchema,
1041
+ description: z.string().optional(),
1042
+ icon: iconSchema,
1043
+ status: statusListLayoutStatusSchema.optional(),
1044
+ callToAction: itemCallToActionSchema.optional(),
1045
+ tag: z.string().optional(),
1027
1046
  }),
1028
1047
  );
1029
1048
 
1030
- export const alertLayoutCallToActionSchema: z.ZodSchema<AlertLayoutCallToAction> = z.lazy(() =>
1049
+ export const modalLayoutContentSchema: z.ZodSchema<ModalLayoutContent> = z.lazy(() =>
1031
1050
  z.object({
1032
- title: z.string(),
1033
- accessibilityDescription: z.string().optional(),
1034
- behavior: behaviorSchema,
1051
+ title: z.string().optional(),
1052
+ components: z.array(layoutSchema),
1035
1053
  }),
1036
1054
  );
1037
1055
 
1038
- export const reviewLayoutCallToActionSchema: z.ZodSchema<ReviewLayoutCallToAction> = z.lazy(() =>
1056
+ export const listLayoutCallToActionSchema: z.ZodSchema<ListLayoutCallToAction> = z.lazy(() =>
1039
1057
  z.object({
1040
- action: actionSchema.optional(),
1041
1058
  title: z.string(),
1042
1059
  accessibilityDescription: z.string().optional(),
1043
- behavior: behaviorSchema.optional(),
1044
- }),
1045
- );
1046
-
1047
- export const modalLayoutContentSchema: z.ZodSchema<ModalLayoutContent> = z.lazy(() =>
1048
- z.object({
1049
- title: z.string().optional(),
1050
- components: z.array(layoutSchema),
1060
+ behavior: behaviorSchema,
1051
1061
  }),
1052
1062
  );
1053
1063
 
@@ -1075,9 +1085,35 @@ export const stepSchema: z.ZodSchema<Step> = z.lazy(() =>
1075
1085
  }),
1076
1086
  );
1077
1087
 
1078
- export const modalResponseBodySchema: z.ZodSchema<ModalResponseBody> = z.lazy(() =>
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(() =>
1079
1107
  z.object({
1108
+ type: z.literal('modal'),
1080
1109
  title: z.string().optional(),
1081
1110
  content: z.array(layoutSchema),
1082
1111
  }),
1083
1112
  );
1113
+
1114
+ export const pollingOnErrorSchema: z.ZodSchema<PollingOnError> = z.lazy(() =>
1115
+ z.object({
1116
+ action: actionSchema.optional(),
1117
+ behavior: behaviorSchema.optional(),
1118
+ }),
1119
+ );