@wise/dynamic-flow-types 2.22.4 → 2.23.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.
- package/build/main.js +22 -16
- package/build/main.min.js +1 -1
- package/build/main.mjs +22 -16
- package/build/next/feature/Action.d.ts +10 -8
- package/build/next/layout/ItemCallToAction.d.ts +18 -0
- package/build/next/layout/StatusListLayoutItem.d.ts +6 -0
- package/build/zod/schemas.d.ts +785 -221
- package/build/zod/schemas.ts +65 -58
- package/package.json +2 -2
package/build/zod/schemas.ts
CHANGED
|
@@ -351,22 +351,21 @@ export const instructionsLayoutSchema = z.object({
|
|
|
351
351
|
|
|
352
352
|
export const iconSchema = z.union([iconNamedSchema, iconTextSchema]);
|
|
353
353
|
|
|
354
|
+
export const behaviorSchema = z.object({
|
|
355
|
+
action: actionSchema.optional(),
|
|
356
|
+
link: linkSchema.optional(),
|
|
357
|
+
});
|
|
358
|
+
|
|
354
359
|
export const reviewLayoutFieldSchema = z.object({
|
|
355
360
|
label: z.string(),
|
|
356
361
|
value: z.string(),
|
|
357
362
|
help: helpSchema.optional(),
|
|
358
363
|
});
|
|
359
364
|
|
|
360
|
-
export const
|
|
365
|
+
export const alertLayoutCallToActionSchema = z.object({
|
|
361
366
|
title: z.string(),
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
status: statusListLayoutStatusSchema.optional(),
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
export const behaviorSchema = z.object({
|
|
368
|
-
action: actionSchema.optional(),
|
|
369
|
-
link: linkSchema.optional(),
|
|
367
|
+
accessibilityDescription: z.string().optional(),
|
|
368
|
+
behavior: behaviorSchema,
|
|
370
369
|
});
|
|
371
370
|
|
|
372
371
|
export const summarySummariserSchema = z.object({
|
|
@@ -439,6 +438,15 @@ export const decisionLayoutOptionSchema = z.object({
|
|
|
439
438
|
image: imageLayoutSchema.optional(),
|
|
440
439
|
});
|
|
441
440
|
|
|
441
|
+
export const alertLayoutSchema = z.object({
|
|
442
|
+
type: z.literal('alert'),
|
|
443
|
+
markdown: z.string(),
|
|
444
|
+
context: contextSchema.optional(),
|
|
445
|
+
control: z.string().optional(),
|
|
446
|
+
margin: sizeSchema.optional(),
|
|
447
|
+
callToAction: alertLayoutCallToActionSchema.optional(),
|
|
448
|
+
});
|
|
449
|
+
|
|
442
450
|
export const reviewLayoutSchema = z.object({
|
|
443
451
|
type: z.literal('review'),
|
|
444
452
|
orientation: z.string().optional(),
|
|
@@ -450,14 +458,6 @@ export const reviewLayoutSchema = z.object({
|
|
|
450
458
|
margin: sizeSchema.optional(),
|
|
451
459
|
});
|
|
452
460
|
|
|
453
|
-
export const statusListLayoutSchema = z.object({
|
|
454
|
-
type: z.literal('status-list'),
|
|
455
|
-
items: z.array(statusListLayoutItemSchema),
|
|
456
|
-
title: z.string().optional(),
|
|
457
|
-
control: z.string().optional(),
|
|
458
|
-
margin: sizeSchema.optional(),
|
|
459
|
-
});
|
|
460
|
-
|
|
461
461
|
export const listLayoutItemSchema = z.object({
|
|
462
462
|
title: z.string(),
|
|
463
463
|
description: z.string().optional(),
|
|
@@ -465,52 +465,18 @@ export const listLayoutItemSchema = z.object({
|
|
|
465
465
|
status: listLayoutStatusSchema.optional(),
|
|
466
466
|
});
|
|
467
467
|
|
|
468
|
-
export const
|
|
468
|
+
export const itemCallToActionSchema = z.object({
|
|
469
469
|
title: z.string(),
|
|
470
470
|
accessibilityDescription: z.string().optional(),
|
|
471
471
|
behavior: behaviorSchema,
|
|
472
472
|
});
|
|
473
473
|
|
|
474
|
-
export const
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
onError: pollingOnErrorSchema,
|
|
481
|
-
});
|
|
482
|
-
|
|
483
|
-
export const navigationSchema = z.object({
|
|
484
|
-
backButton: navigationBackBehaviorSchema.optional(),
|
|
485
|
-
back: navigationBackBehaviorSchema.optional(),
|
|
486
|
-
stackBehavior: navigationStackBehaviorSchema.optional(),
|
|
487
|
-
});
|
|
488
|
-
|
|
489
|
-
export const searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
|
|
490
|
-
|
|
491
|
-
export const decisionLayoutSchema = z.object({
|
|
492
|
-
type: z.literal('decision'),
|
|
493
|
-
title: z.string().optional(),
|
|
494
|
-
options: z.array(decisionLayoutOptionSchema),
|
|
495
|
-
control: z.string().optional(),
|
|
496
|
-
margin: sizeSchema.optional(),
|
|
497
|
-
});
|
|
498
|
-
|
|
499
|
-
export const alertLayoutSchema = z.object({
|
|
500
|
-
type: z.literal('alert'),
|
|
501
|
-
markdown: z.string(),
|
|
502
|
-
context: contextSchema.optional(),
|
|
503
|
-
control: z.string().optional(),
|
|
504
|
-
margin: sizeSchema.optional(),
|
|
505
|
-
callToAction: alertLayoutCallToActionSchema.optional(),
|
|
506
|
-
});
|
|
507
|
-
|
|
508
|
-
export const listLayoutSchema = z.object({
|
|
509
|
-
type: z.literal('list'),
|
|
510
|
-
items: z.array(listLayoutItemSchema),
|
|
511
|
-
title: z.string().optional(),
|
|
512
|
-
control: z.string().optional(),
|
|
513
|
-
margin: sizeSchema.optional(),
|
|
474
|
+
export const statusListLayoutItemSchema = z.object({
|
|
475
|
+
title: z.string(),
|
|
476
|
+
description: z.string().optional(),
|
|
477
|
+
icon: iconSchema,
|
|
478
|
+
status: statusListLayoutStatusSchema.optional(),
|
|
479
|
+
callToAction: itemCallToActionSchema.optional(),
|
|
514
480
|
});
|
|
515
481
|
|
|
516
482
|
export const blobSchemaSchema = z.object({
|
|
@@ -553,6 +519,47 @@ export const constSchemaSchema = z.object({
|
|
|
553
519
|
disabled: z.boolean().optional(),
|
|
554
520
|
});
|
|
555
521
|
|
|
522
|
+
export const pollingSchema = z.object({
|
|
523
|
+
url: z.string(),
|
|
524
|
+
interval: z.number().optional(),
|
|
525
|
+
delay: z.number().optional(),
|
|
526
|
+
timeout: z.number().optional(),
|
|
527
|
+
maxAttempts: z.number(),
|
|
528
|
+
onError: pollingOnErrorSchema,
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
export const navigationSchema = z.object({
|
|
532
|
+
backButton: navigationBackBehaviorSchema.optional(),
|
|
533
|
+
back: navigationBackBehaviorSchema.optional(),
|
|
534
|
+
stackBehavior: navigationStackBehaviorSchema.optional(),
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
export const searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
|
|
538
|
+
|
|
539
|
+
export const decisionLayoutSchema = z.object({
|
|
540
|
+
type: z.literal('decision'),
|
|
541
|
+
title: z.string().optional(),
|
|
542
|
+
options: z.array(decisionLayoutOptionSchema),
|
|
543
|
+
control: z.string().optional(),
|
|
544
|
+
margin: sizeSchema.optional(),
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
export const listLayoutSchema = z.object({
|
|
548
|
+
type: z.literal('list'),
|
|
549
|
+
items: z.array(listLayoutItemSchema),
|
|
550
|
+
title: z.string().optional(),
|
|
551
|
+
control: z.string().optional(),
|
|
552
|
+
margin: sizeSchema.optional(),
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
export const statusListLayoutSchema = z.object({
|
|
556
|
+
type: z.literal('status-list'),
|
|
557
|
+
items: z.array(statusListLayoutItemSchema),
|
|
558
|
+
title: z.string().optional(),
|
|
559
|
+
control: z.string().optional(),
|
|
560
|
+
margin: sizeSchema.optional(),
|
|
561
|
+
});
|
|
562
|
+
|
|
556
563
|
export const searchResponseBodySchema = z.object({
|
|
557
564
|
results: z.array(searchResultSchema),
|
|
558
565
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-types",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.23.0",
|
|
4
4
|
"description": "Dynamic Flow TypeScript Types",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
],
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@formatjs/cli": "^6.2.12",
|
|
27
|
-
"@types/react": "18.3.
|
|
27
|
+
"@types/react": "18.3.8",
|
|
28
28
|
"esbuild": "0.23.1",
|
|
29
29
|
"npm-run-all2": "6.2.3",
|
|
30
30
|
"ts-to-zod": "3.6.1",
|