@wise/dynamic-flow-types 3.1.4 → 3.2.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.
@@ -4,22 +4,42 @@ import type {
4
4
  JsonElement,
5
5
  BooleanSchema,
6
6
  PersistAsync,
7
- ArraySchemaList,
7
+ AlertLayout,
8
8
  Schema,
9
- StringSchema,
10
- OneOfSchema,
11
- ArraySchemaTuple,
9
+ AllOfSchema,
12
10
  ArraySchema,
11
+ BlobSchema,
12
+ ConstSchema,
13
+ IntegerSchema,
13
14
  NumberSchema,
14
15
  ObjectSchema,
15
- AllOfSchema,
16
- IntegerSchema,
17
- ModalLayout,
18
- ModalLayoutContent,
16
+ OneOfSchema,
17
+ StringSchema,
18
+ ArraySchemaTuple,
19
+ ArraySchemaList,
20
+ PollingOnError,
21
+ Behavior,
22
+ Polling,
23
+ ModalBehavior,
19
24
  Layout,
25
+ LinkHandler,
26
+ DecisionLayout,
27
+ DecisionLayoutOption,
28
+ StatusListLayout,
29
+ StatusListLayoutItem,
30
+ ListLayoutCallToAction,
20
31
  BoxLayout,
32
+ ButtonLayout,
21
33
  ColumnsLayout,
34
+ ListLayout,
35
+ ModalLayout,
36
+ ReviewLayout,
37
+ ItemCallToAction,
38
+ AlertLayoutCallToAction,
39
+ ReviewLayoutCallToAction,
40
+ ModalLayoutContent,
22
41
  Step,
42
+ ModalResponseBody,
23
43
  } from '../next';
24
44
 
25
45
  export const imageSchema = z.object({
@@ -136,6 +156,22 @@ export const autocompleteTokenSchema = z.union([
136
156
  z.literal('pager'),
137
157
  ]);
138
158
 
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
+
139
175
  export const httpMethodSchema = z.union([
140
176
  z.literal('GET'),
141
177
  z.literal('POST'),
@@ -148,6 +184,10 @@ export const linkSchema = z.object({
148
184
  url: z.string(),
149
185
  });
150
186
 
187
+ export const dismissBehaviorSchema = z.object({
188
+ type: z.literal('dismiss'),
189
+ });
190
+
151
191
  export const actionTypeSchema = z.union([
152
192
  z.literal('primary'),
153
193
  z.literal('secondary'),
@@ -156,46 +196,11 @@ export const actionTypeSchema = z.union([
156
196
  z.literal('negative'),
157
197
  ]);
158
198
 
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
199
  export const stepErrorSchema = z.object({
176
200
  error: z.string().optional(),
177
201
  validation: jsonElementSchema.optional(),
178
202
  });
179
203
 
180
- export const iconNamedSchema = z.object({
181
- name: z.string(),
182
- });
183
-
184
- export const contextSchema = z.union([
185
- z.literal('positive'),
186
- z.literal('neutral'),
187
- z.literal('warning'),
188
- z.literal('negative'),
189
- z.literal('success'),
190
- z.literal('failure'),
191
- z.literal('info'),
192
- z.literal('primary'),
193
- ]);
194
-
195
- export const iconTextSchema = z.object({
196
- text: z.string(),
197
- });
198
-
199
204
  export const sizeSchema = z.union([
200
205
  z.literal('xs'),
201
206
  z.literal('sm'),
@@ -206,73 +211,46 @@ export const sizeSchema = z.union([
206
211
 
207
212
  export const alignSchema = z.union([z.literal('left'), z.literal('center'), z.literal('right')]);
208
213
 
209
- export const searchSearchRequestSchema = z.object({
210
- url: z.string(),
211
- method: httpMethodSchema,
212
- param: z.string(),
213
- query: z.string(),
214
- });
215
-
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(),
222
- });
223
-
224
- export const modalLayoutTriggerSchema = z.object({
225
- title: z.string(),
226
- });
227
-
228
- export const imageLayoutSchema = z.object({
229
- type: z.literal('image'),
230
- text: z.string().optional(),
231
- url: z.string().optional(),
232
- accessibilityDescription: z.string().optional(),
233
- content: imageSchema.optional(),
234
- size: sizeSchema.optional(),
235
- control: z.string().optional(),
236
- margin: sizeSchema.optional(),
237
- align: alignSchema.optional(),
238
- });
214
+ export const statusListLayoutStatusSchema = z.union([
215
+ z.literal('not-done'),
216
+ z.literal('pending'),
217
+ z.literal('done'),
218
+ ]);
239
219
 
240
- export const instructionsLayoutItemSchema = z.object({
241
- text: z.string(),
242
- context: contextSchema,
243
- tag: z.string().optional(),
220
+ export const formLayoutSchemaReferenceSchema = z.object({
221
+ $ref: z.string(),
244
222
  });
245
223
 
246
- export const instructionsLayoutSchema = z.object({
247
- type: z.literal('instructions'),
248
- title: z.string().optional(),
249
- items: z.array(instructionsLayoutItemSchema),
224
+ export const formLayoutSchema = z.object({
225
+ type: z.literal('form'),
226
+ schema: formLayoutSchemaReferenceSchema.optional(),
227
+ schemaId: z.string(),
250
228
  control: z.string().optional(),
251
229
  margin: sizeSchema.optional(),
252
230
  });
253
231
 
254
- export const formLayoutSchemaReferenceSchema = z.object({
255
- $ref: z.string(),
256
- });
232
+ export const listLayoutStatusSchema = z.union([
233
+ z.literal('warning'),
234
+ z.literal('neutral'),
235
+ z.literal('positive'),
236
+ ]);
257
237
 
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
- });
238
+ export const columnsLayoutBiasSchema = z.union([
239
+ z.literal('none'),
240
+ z.literal('left'),
241
+ z.literal('right'),
242
+ ]);
265
243
 
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
- });
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
+ ]);
276
254
 
277
255
  export const dividerLayoutSchema = z.object({
278
256
  type: z.literal('divider'),
@@ -280,15 +258,10 @@ export const dividerLayoutSchema = z.object({
280
258
  margin: sizeSchema.optional(),
281
259
  });
282
260
 
283
- export const listLayoutStatusSchema = z.union([
284
- z.literal('warning'),
285
- z.literal('neutral'),
286
- z.literal('positive'),
287
- ]);
288
-
289
- export const markdownLayoutSchema = z.object({
290
- type: z.literal('markdown'),
291
- content: z.string(),
261
+ export const headingLayoutSchema = z.object({
262
+ type: z.literal('heading'),
263
+ text: z.string(),
264
+ size: sizeSchema.optional(),
292
265
  align: alignSchema.optional(),
293
266
  control: z.string().optional(),
294
267
  margin: sizeSchema.optional(),
@@ -302,28 +275,21 @@ export const infoLayoutSchema = z.object({
302
275
  margin: sizeSchema.optional(),
303
276
  });
304
277
 
305
- export const headingLayoutSchema = z.object({
306
- type: z.literal('heading'),
307
- text: z.string(),
278
+ export const loadingIndicatorLayoutSchema = z.object({
279
+ type: z.literal('loading-indicator'),
308
280
  size: sizeSchema.optional(),
309
- align: alignSchema.optional(),
310
281
  control: z.string().optional(),
311
282
  margin: sizeSchema.optional(),
312
283
  });
313
284
 
314
- export const loadingIndicatorLayoutSchema = z.object({
315
- type: z.literal('loading-indicator'),
316
- size: sizeSchema.optional(),
285
+ export const markdownLayoutSchema = z.object({
286
+ type: z.literal('markdown'),
287
+ content: z.string(),
288
+ align: alignSchema.optional(),
317
289
  control: z.string().optional(),
318
290
  margin: sizeSchema.optional(),
319
291
  });
320
292
 
321
- export const statusListLayoutStatusSchema = z.union([
322
- z.literal('not-done'),
323
- z.literal('pending'),
324
- z.literal('done'),
325
- ]);
326
-
327
293
  export const paragraphLayoutSchema = z.object({
328
294
  type: z.literal('paragraph'),
329
295
  text: z.string(),
@@ -332,11 +298,51 @@ export const paragraphLayoutSchema = z.object({
332
298
  margin: sizeSchema.optional(),
333
299
  });
334
300
 
335
- export const columnsLayoutBiasSchema = z.union([
336
- z.literal('none'),
337
- z.literal('left'),
338
- z.literal('right'),
339
- ]);
301
+ export const searchLayoutSchema = z.object({
302
+ type: z.literal('search'),
303
+ title: z.string(),
304
+ method: httpMethodSchema,
305
+ url: z.string(),
306
+ param: z.string(),
307
+ emptyMessage: z.string().optional(),
308
+ control: z.string().optional(),
309
+ margin: sizeSchema.optional(),
310
+ });
311
+
312
+ export const modalLayoutTriggerSchema = z.object({
313
+ title: z.string(),
314
+ });
315
+
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
+ });
327
+
328
+ export const iconNamedSchema = z.object({
329
+ name: z.string(),
330
+ });
331
+
332
+ export const errorResponseBodySchema = z.object({
333
+ refreshFormUrl: z.string().optional(),
334
+ analytics: z.record(z.string()).optional(),
335
+ error: z.string().optional(),
336
+ validation: jsonElementSchema.optional(),
337
+ refreshUrl: z.string().optional(),
338
+ });
339
+
340
+ export const searchSearchRequestSchema = z.object({
341
+ url: z.string(),
342
+ method: httpMethodSchema,
343
+ param: z.string(),
344
+ query: z.string(),
345
+ });
340
346
 
341
347
  export const iconSchema = z.union([iconNamedSchema, iconTextSchema]);
342
348
 
@@ -375,15 +381,15 @@ export const actionSchema = z.object({
375
381
 
376
382
  export const suggestionsValueSchema = z.object({
377
383
  label: z.string(),
378
- value: jsonElementSchema.optional(),
384
+ value: jsonElementSchema,
379
385
  icon: iconSchema.optional(),
380
386
  image: imageSchema.optional(),
381
387
  tag: z.string().optional(),
382
388
  });
383
389
 
384
- export const navigationBackBehaviorSchema = z.object({
385
- title: z.string().optional(),
386
- action: actionSchema,
390
+ export const containerBehaviorSchema = z.object({
391
+ action: actionSchema.optional(),
392
+ link: linkSchema.optional(),
387
393
  });
388
394
 
389
395
  export const actionBehaviorSchema = z.object({
@@ -391,42 +397,24 @@ export const actionBehaviorSchema = z.object({
391
397
  action: actionSchema,
392
398
  });
393
399
 
394
- export const navigationSchema = z.object({
395
- backButton: navigationBackBehaviorSchema.optional(),
396
- back: navigationBackBehaviorSchema.optional(),
397
- stackBehavior: navigationStackBehaviorSchema.optional(),
398
- });
399
-
400
400
  export const summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
401
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,
418
- });
419
-
420
- export const actionResponseBodySchema = z.object({
421
- action: actionSchema,
402
+ export const instructionsLayoutItemSchema = z.object({
403
+ text: z.string(),
404
+ context: contextSchema,
405
+ tag: z.string().optional(),
422
406
  });
423
407
 
424
- export const formLayoutSchema = z.object({
425
- type: z.literal('form'),
426
- schema: formLayoutSchemaReferenceSchema.optional(),
427
- schemaId: z.string(),
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(),
428
415
  control: z.string().optional(),
429
416
  margin: sizeSchema.optional(),
417
+ align: alignSchema.optional(),
430
418
  });
431
419
 
432
420
  export const listLayoutItemSchema = z.object({
@@ -441,189 +429,57 @@ export const listLayoutItemSchema = z.object({
441
429
  tag: z.string().optional(),
442
430
  });
443
431
 
444
- export const suggestionsSchema = z.object({
445
- values: z.array(suggestionsValueSchema),
446
- });
447
-
448
- export const containerBehaviorSchema = z.object({
449
- action: actionSchema.optional(),
450
- link: linkSchema.optional(),
451
- });
452
-
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(),
462
- });
463
-
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,
432
+ export const actionResponseBodySchema = z.object({
433
+ action: actionSchema,
470
434
  });
471
435
 
472
- export const decisionLayoutOptionSchema = z.object({
473
- action: actionSchema.optional(),
436
+ export const searchResultSearchSchema = z.object({
437
+ type: z.literal('search'),
474
438
  title: z.string(),
475
439
  description: z.string().optional(),
476
- disabled: z.boolean().optional(),
477
440
  icon: iconSchema.optional(),
478
441
  image: imageSchema.optional(),
479
- behavior: behaviorSchema.optional(),
480
- tag: z.string().optional(),
481
- });
482
-
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,
442
+ value: searchSearchRequestSchema,
500
443
  });
501
444
 
502
- export const reviewLayoutCallToActionSchema = z.object({
503
- action: actionSchema.optional(),
445
+ export const searchResultActionSchema = z.object({
446
+ type: z.literal('action'),
504
447
  title: z.string(),
505
- accessibilityDescription: z.string().optional(),
506
- behavior: behaviorSchema.optional(),
448
+ description: z.string().optional(),
449
+ icon: iconSchema.optional(),
450
+ image: imageSchema.optional(),
451
+ value: actionSchema,
507
452
  });
508
453
 
509
- export const itemCallToActionSchema = z.object({
510
- title: z.string(),
511
- accessibilityDescription: z.string().optional(),
512
- behavior: behaviorSchema,
454
+ export const suggestionsSchema = z.object({
455
+ values: z.array(suggestionsValueSchema),
513
456
  });
514
457
 
515
- export const decisionLayoutSchema = z.object({
516
- type: z.literal('decision'),
458
+ export const navigationBackBehaviorSchema = z.object({
517
459
  title: z.string().optional(),
518
- options: z.array(decisionLayoutOptionSchema),
519
- control: z.string().optional(),
520
- margin: sizeSchema.optional(),
460
+ action: actionSchema,
521
461
  });
522
462
 
523
- export const listLayoutSchema = z.object({
524
- type: z.literal('list'),
463
+ export const instructionsLayoutSchema = z.object({
464
+ type: z.literal('instructions'),
525
465
  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(),
466
+ items: z.array(instructionsLayoutItemSchema),
536
467
  control: z.string().optional(),
537
468
  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
- description: z.string().optional(),
547
- control: z.string().optional(),
548
- hidden: z.boolean().optional(),
549
- icon: iconSchema.optional(),
550
- 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(),
562
- });
563
-
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(),
572
- description: z.string().optional(),
573
- icon: iconSchema.optional(),
574
- image: imageSchema.optional(),
575
- keywords: z.array(z.string()).optional(),
576
- summary: summaryProviderSchema.optional(),
577
- analyticsId: z.string().optional(),
578
- disabled: z.boolean().optional(),
579
469
  });
580
470
 
581
- export const pollingOnErrorSchema = z.object({
582
- action: actionSchema.optional(),
583
- behavior: behaviorSchema.optional(),
584
- });
471
+ export const searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
585
472
 
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,
473
+ export const navigationSchema = z.object({
474
+ backButton: navigationBackBehaviorSchema.optional(),
475
+ back: navigationBackBehaviorSchema.optional(),
476
+ stackBehavior: navigationStackBehaviorSchema.optional(),
593
477
  });
594
478
 
595
479
  export const searchResponseBodySchema = z.object({
596
480
  results: z.array(searchResultSchema),
597
481
  });
598
482
 
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
- });
607
-
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
- });
618
-
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
- });
626
-
627
483
  export const booleanSchemaSchema: z.ZodSchema<BooleanSchema> = z.lazy(() =>
628
484
  z.object({
629
485
  type: z.literal('boolean'),
@@ -663,31 +519,14 @@ export const persistAsyncSchema: z.ZodSchema<PersistAsync> = z.lazy(() =>
663
519
  }),
664
520
  );
665
521
 
666
- export const arraySchemaListSchema: z.ZodSchema<ArraySchemaList> = z.lazy(() =>
522
+ export const alertLayoutSchema: z.ZodSchema<AlertLayout> = z.lazy(() =>
667
523
  z.object({
668
- type: z.literal('array'),
669
- promoted: z.boolean().optional(),
670
- $id: z.string().optional(),
671
- items: schemaSchema,
672
- addItemTitle: z.string(),
673
- editItemTitle: z.string(),
674
- minItems: z.number().optional(),
675
- maxItems: z.number().optional(),
676
- placeholder: z.string().optional(),
677
- title: z.string().optional(),
678
- description: z.string().optional(),
524
+ type: z.literal('alert'),
525
+ markdown: z.string(),
526
+ context: contextSchema.optional(),
679
527
  control: z.string().optional(),
680
- hidden: z.boolean().optional(),
681
- icon: iconSchema.optional(),
682
- image: imageSchema.optional(),
683
- keywords: z.array(z.string()).optional(),
684
- summary: summarySummariserSchema.optional(),
685
- analyticsId: z.string().optional(),
686
- persistAsync: persistAsyncSchema.optional(),
687
- validationAsync: validateAsyncSchema.optional(),
688
- alert: alertLayoutSchema.optional(),
689
- validationMessages: z.record(z.string()).optional(),
690
- disabled: z.boolean().optional(),
528
+ margin: sizeSchema.optional(),
529
+ callToAction: alertLayoutCallToActionSchema.optional(),
691
530
  }),
692
531
  );
693
532
 
@@ -706,38 +545,43 @@ export const schemaSchema: z.ZodSchema<Schema> = z.lazy(() =>
706
545
  ]),
707
546
  );
708
547
 
709
- export const stringSchemaSchema: z.ZodSchema<StringSchema> = z.lazy(() =>
548
+ export const allOfSchemaSchema: z.ZodSchema<AllOfSchema> = z.lazy(() =>
710
549
  z.object({
711
- type: z.literal('string'),
712
- autofillProvider: z.string().optional(),
550
+ disabled: z.boolean().optional(),
551
+ promoted: z.boolean().optional(),
552
+ allOf: z.array(schemaSchema),
553
+ $id: z.string().optional(),
554
+ title: z.string().optional(),
555
+ description: z.string().optional(),
556
+ control: z.string().optional(),
557
+ hidden: z.boolean().optional(),
558
+ icon: iconSchema.optional(),
559
+ image: imageSchema.optional(),
560
+ keywords: z.array(z.string()).optional(),
561
+ summary: summaryProviderSchema.optional(),
562
+ analyticsId: z.string().optional(),
563
+ alert: alertLayoutSchema.optional(),
564
+ }),
565
+ );
566
+
567
+ export const arraySchemaSchema: z.ZodSchema<ArraySchema> = z.lazy(() =>
568
+ z.union([arraySchemaListSchema, arraySchemaTupleSchema]),
569
+ );
570
+
571
+ export const blobSchemaSchema: z.ZodSchema<BlobSchema> = z.lazy(() =>
572
+ z.object({
573
+ type: z.literal('blob'),
713
574
  promoted: z.boolean().optional(),
714
- refreshFormOnChange: z.boolean().optional(),
715
- refreshUrl: z.string().optional(),
716
- 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
575
  $id: z.string().optional(),
728
576
  title: z.string().optional(),
729
577
  description: z.string().optional(),
730
578
  control: z.string().optional(),
731
- default: z.string().optional(),
732
579
  hidden: z.boolean().optional(),
733
- disabled: z.boolean().optional(),
734
580
  icon: iconSchema.optional(),
735
581
  image: imageSchema.optional(),
736
582
  keywords: z.array(z.string()).optional(),
737
583
  summary: summaryProviderSchema.optional(),
738
584
  analyticsId: z.string().optional(),
739
- persistAsync: persistAsyncSchema.optional(),
740
- refreshStepOnChange: z.boolean().optional(),
741
585
  validationAsync: validateAsyncSchema.optional(),
742
586
  validationMessages: z.record(z.string()).optional(),
743
587
  alert: alertLayoutSchema.optional(),
@@ -745,69 +589,63 @@ export const stringSchemaSchema: z.ZodSchema<StringSchema> = z.lazy(() =>
745
589
  accepts: z.array(z.string()).optional(),
746
590
  maxSize: z.number().optional(),
747
591
  source: uploadSourceSchema.optional(),
748
- autocompleteHint: z.array(autocompleteTokenSchema).optional(),
749
- autofillKey: z.string().optional(),
750
- help: helpSchema.optional(),
751
- suggestions: suggestionsSchema.optional(),
592
+ disabled: z.boolean().optional(),
752
593
  }),
753
594
  );
754
595
 
755
- export const oneOfSchemaSchema: z.ZodSchema<OneOfSchema> = z.lazy(() =>
596
+ export const constSchemaSchema: z.ZodSchema<ConstSchema> = z.lazy(() =>
756
597
  z.object({
757
- autofillProvider: z.string().optional(),
598
+ hidden: z.boolean().optional(),
599
+ alert: alertLayoutSchema.optional(),
600
+ control: z.string().optional(),
758
601
  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
602
  $id: z.string().optional(),
603
+ const: jsonElementSchema,
766
604
  title: z.string().optional(),
767
605
  description: z.string().optional(),
768
- control: z.string().optional(),
769
- default: jsonElementSchema.optional(),
770
- hidden: z.boolean().optional(),
771
606
  icon: iconSchema.optional(),
772
607
  image: imageSchema.optional(),
773
608
  keywords: z.array(z.string()).optional(),
774
609
  summary: summaryProviderSchema.optional(),
775
610
  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
611
  disabled: z.boolean().optional(),
783
612
  }),
784
613
  );
785
614
 
786
- export const arraySchemaTupleSchema: z.ZodSchema<ArraySchemaTuple> = z.lazy(() =>
615
+ export const integerSchemaSchema: z.ZodSchema<IntegerSchema> = z.lazy(() =>
787
616
  z.object({
788
- type: z.literal('array'),
617
+ type: z.literal('integer'),
618
+ autofillProvider: z.string().optional(),
789
619
  promoted: z.boolean().optional(),
620
+ refreshFormOnChange: z.boolean().optional(),
621
+ refreshUrl: z.string().optional(),
622
+ refreshFormUrl: z.string().optional(),
623
+ placeholder: z.string().optional(),
624
+ minimum: z.number().optional(),
625
+ maximum: z.number().optional(),
790
626
  $id: z.string().optional(),
791
- items: z.array(schemaSchema),
792
627
  title: z.string().optional(),
793
628
  description: z.string().optional(),
794
629
  control: z.string().optional(),
630
+ default: z.number().optional(),
795
631
  hidden: z.boolean().optional(),
632
+ disabled: z.boolean().optional(),
796
633
  icon: iconSchema.optional(),
797
634
  image: imageSchema.optional(),
798
635
  keywords: z.array(z.string()).optional(),
799
636
  summary: summaryProviderSchema.optional(),
800
637
  analyticsId: z.string().optional(),
801
638
  persistAsync: persistAsyncSchema.optional(),
639
+ refreshStepOnChange: z.boolean().optional(),
802
640
  validationAsync: validateAsyncSchema.optional(),
641
+ validationMessages: z.record(z.string()).optional(),
803
642
  alert: alertLayoutSchema.optional(),
643
+ autocompleteHint: z.array(autocompleteTokenSchema).optional(),
644
+ autofillKey: z.string().optional(),
645
+ help: helpSchema.optional(),
804
646
  }),
805
647
  );
806
648
 
807
- export const arraySchemaSchema: z.ZodSchema<ArraySchema> = z.lazy(() =>
808
- z.union([arraySchemaListSchema, arraySchemaTupleSchema]),
809
- );
810
-
811
649
  export const numberSchemaSchema: z.ZodSchema<NumberSchema> = z.lazy(() =>
812
650
  z.object({
813
651
  type: z.literal('number'),
@@ -865,41 +703,60 @@ export const objectSchemaSchema: z.ZodSchema<ObjectSchema> = z.lazy(() =>
865
703
  }),
866
704
  );
867
705
 
868
- export const allOfSchemaSchema: z.ZodSchema<AllOfSchema> = z.lazy(() =>
706
+ export const oneOfSchemaSchema: z.ZodSchema<OneOfSchema> = z.lazy(() =>
869
707
  z.object({
870
- disabled: z.boolean().optional(),
708
+ autofillProvider: z.string().optional(),
871
709
  promoted: z.boolean().optional(),
872
- allOf: z.array(schemaSchema),
710
+ refreshFormOnChange: z.boolean().optional(),
711
+ refreshUrl: z.string().optional(),
712
+ refreshFormUrl: z.string().optional(),
713
+ promotion: jsonElementSchema.optional(),
714
+ oneOf: z.array(schemaSchema),
715
+ placeholder: z.string().optional(),
873
716
  $id: z.string().optional(),
874
717
  title: z.string().optional(),
875
718
  description: z.string().optional(),
876
719
  control: z.string().optional(),
720
+ default: jsonElementSchema.optional(),
877
721
  hidden: z.boolean().optional(),
878
722
  icon: iconSchema.optional(),
879
723
  image: imageSchema.optional(),
880
724
  keywords: z.array(z.string()).optional(),
881
725
  summary: summaryProviderSchema.optional(),
882
726
  analyticsId: z.string().optional(),
727
+ refreshStepOnChange: z.boolean().optional(),
883
728
  alert: alertLayoutSchema.optional(),
729
+ help: helpSchema.optional(),
730
+ autocompleteHint: z.array(autocompleteTokenSchema).optional(),
731
+ autofillKey: z.string().optional(),
732
+ validationMessages: z.record(z.string()).optional(),
733
+ disabled: z.boolean().optional(),
884
734
  }),
885
735
  );
886
736
 
887
- export const integerSchemaSchema: z.ZodSchema<IntegerSchema> = z.lazy(() =>
737
+ export const stringSchemaSchema: z.ZodSchema<StringSchema> = z.lazy(() =>
888
738
  z.object({
889
- type: z.literal('integer'),
739
+ type: z.literal('string'),
890
740
  autofillProvider: z.string().optional(),
891
741
  promoted: z.boolean().optional(),
892
742
  refreshFormOnChange: z.boolean().optional(),
893
743
  refreshUrl: z.string().optional(),
894
744
  refreshFormUrl: z.string().optional(),
745
+ format: stringSchemaFormatSchema.optional(),
746
+ displayFormat: z.string().optional(),
895
747
  placeholder: z.string().optional(),
896
- minimum: z.number().optional(),
897
- maximum: z.number().optional(),
748
+ minLength: z.number().optional(),
749
+ maxLength: z.number().optional(),
750
+ minimum: z.string().optional(),
751
+ maximum: z.string().optional(),
752
+ pattern: z.string().optional(),
753
+ autocapitalization: autocapitalizationTypeSchema.optional(),
754
+ autocorrect: z.boolean().optional(),
898
755
  $id: z.string().optional(),
899
756
  title: z.string().optional(),
900
757
  description: z.string().optional(),
901
758
  control: z.string().optional(),
902
- default: z.number().optional(),
759
+ default: z.string().optional(),
903
760
  hidden: z.boolean().optional(),
904
761
  disabled: z.boolean().optional(),
905
762
  icon: iconSchema.optional(),
@@ -912,26 +769,99 @@ export const integerSchemaSchema: z.ZodSchema<IntegerSchema> = z.lazy(() =>
912
769
  validationAsync: validateAsyncSchema.optional(),
913
770
  validationMessages: z.record(z.string()).optional(),
914
771
  alert: alertLayoutSchema.optional(),
772
+ cameraConfig: jsonElementSchema.optional(),
773
+ accepts: z.array(z.string()).optional(),
774
+ maxSize: z.number().optional(),
775
+ source: uploadSourceSchema.optional(),
915
776
  autocompleteHint: z.array(autocompleteTokenSchema).optional(),
916
777
  autofillKey: z.string().optional(),
917
778
  help: helpSchema.optional(),
779
+ suggestions: suggestionsSchema.optional(),
918
780
  }),
919
781
  );
920
782
 
921
- export const modalLayoutSchema: z.ZodSchema<ModalLayout> = z.lazy(() =>
783
+ export const arraySchemaTupleSchema: z.ZodSchema<ArraySchemaTuple> = z.lazy(() =>
922
784
  z.object({
923
- type: z.literal('modal'),
785
+ type: z.literal('array'),
786
+ promoted: z.boolean().optional(),
787
+ $id: z.string().optional(),
788
+ items: z.array(schemaSchema),
789
+ title: z.string().optional(),
790
+ description: z.string().optional(),
924
791
  control: z.string().optional(),
925
- margin: sizeSchema.optional(),
926
- trigger: modalLayoutTriggerSchema,
927
- content: modalLayoutContentSchema,
792
+ hidden: z.boolean().optional(),
793
+ icon: iconSchema.optional(),
794
+ image: imageSchema.optional(),
795
+ keywords: z.array(z.string()).optional(),
796
+ summary: summaryProviderSchema.optional(),
797
+ analyticsId: z.string().optional(),
798
+ persistAsync: persistAsyncSchema.optional(),
799
+ validationAsync: validateAsyncSchema.optional(),
800
+ alert: alertLayoutSchema.optional(),
928
801
  }),
929
802
  );
930
803
 
931
- export const modalLayoutContentSchema: z.ZodSchema<ModalLayoutContent> = z.lazy(() =>
804
+ export const arraySchemaListSchema: z.ZodSchema<ArraySchemaList> = z.lazy(() =>
932
805
  z.object({
806
+ type: z.literal('array'),
807
+ promoted: z.boolean().optional(),
808
+ $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(),
933
815
  title: z.string().optional(),
934
- components: z.array(layoutSchema),
816
+ description: z.string().optional(),
817
+ control: z.string().optional(),
818
+ hidden: z.boolean().optional(),
819
+ icon: iconSchema.optional(),
820
+ image: imageSchema.optional(),
821
+ keywords: z.array(z.string()).optional(),
822
+ summary: summarySummariserSchema.optional(),
823
+ analyticsId: z.string().optional(),
824
+ persistAsync: persistAsyncSchema.optional(),
825
+ validationAsync: validateAsyncSchema.optional(),
826
+ alert: alertLayoutSchema.optional(),
827
+ validationMessages: z.record(z.string()).optional(),
828
+ disabled: z.boolean().optional(),
829
+ }),
830
+ );
831
+
832
+ export const pollingOnErrorSchema: z.ZodSchema<PollingOnError> = z.lazy(() =>
833
+ z.object({
834
+ action: actionSchema.optional(),
835
+ behavior: behaviorSchema.optional(),
836
+ }),
837
+ );
838
+
839
+ export const behaviorSchema: z.ZodSchema<Behavior> = z.lazy(() =>
840
+ z.union([
841
+ actionBehaviorSchema,
842
+ containerBehaviorSchema,
843
+ dismissBehaviorSchema,
844
+ linkBehaviorSchema,
845
+ modalBehaviorSchema,
846
+ ]),
847
+ );
848
+
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),
935
865
  }),
936
866
  );
937
867
 
@@ -959,6 +889,65 @@ export const layoutSchema: z.ZodSchema<Layout> = z.lazy(() =>
959
889
  ]),
960
890
  );
961
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
+ export const decisionLayoutOptionSchema: z.ZodSchema<DecisionLayoutOption> = z.lazy(() =>
910
+ z.object({
911
+ action: actionSchema.optional(),
912
+ title: z.string(),
913
+ description: z.string().optional(),
914
+ disabled: z.boolean().optional(),
915
+ icon: iconSchema.optional(),
916
+ image: imageSchema.optional(),
917
+ behavior: behaviorSchema.optional(),
918
+ tag: z.string().optional(),
919
+ }),
920
+ );
921
+
922
+ export const statusListLayoutSchema: z.ZodSchema<StatusListLayout> = z.lazy(() =>
923
+ z.object({
924
+ type: z.literal('status-list'),
925
+ items: z.array(statusListLayoutItemSchema),
926
+ 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(),
939
+ tag: z.string().optional(),
940
+ }),
941
+ );
942
+
943
+ export const listLayoutCallToActionSchema: z.ZodSchema<ListLayoutCallToAction> = z.lazy(() =>
944
+ z.object({
945
+ title: z.string(),
946
+ accessibilityDescription: z.string().optional(),
947
+ behavior: behaviorSchema,
948
+ }),
949
+ );
950
+
962
951
  export const boxLayoutSchema: z.ZodSchema<BoxLayout> = z.lazy(() =>
963
952
  z.object({
964
953
  type: z.literal('box'),
@@ -970,6 +959,21 @@ export const boxLayoutSchema: z.ZodSchema<BoxLayout> = z.lazy(() =>
970
959
  }),
971
960
  );
972
961
 
962
+ export const buttonLayoutSchema: z.ZodSchema<ButtonLayout> = z.lazy(() =>
963
+ z.object({
964
+ type: z.literal('button'),
965
+ action: actionSchema.optional(),
966
+ size: sizeSchema.optional(),
967
+ title: z.string().optional(),
968
+ behavior: behaviorSchema.optional(),
969
+ context: contextSchema.optional(),
970
+ disabled: z.boolean().optional(),
971
+ pinOrder: z.number().optional(),
972
+ control: z.string().optional(),
973
+ margin: sizeSchema.optional(),
974
+ }),
975
+ );
976
+
973
977
  export const columnsLayoutSchema: z.ZodSchema<ColumnsLayout> = z.lazy(() =>
974
978
  z.object({
975
979
  type: z.literal('columns'),
@@ -981,6 +985,72 @@ export const columnsLayoutSchema: z.ZodSchema<ColumnsLayout> = z.lazy(() =>
981
985
  }),
982
986
  );
983
987
 
988
+ export const listLayoutSchema: z.ZodSchema<ListLayout> = z.lazy(() =>
989
+ 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(),
996
+ }),
997
+ );
998
+
999
+ export const modalLayoutSchema: z.ZodSchema<ModalLayout> = z.lazy(() =>
1000
+ z.object({
1001
+ type: z.literal('modal'),
1002
+ control: z.string().optional(),
1003
+ margin: sizeSchema.optional(),
1004
+ trigger: modalLayoutTriggerSchema,
1005
+ content: modalLayoutContentSchema,
1006
+ }),
1007
+ );
1008
+
1009
+ export const reviewLayoutSchema: z.ZodSchema<ReviewLayout> = z.lazy(() =>
1010
+ z.object({
1011
+ type: z.literal('review'),
1012
+ orientation: z.string().optional(),
1013
+ action: actionSchema.optional(),
1014
+ fields: z.array(reviewLayoutFieldSchema),
1015
+ title: z.string().optional(),
1016
+ callToAction: reviewLayoutCallToActionSchema.optional(),
1017
+ control: z.string().optional(),
1018
+ margin: sizeSchema.optional(),
1019
+ }),
1020
+ );
1021
+
1022
+ export const itemCallToActionSchema: z.ZodSchema<ItemCallToAction> = z.lazy(() =>
1023
+ z.object({
1024
+ title: z.string(),
1025
+ accessibilityDescription: z.string().optional(),
1026
+ behavior: behaviorSchema,
1027
+ }),
1028
+ );
1029
+
1030
+ export const alertLayoutCallToActionSchema: z.ZodSchema<AlertLayoutCallToAction> = z.lazy(() =>
1031
+ z.object({
1032
+ title: z.string(),
1033
+ accessibilityDescription: z.string().optional(),
1034
+ behavior: behaviorSchema,
1035
+ }),
1036
+ );
1037
+
1038
+ export const reviewLayoutCallToActionSchema: z.ZodSchema<ReviewLayoutCallToAction> = z.lazy(() =>
1039
+ z.object({
1040
+ action: actionSchema.optional(),
1041
+ title: z.string(),
1042
+ 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),
1051
+ }),
1052
+ );
1053
+
984
1054
  export const stepSchema: z.ZodSchema<Step> = z.lazy(() =>
985
1055
  z.object({
986
1056
  key: z.string().optional(),
@@ -1004,3 +1074,10 @@ export const stepSchema: z.ZodSchema<Step> = z.lazy(() =>
1004
1074
  refreshAfter: z.string().optional(),
1005
1075
  }),
1006
1076
  );
1077
+
1078
+ export const modalResponseBodySchema: z.ZodSchema<ModalResponseBody> = z.lazy(() =>
1079
+ z.object({
1080
+ title: z.string().optional(),
1081
+ content: z.array(layoutSchema),
1082
+ }),
1083
+ );