@rebuy/rebuy 3.59.0 → 3.60.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.
@@ -113,6 +113,7 @@ export declare const normalizePostPurchaseCollection: (settings: unknown, respon
113
113
  declineThisOffer: string;
114
114
  free: string;
115
115
  notAvailable: string;
116
+ oneTimePurchase: string;
116
117
  payNow: string;
117
118
  payNowUpgradeToSubscription: string;
118
119
  quantity: string;
@@ -194,6 +195,7 @@ export declare const normalizePostPurchaseCollection: (settings: unknown, respon
194
195
  declineThisOffer: string;
195
196
  free: string;
196
197
  notAvailable: string;
198
+ oneTimePurchase: string;
197
199
  payNow: string;
198
200
  payNowUpgradeToSubscription: string;
199
201
  quantity: string;
@@ -65,6 +65,7 @@ export declare const normalizePostPurchaseSource: (settings: unknown, response:
65
65
  declineThisOffer: string;
66
66
  free: string;
67
67
  notAvailable: string;
68
+ oneTimePurchase: string;
68
69
  payNow: string;
69
70
  payNowUpgradeToSubscription: string;
70
71
  quantity: string;
@@ -146,6 +147,7 @@ export declare const normalizePostPurchaseSource: (settings: unknown, response:
146
147
  declineThisOffer: string;
147
148
  free: string;
148
149
  notAvailable: string;
150
+ oneTimePurchase: string;
149
151
  payNow: string;
150
152
  payNowUpgradeToSubscription: string;
151
153
  quantity: string;
@@ -332,6 +334,7 @@ export declare const normalizePostPurchaseProduct: (settings: unknown, response:
332
334
  declineThisOffer: string;
333
335
  free: string;
334
336
  notAvailable: string;
337
+ oneTimePurchase: string;
335
338
  payNow: string;
336
339
  payNowUpgradeToSubscription: string;
337
340
  quantity: string;
@@ -413,6 +416,7 @@ export declare const normalizePostPurchaseProduct: (settings: unknown, response:
413
416
  declineThisOffer: string;
414
417
  free: string;
415
418
  notAvailable: string;
419
+ oneTimePurchase: string;
416
420
  payNow: string;
417
421
  payNowUpgradeToSubscription: string;
418
422
  quantity: string;
@@ -0,0 +1,13 @@
1
+ import { type OfferProductReviews } from '../schema/offerProduct';
2
+ import type { Reporter } from '../server/shared';
3
+ /**
4
+ * The aggregate star rating a CAB offer product shows, read server-side from the review integration the
5
+ * widget enables (REB-16699: Junip, Loox, Stamped, Opinew, Judge.me and Okendo keep theirs under their own
6
+ * namespace). `undefined` when no integration is on (the product is left untouched); `null` when one is on
7
+ * but the product has no usable positive rating. Never throws: reviews are display data, and a bad
8
+ * metafield must drop the stars, never the product.
9
+ */
10
+ export declare const projectOfferProductReviews: (integrations: unknown, { id: productId, metafields }: {
11
+ id: number;
12
+ metafields?: unknown;
13
+ }, report?: Reporter) => OfferProductReviews | null | undefined;
@@ -1,5 +1,14 @@
1
1
  import { type ReviewFields } from '../server/postPurchaseReviewFields';
2
2
  import type { selectPostPurchaseReviewProvider } from '../server/postPurchaseReviewProvider';
3
+ /**
4
+ * Reviews.io also writes Shopify's standard product rating fields (https://support.reviews.io/en/articles/9184882),
5
+ * and some stores only have those. Their rating is rating JSON (`{"scale_min":"1.0","scale_max":"5.0","value":"4.8"}`)
6
+ * or a plain number.
7
+ */
8
+ export declare const readStandardReviews: (find: ReviewFields) => {
9
+ rating: number;
10
+ reviewCount: number;
11
+ } | null;
3
12
  /**
4
13
  * Selection is complete before reading data; a missing selected aggregate cannot fall through. Reviews.io reading
5
14
  * its own fields before Shopify's standard ones is one provider's data, not a fall-through: an incomplete reviewscouk
@@ -664,6 +664,7 @@ export declare const prepareMember: (widgetId: number, settings: unknown, respon
664
664
  declineThisOffer: string;
665
665
  free: string;
666
666
  notAvailable: string;
667
+ oneTimePurchase: string;
667
668
  payNow: string;
668
669
  payNowUpgradeToSubscription: string;
669
670
  quantity: string;
@@ -745,6 +746,7 @@ export declare const prepareMember: (widgetId: number, settings: unknown, respon
745
746
  declineThisOffer: string;
746
747
  free: string;
747
748
  notAvailable: string;
749
+ oneTimePurchase: string;
748
750
  payNow: string;
749
751
  payNowUpgradeToSubscription: string;
750
752
  quantity: string;
@@ -1482,6 +1484,7 @@ export declare const prepareMember: (widgetId: number, settings: unknown, respon
1482
1484
  declineThisOffer: string;
1483
1485
  free: string;
1484
1486
  notAvailable: string;
1487
+ oneTimePurchase: string;
1485
1488
  payNow: string;
1486
1489
  payNowUpgradeToSubscription: string;
1487
1490
  quantity: string;
@@ -1563,6 +1566,7 @@ export declare const prepareMember: (widgetId: number, settings: unknown, respon
1563
1566
  declineThisOffer: string;
1564
1567
  free: string;
1565
1568
  notAvailable: string;
1569
+ oneTimePurchase: string;
1566
1570
  payNow: string;
1567
1571
  payNowUpgradeToSubscription: string;
1568
1572
  quantity: string;
@@ -669,6 +669,7 @@ export declare const preparePostPurchaseStsMember: (widgetId: number, settings:
669
669
  declineThisOffer: string;
670
670
  free: string;
671
671
  notAvailable: string;
672
+ oneTimePurchase: string;
672
673
  payNow: string;
673
674
  payNowUpgradeToSubscription: string;
674
675
  quantity: string;
@@ -750,6 +751,7 @@ export declare const preparePostPurchaseStsMember: (widgetId: number, settings:
750
751
  declineThisOffer: string;
751
752
  free: string;
752
753
  notAvailable: string;
754
+ oneTimePurchase: string;
753
755
  payNow: string;
754
756
  payNowUpgradeToSubscription: string;
755
757
  quantity: string;
@@ -90,6 +90,7 @@ export declare const projectPostPurchaseProduct: ({ data, effective, metadata, o
90
90
  declineThisOffer: string;
91
91
  free: string;
92
92
  notAvailable: string;
93
+ oneTimePurchase: string;
93
94
  payNow: string;
94
95
  payNowUpgradeToSubscription: string;
95
96
  quantity: string;
@@ -30,8 +30,8 @@ export type UpstreamFetch = (path: string, params: Record<string, string>, optio
30
30
  * offer product (or a post-purchase data-source product, `product`, named by id and dotted path), an
31
31
  * invalid/unknown section stubbed out, an unreadable rule verdict, a shop-config entry the shared schema
32
32
  * inerted (`shopConfig`), unreadable selectable-gift milestones (`giftMilestones` — the widget's gifts are
33
- * then kept), or a post-purchase product's malformed selected review metafield (`reviews` — the reviews are
34
- * then omitted; it names the product and the field, never the value). Distinct from a hard
33
+ * then kept), or a post-purchase or CAB offer product's malformed selected review metafield (`reviews` — the
34
+ * reviews are then omitted; it names the product and the field, never the value). Distinct from a hard
35
35
  * {@link UpstreamError} — the request still succeeds (degraded), so this is the only trace that an upstream
36
36
  * contract moved. Optional on {@link ServerContext}; the host (rebuy-api) wires it to its logger.
37
37
  */
@@ -4168,6 +4168,8 @@ var PostPurchaseSettings = import_zod31.z.object({
4168
4168
  declineThisOffer: import_zod31.z.string().default("Decline this offer"),
4169
4169
  free: import_zod31.z.string().optional().default("Free"),
4170
4170
  notAvailable: import_zod31.z.string().optional().default("Not available"),
4171
+ /** Label for the one-time choice beside `subscriptionOption` in the purchase-type selector */
4172
+ oneTimePurchase: import_zod31.z.string().optional().default("One-time Purchase"),
4171
4173
  payNow: import_zod31.z.string().default("Pay Now"),
4172
4174
  payNowUpgradeToSubscription: import_zod31.z.string().optional().default("Upgrade to Subscription"),
4173
4175
  quantity: import_zod31.z.string().default("Quantity"),
@@ -4187,6 +4189,7 @@ var PostPurchaseSettings = import_zod31.z.object({
4187
4189
  declineThisOffer: "Decline this offer",
4188
4190
  free: "Free",
4189
4191
  notAvailable: "Not available",
4192
+ oneTimePurchase: "One-time Purchase",
4190
4193
  payNow: "Pay Now",
4191
4194
  payNowUpgradeToSubscription: "Upgrade to Subscription",
4192
4195
  quantity: "Quantity",
@@ -4107,6 +4107,8 @@ var PostPurchaseSettings = z31.object({
4107
4107
  declineThisOffer: z31.string().default("Decline this offer"),
4108
4108
  free: z31.string().optional().default("Free"),
4109
4109
  notAvailable: z31.string().optional().default("Not available"),
4110
+ /** Label for the one-time choice beside `subscriptionOption` in the purchase-type selector */
4111
+ oneTimePurchase: z31.string().optional().default("One-time Purchase"),
4110
4112
  payNow: z31.string().default("Pay Now"),
4111
4113
  payNowUpgradeToSubscription: z31.string().optional().default("Upgrade to Subscription"),
4112
4114
  quantity: z31.string().default("Quantity"),
@@ -4126,6 +4128,7 @@ var PostPurchaseSettings = z31.object({
4126
4128
  declineThisOffer: "Decline this offer",
4127
4129
  free: "Free",
4128
4130
  notAvailable: "Not available",
4131
+ oneTimePurchase: "One-time Purchase",
4129
4132
  payNow: "Pay Now",
4130
4133
  payNowUpgradeToSubscription: "Upgrade to Subscription",
4131
4134
  quantity: "Quantity",
@@ -25,6 +25,7 @@ export declare const ProductCardSettings: z.ZodCatch<z.ZodObject<{
25
25
  declineThisOffer: z.ZodCatch<z.ZodDefault<z.ZodString>> | z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodString>>> | z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>>>;
26
26
  free: z.ZodCatch<z.ZodDefault<z.ZodString>> | z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodString>>> | z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>>>;
27
27
  notAvailable: z.ZodCatch<z.ZodDefault<z.ZodString>> | z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodString>>> | z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>>>;
28
+ oneTimePurchase: z.ZodCatch<z.ZodDefault<z.ZodString>> | z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodString>>> | z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>>>;
28
29
  payNowUpgradeToSubscription: z.ZodCatch<z.ZodDefault<z.ZodString>> | z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodString>>> | z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>>>;
29
30
  recurringShipping: z.ZodCatch<z.ZodDefault<z.ZodString>> | z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodString>>> | z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>>>;
30
31
  recurringSubtotal: z.ZodCatch<z.ZodDefault<z.ZodString>> | z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodString>>> | z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebuy/rebuy",
3
- "version": "3.59.0",
3
+ "version": "3.60.1",
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.",