@rebuy/rebuy 3.25.0 → 3.26.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.
@@ -1,6 +1,10 @@
1
1
  export * from './cabShopConfig';
2
2
  export * from './metadata';
3
3
  export * from './offerProduct';
4
+ export * from './postPurchaseEligibility';
5
+ export * from './postPurchaseIdentity';
6
+ export * from './postPurchaseShadow';
7
+ export * from './postPurchaseSkipTrace';
4
8
  export * from './product';
5
9
  export * from './shopConfig';
6
10
  export * from './smartCart';
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Why the Decider skipped a candidate. Extracted from the frozen branch's `PostPurchaseOfferEligibility`
4
+ * union, which also modeled retained product membership (`status: 'retain' | 'unavailable'`, `members`)
5
+ * — that half is Offer/product-specific and stays out of this Slice. Only the skip-reason vocabulary a
6
+ * skip trace records travels with the Decision contract.
7
+ */
8
+ export declare const PostPurchaseSkipReason: z.ZodEnum<{
9
+ empty: "empty";
10
+ "no-eligible-subscription": "no-eligible-subscription";
11
+ }>;
12
+ export type PostPurchaseSkipReason = z.infer<typeof PostPurchaseSkipReason>;
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ export declare const PostPurchaseTimestampSchema: z.ZodNumber;
3
+ export declare const PostPurchaseOrderIdSchema: z.ZodString;
4
+ export declare const ShopifyDomainSchema: z.ZodString;
5
+ export declare const DecideRequestSchema: z.ZodObject<{
6
+ checkoutToken: z.ZodString;
7
+ shop: z.ZodString;
8
+ }, z.core.$strip>;
9
+ /** A Decision entry: which Flow and node in its tree, which Split (widgetTraffic share) and Widget won. */
10
+ export declare const DecisionEntrySchema: z.ZodObject<{
11
+ blockId: z.ZodNumber;
12
+ blockIndex: z.ZodString;
13
+ blockParentIndex: z.ZodString;
14
+ flowId: z.ZodNumber;
15
+ sectionId: z.ZodNumber;
16
+ widgetId: z.ZodNumber;
17
+ widgetTraffic: z.ZodNumber;
18
+ }, z.core.$strip>;
@@ -0,0 +1,69 @@
1
+ import { z } from 'zod';
2
+ /** Either the Decider found a Widget candidate worth rendering, or it decided to skip. */
3
+ export declare const PostPurchaseShadowSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
+ entry: z.ZodObject<{
5
+ blockId: z.ZodNumber;
6
+ blockIndex: z.ZodString;
7
+ blockParentIndex: z.ZodString;
8
+ flowId: z.ZodNumber;
9
+ sectionId: z.ZodNumber;
10
+ widgetId: z.ZodNumber;
11
+ widgetTraffic: z.ZodNumber;
12
+ }, z.core.$strip>;
13
+ verdict: z.ZodLiteral<"render">;
14
+ }, z.core.$strip>, z.ZodObject<{
15
+ verdict: z.ZodLiteral<"skip">;
16
+ }, z.core.$strip>], "verdict">;
17
+ export type PostPurchaseShadowSelection = z.infer<typeof PostPurchaseShadowSelectionSchema>;
18
+ /**
19
+ * A shadow comparison between the legacy client-side selection and the Decider's own — wire-only. The
20
+ * sampled request/capture shape (`ShadowSampleSchema` upstream, with its Flow-listing and product data)
21
+ * is not small and stays out of this Slice.
22
+ */
23
+ export declare const PostPurchaseShadowReportSchema: z.ZodObject<{
24
+ differences: z.ZodArray<z.ZodEnum<{
25
+ verdict: "verdict";
26
+ entry: "entry";
27
+ targeting: "targeting";
28
+ "incomplete-capture": "incomplete-capture";
29
+ "unsupported-configuration": "unsupported-configuration";
30
+ }>>;
31
+ legacySelection: z.ZodDiscriminatedUnion<[z.ZodObject<{
32
+ entry: z.ZodObject<{
33
+ blockId: z.ZodNumber;
34
+ blockIndex: z.ZodString;
35
+ blockParentIndex: z.ZodString;
36
+ flowId: z.ZodNumber;
37
+ sectionId: z.ZodNumber;
38
+ widgetId: z.ZodNumber;
39
+ widgetTraffic: z.ZodNumber;
40
+ }, z.core.$strip>;
41
+ verdict: z.ZodLiteral<"render">;
42
+ }, z.core.$strip>, z.ZodObject<{
43
+ verdict: z.ZodLiteral<"skip">;
44
+ }, z.core.$strip>], "verdict">;
45
+ phase: z.ZodLiteral<"shouldRender">;
46
+ sampleId: z.ZodString;
47
+ serverSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
48
+ entry: z.ZodObject<{
49
+ blockId: z.ZodNumber;
50
+ blockIndex: z.ZodString;
51
+ blockParentIndex: z.ZodString;
52
+ flowId: z.ZodNumber;
53
+ sectionId: z.ZodNumber;
54
+ widgetId: z.ZodNumber;
55
+ widgetTraffic: z.ZodNumber;
56
+ }, z.core.$strip>;
57
+ verdict: z.ZodLiteral<"render">;
58
+ }, z.core.$strip>, z.ZodObject<{
59
+ verdict: z.ZodLiteral<"skip">;
60
+ }, z.core.$strip>], "verdict">>;
61
+ status: z.ZodEnum<{
62
+ match: "match";
63
+ diverged: "diverged";
64
+ incomplete: "incomplete";
65
+ }>;
66
+ targetingFlowIds: z.ZodArray<z.ZodNumber>;
67
+ workflowPhase: z.ZodLiteral<"decide">;
68
+ }, z.core.$strip>;
69
+ export type PostPurchaseShadowReport = z.infer<typeof PostPurchaseShadowReportSchema>;
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ export declare const POST_PURCHASE_SKIP_LIMIT = 32;
3
+ /** This request's verified reads, not a claim about the path of a competing committed winner. */
4
+ export declare const PostPurchaseSkipTrace: z.ZodArray<z.ZodObject<{
5
+ entry: z.ZodObject<{
6
+ blockId: z.ZodNumber;
7
+ blockIndex: z.ZodString;
8
+ blockParentIndex: z.ZodString;
9
+ flowId: z.ZodNumber;
10
+ sectionId: z.ZodNumber;
11
+ widgetId: z.ZodNumber;
12
+ widgetTraffic: z.ZodNumber;
13
+ }, z.core.$strip>;
14
+ reason: z.ZodEnum<{
15
+ empty: "empty";
16
+ "no-eligible-subscription": "no-eligible-subscription";
17
+ }>;
18
+ }, z.core.$strip>>;
19
+ export type PostPurchaseSkipTrace = z.infer<typeof PostPurchaseSkipTrace>;
@@ -5,6 +5,7 @@ import { type SectionDetails } from './shared';
5
5
  export declare const CABBannerSection: z.ZodLazy<z.ZodObject<{
6
6
  name: z.ZodOptional<z.ZodString>;
7
7
  width: z.ZodDefault<z.ZodNumber>;
8
+ sectionId: z.ZodDefault<z.ZodUUID>;
8
9
  grid: z.ZodOptional<z.ZodDefault<z.ZodObject<{
9
10
  columns: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
10
11
  rows: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
@@ -29,7 +30,6 @@ export declare const CABBannerSection: z.ZodLazy<z.ZodObject<{
29
30
  thick: "thick";
30
31
  }>>;
31
32
  }, z.core.$strip>>>;
32
- sectionId: z.ZodDefault<z.ZodUUID>;
33
33
  mutators: z.ZodOptional<z.ZodArray<z.ZodObject<{
34
34
  effect: z.ZodDefault<z.ZodEnum<{
35
35
  set_false: "set_false";
@@ -5,6 +5,7 @@ import { CABSection, type SectionDetails } from './shared';
5
5
  export declare const CABCarouselSection: z.ZodLazy<z.ZodObject<{
6
6
  name: z.ZodOptional<z.ZodString>;
7
7
  width: z.ZodDefault<z.ZodNumber>;
8
+ sectionId: z.ZodDefault<z.ZodUUID>;
8
9
  grid: z.ZodOptional<z.ZodDefault<z.ZodObject<{
9
10
  columns: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
10
11
  rows: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
@@ -54,7 +55,6 @@ export declare const CABCarouselSection: z.ZodLazy<z.ZodObject<{
54
55
  switchToSubscriptionNoDiscount: "switchToSubscriptionNoDiscount";
55
56
  switchToSubscriptionWithDiscount: "switchToSubscriptionWithDiscount";
56
57
  }>>;
57
- sectionId: z.ZodDefault<z.ZodUUID>;
58
58
  mutators: z.ZodOptional<z.ZodArray<z.ZodObject<{
59
59
  effect: z.ZodDefault<z.ZodEnum<{
60
60
  set_false: "set_false";
@@ -4,6 +4,7 @@ import { CABSection, type SectionDetails } from './shared';
4
4
  export declare const CABCartLineSection: z.ZodLazy<z.ZodObject<{
5
5
  name: z.ZodOptional<z.ZodString>;
6
6
  width: z.ZodDefault<z.ZodNumber>;
7
+ sectionId: z.ZodDefault<z.ZodUUID>;
7
8
  grid: z.ZodOptional<z.ZodDefault<z.ZodObject<{
8
9
  columns: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
9
10
  rows: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
@@ -53,7 +54,6 @@ export declare const CABCartLineSection: z.ZodLazy<z.ZodObject<{
53
54
  switchToSubscriptionNoDiscount: "switchToSubscriptionNoDiscount";
54
55
  switchToSubscriptionWithDiscount: "switchToSubscriptionWithDiscount";
55
56
  }>>;
56
- sectionId: z.ZodDefault<z.ZodUUID>;
57
57
  mutators: z.ZodOptional<z.ZodArray<z.ZodObject<{
58
58
  effect: z.ZodDefault<z.ZodEnum<{
59
59
  set_false: "set_false";
@@ -20,6 +20,7 @@ export declare const IconName: {
20
20
  readonly check: "check";
21
21
  readonly image: "image";
22
22
  readonly discount: "discount";
23
+ readonly empty: "empty";
23
24
  readonly info: "info";
24
25
  readonly grid: "grid";
25
26
  readonly menu: "menu";
@@ -55,7 +56,6 @@ export declare const IconName: {
55
56
  readonly disabled: "disabled";
56
57
  readonly edit: "edit";
57
58
  readonly email: "email";
58
- readonly empty: "empty";
59
59
  readonly external: "external";
60
60
  readonly geolocation: "geolocation";
61
61
  readonly "gift-card": "gift-card";
@@ -94,6 +94,7 @@ export declare const CABImageSectionFields: z.ZodObject<{
94
94
  check: "check";
95
95
  image: "image";
96
96
  discount: "discount";
97
+ empty: "empty";
97
98
  info: "info";
98
99
  grid: "grid";
99
100
  menu: "menu";
@@ -129,7 +130,6 @@ export declare const CABImageSectionFields: z.ZodObject<{
129
130
  disabled: "disabled";
130
131
  edit: "edit";
131
132
  email: "email";
132
- empty: "empty";
133
133
  external: "external";
134
134
  geolocation: "geolocation";
135
135
  "gift-card": "gift-card";
@@ -448,6 +448,7 @@ export declare const CABImageSection: z.ZodObject<{
448
448
  check: "check";
449
449
  image: "image";
450
450
  discount: "discount";
451
+ empty: "empty";
451
452
  info: "info";
452
453
  grid: "grid";
453
454
  menu: "menu";
@@ -483,7 +484,6 @@ export declare const CABImageSection: z.ZodObject<{
483
484
  disabled: "disabled";
484
485
  edit: "edit";
485
486
  email: "email";
486
- empty: "empty";
487
487
  external: "external";
488
488
  geolocation: "geolocation";
489
489
  "gift-card": "gift-card";
@@ -4,6 +4,7 @@ import { CABSection, type SectionDetails } from './shared';
4
4
  export declare const CABOffersSection: z.ZodLazy<z.ZodObject<{
5
5
  name: z.ZodOptional<z.ZodString>;
6
6
  width: z.ZodDefault<z.ZodNumber>;
7
+ sectionId: z.ZodDefault<z.ZodUUID>;
7
8
  grid: z.ZodOptional<z.ZodDefault<z.ZodObject<{
8
9
  columns: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
9
10
  rows: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
@@ -53,7 +54,6 @@ export declare const CABOffersSection: z.ZodLazy<z.ZodObject<{
53
54
  switchToSubscriptionNoDiscount: "switchToSubscriptionNoDiscount";
54
55
  switchToSubscriptionWithDiscount: "switchToSubscriptionWithDiscount";
55
56
  }>>;
56
- sectionId: z.ZodDefault<z.ZodUUID>;
57
57
  mutators: z.ZodOptional<z.ZodArray<z.ZodObject<{
58
58
  effect: z.ZodDefault<z.ZodEnum<{
59
59
  set_false: "set_false";
@@ -69,6 +69,7 @@ export type CABProgressTier = z.infer<typeof CABProgressTier>;
69
69
  */
70
70
  export declare const CABProgressBarSection: z.ZodLazy<z.ZodObject<{
71
71
  width: z.ZodDefault<z.ZodNumber>;
72
+ sectionId: z.ZodDefault<z.ZodUUID>;
72
73
  grid: z.ZodOptional<z.ZodDefault<z.ZodObject<{
73
74
  columns: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
74
75
  rows: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
@@ -118,7 +119,6 @@ export declare const CABProgressBarSection: z.ZodLazy<z.ZodObject<{
118
119
  switchToSubscriptionNoDiscount: "switchToSubscriptionNoDiscount";
119
120
  switchToSubscriptionWithDiscount: "switchToSubscriptionWithDiscount";
120
121
  }>>;
121
- sectionId: z.ZodDefault<z.ZodUUID>;
122
122
  mutators: z.ZodOptional<z.ZodArray<z.ZodObject<{
123
123
  effect: z.ZodDefault<z.ZodEnum<{
124
124
  set_false: "set_false";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebuy/rebuy",
3
- "version": "3.25.0",
3
+ "version": "3.26.0",
4
4
  "description": "Shared zod schemas, legacy-to-CAB widget transforms, and server orchestrators for Rebuy's Shopify consumers (rebuy-api, admin-nextjs, rebuy-shopify-extensions)",
5
5
  "license": "MIT",
6
6
  "author": "Rebuy, Inc.",