@wise/dynamic-flow-types 4.7.0 → 4.8.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.
@@ -155,6 +155,7 @@ var loadingIndicatorLayoutSchema = z.object({
155
155
  analyticsId: z.string().optional(),
156
156
  tags: z.array(z.string()).optional()
157
157
  });
158
+ var mediaSchema = z.union([mediaAvatarSchema, mediaImageSchema]);
158
159
  var paragraphLayoutSchema = z.object({
159
160
  type: z.literal("paragraph"),
160
161
  text: z.string(),
@@ -177,6 +178,12 @@ var listLayoutStatusSchema = z.union([
177
178
  z.literal("neutral"),
178
179
  z.literal("positive")
179
180
  ]);
181
+ var requestSchema = z.object({
182
+ url: z.string(),
183
+ method: httpMethodSchema,
184
+ body: jsonElementSchema.optional(),
185
+ prefetch: z.boolean().optional()
186
+ });
180
187
  var formLayoutSchemaReferenceSchema = z.object({
181
188
  $ref: z.string()
182
189
  });
@@ -221,7 +228,8 @@ var searchLayoutSchema = z.object({
221
228
  control: z.string().optional(),
222
229
  margin: sizeSchema.optional(),
223
230
  analyticsId: z.string().optional(),
224
- tags: z.array(z.string()).optional()
231
+ tags: z.array(z.string()).optional(),
232
+ hint: z.string().optional()
225
233
  });
226
234
  var infoLayoutSchema = z.object({
227
235
  type: z.literal("info"),
@@ -270,6 +278,16 @@ var markdownLayoutSchema = z.object({
270
278
  tags: z.array(z.string()).optional(),
271
279
  size: sizeSchema.optional()
272
280
  });
281
+ var mediaLayoutSchema = z.object({
282
+ type: z.literal("media"),
283
+ media: mediaSchema,
284
+ align: alignSchema.optional(),
285
+ size: sizeSchema.optional(),
286
+ analyticsId: z.string().optional(),
287
+ control: z.string().optional(),
288
+ margin: sizeSchema.optional(),
289
+ tags: z.array(z.string()).optional()
290
+ });
273
291
  var progressLayoutSchema = z.object({
274
292
  type: z.literal("progress"),
275
293
  title: z.string().optional(),
@@ -288,7 +306,6 @@ var columnsLayoutBiasSchema = z.union([
288
306
  z.literal("left"),
289
307
  z.literal("right")
290
308
  ]);
291
- var mediaSchema = z.union([mediaAvatarSchema, mediaImageSchema]);
292
309
  var searchSearchRequestSchema = z.object({
293
310
  url: z.string(),
294
311
  method: httpMethodSchema,
@@ -398,12 +415,6 @@ var actionSchema = z.object({
398
415
  prefetch: z.boolean().optional()
399
416
  });
400
417
  var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
401
- var requestSchema = z.object({
402
- url: z.string(),
403
- method: httpMethodSchema,
404
- body: jsonElementSchema.optional(),
405
- prefetch: z.boolean().optional()
406
- });
407
418
  var modalPresentationSchema = z.object({
408
419
  type: z.literal("modal")
409
420
  });
@@ -487,7 +498,8 @@ var reviewLayoutCallToActionSchema = z.lazy(
487
498
  action: actionSchema.optional(),
488
499
  title: z.string(),
489
500
  accessibilityDescription: z.string().optional(),
490
- behavior: behaviorSchema.optional()
501
+ behavior: behaviorSchema.optional(),
502
+ context: contextSchema.optional()
491
503
  })
492
504
  );
493
505
  var tabsLayoutSchema = z.lazy(
@@ -525,7 +537,8 @@ var alertLayoutCallToActionSchema = z.lazy(
525
537
  () => z.object({
526
538
  title: z.string(),
527
539
  accessibilityDescription: z.string().optional(),
528
- behavior: behaviorSchema
540
+ behavior: behaviorSchema,
541
+ context: contextSchema.optional()
529
542
  })
530
543
  );
531
544
  var listLayoutSchema = z.lazy(
@@ -544,7 +557,8 @@ var listLayoutCallToActionSchema = z.lazy(
544
557
  () => z.object({
545
558
  title: z.string(),
546
559
  accessibilityDescription: z.string().optional(),
547
- behavior: behaviorSchema
560
+ behavior: behaviorSchema,
561
+ context: contextSchema.optional()
548
562
  })
549
563
  );
550
564
  var listLayoutItemSchema = z.lazy(
@@ -567,6 +581,28 @@ var listLayoutItemSchema = z.lazy(
567
581
  callToAction: listLayoutCallToActionSchema.optional()
568
582
  })
569
583
  );
584
+ var upsellLayoutCallToActionSchema = z.lazy(
585
+ () => z.object({
586
+ title: z.string(),
587
+ accessibilityDescription: z.string().optional(),
588
+ behavior: behaviorSchema,
589
+ context: contextSchema.optional()
590
+ })
591
+ );
592
+ var upsellLayoutSchema = z.lazy(
593
+ () => z.object({
594
+ type: z.literal("upsell"),
595
+ text: z.string(),
596
+ callToAction: upsellLayoutCallToActionSchema,
597
+ media: mediaSchema.optional(),
598
+ onDismiss: requestSchema.optional(),
599
+ context: contextSchema.optional(),
600
+ control: z.string().optional(),
601
+ margin: sizeSchema.optional(),
602
+ analyticsId: z.string().optional(),
603
+ tags: z.array(z.string()).optional()
604
+ })
605
+ );
570
606
  var decisionLayoutSchema = z.lazy(
571
607
  () => z.object({
572
608
  type: z.literal("decision"),
@@ -601,7 +637,8 @@ var sectionLayoutCallToActionSchema = z.lazy(
601
637
  () => z.object({
602
638
  title: z.string(),
603
639
  accessibilityDescription: z.string().optional(),
604
- behavior: behaviorSchema
640
+ behavior: behaviorSchema,
641
+ context: contextSchema.optional()
605
642
  })
606
643
  );
607
644
  var statusListLayoutSchema = z.lazy(
@@ -655,6 +692,7 @@ var layoutSchema = z.lazy(
655
692
  listLayoutSchema,
656
693
  loadingIndicatorLayoutSchema,
657
694
  markdownLayoutSchema,
695
+ mediaLayoutSchema,
658
696
  modalLayoutSchema,
659
697
  paragraphLayoutSchema,
660
698
  progressLayoutSchema,
@@ -662,14 +700,16 @@ var layoutSchema = z.lazy(
662
700
  searchLayoutSchema,
663
701
  sectionLayoutSchema,
664
702
  statusListLayoutSchema,
665
- tabsLayoutSchema
703
+ tabsLayoutSchema,
704
+ upsellLayoutSchema
666
705
  ])
667
706
  );
668
707
  var itemCallToActionSchema = z.lazy(
669
708
  () => z.object({
670
709
  title: z.string(),
671
710
  accessibilityDescription: z.string().optional(),
672
- behavior: behaviorSchema
711
+ behavior: behaviorSchema,
712
+ context: contextSchema.optional()
673
713
  })
674
714
  );
675
715
  var boxLayoutSchema = z.lazy(
@@ -22,7 +22,8 @@ export type SubflowResponseBody = {
22
22
  */
23
23
  onCompletion?: Behavior;
24
24
  /**
25
- * The behavior performed when the subflow fails
25
+ * The behavior performed when the subflow fails. If not provided, the
26
+ * parent flow will be ended and its onError will be called.
26
27
  */
27
28
  onError?: Behavior;
28
29
  };