@rebuy/rebuy 2.30.0-rc.2 → 2.30.0-rc.4

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.
Files changed (50) hide show
  1. package/dist/index.js +16 -5
  2. package/dist/index.js.map +2 -2
  3. package/dist/index.mjs +16 -5
  4. package/dist/index.mjs.map +2 -2
  5. package/dist/pricing/computeDisplayPrice.d.ts +18 -4
  6. package/dist/pricing/computeDisplayPrice.d.ts.map +1 -1
  7. package/dist/pricing/index.js +14 -10
  8. package/dist/pricing/index.js.map +2 -2
  9. package/dist/pricing/index.mjs +14 -10
  10. package/dist/pricing/index.mjs.map +2 -2
  11. package/dist/pricing/priceVariant.d.ts +6 -2
  12. package/dist/pricing/priceVariant.d.ts.map +1 -1
  13. package/dist/pricing/types.d.ts +9 -0
  14. package/dist/pricing/types.d.ts.map +1 -1
  15. package/dist/schema/cabShopConfig.d.ts +2 -0
  16. package/dist/schema/cabShopConfig.d.ts.map +1 -1
  17. package/dist/schema/checkout-and-beyond/index.js +4 -1
  18. package/dist/schema/checkout-and-beyond/index.js.map +2 -2
  19. package/dist/schema/checkout-and-beyond/index.mjs +4 -1
  20. package/dist/schema/checkout-and-beyond/index.mjs.map +2 -2
  21. package/dist/schema/widget-data.js +4 -1
  22. package/dist/schema/widget-data.js.map +2 -2
  23. package/dist/schema/widget-data.mjs +4 -1
  24. package/dist/schema/widget-data.mjs.map +2 -2
  25. package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +3 -2
  26. package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts.map +1 -1
  27. package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts +1 -1
  28. package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts.map +1 -1
  29. package/dist/server/analytics.d.ts +12 -1
  30. package/dist/server/analytics.d.ts.map +1 -1
  31. package/dist/server/dataSourceResults.d.ts +6 -0
  32. package/dist/server/dataSourceResults.d.ts.map +1 -1
  33. package/dist/server/index.d.ts +1 -0
  34. package/dist/server/index.d.ts.map +1 -1
  35. package/dist/server/index.js +148 -6
  36. package/dist/server/index.js.map +4 -4
  37. package/dist/server/index.mjs +148 -6
  38. package/dist/server/index.mjs.map +4 -4
  39. package/dist/server/requestSchemas.d.ts +226 -0
  40. package/dist/server/requestSchemas.d.ts.map +1 -0
  41. package/dist/server/shared.d.ts +5 -139
  42. package/dist/server/shared.d.ts.map +1 -1
  43. package/dist/transforms/index.js +9 -5
  44. package/dist/transforms/index.js.map +2 -2
  45. package/dist/transforms/index.mjs +9 -5
  46. package/dist/transforms/index.mjs.map +2 -2
  47. package/dist/transforms/offerV1/convertOfferToV2.d.ts.map +1 -1
  48. package/dist/transforms/offerV1/types.d.ts +5 -2
  49. package/dist/transforms/offerV1/types.d.ts.map +1 -1
  50. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1068,6 +1068,13 @@ var CabActiveExperiment = import_zod2.z.object({
1068
1068
  var CabShopConfig = import_zod2.z.object({
1069
1069
  activeExperiments: import_zod2.z.array(CabActiveExperiment).catch([]).default([]),
1070
1070
  apiKey: import_zod2.z.string(),
1071
+ /**
1072
+ * The shop's base-currency ISO code (e.g. `'USD'`). CAB derives the shop minor-unit exponent from it
1073
+ * (`currencyDecimals`) so a Functions-applied fixed discount — whose amount is in shop minor units —
1074
+ * converts to the buyer's currency exactly in a cross-decimal market. `.catch()` like its siblings: a
1075
+ * missing/renamed currency degrades to "unknown" (client falls back to buyer decimals), never a parse fail.
1076
+ */
1077
+ currency: import_zod2.z.string().optional().catch(void 0),
1071
1078
  monetize: import_zod2.z.object({ publisherKey: import_zod2.z.string().nullable() }).nullish().catch(void 0),
1072
1079
  shopId: import_zod2.z.number().optional().catch(void 0)
1073
1080
  });
@@ -2336,6 +2343,8 @@ var CABProgressBarSection = import_zod23.z.lazy(
2336
2343
  selectOptions: { ...GIFT_LABELS.selectOptions },
2337
2344
  yourGift: { ...GIFT_LABELS.yourGift }
2338
2345
  })),
2346
+ /** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
2347
+ name: import_zod23.z.string().default("Order progress"),
2339
2348
  /**
2340
2349
  * Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
2341
2350
  * fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
@@ -2377,7 +2386,8 @@ var CABQuantitySection = import_zod24.z.object({
2377
2386
  inputType: import_zod24.z.enum(quantityInputs).default(QuantityInput.select),
2378
2387
  max: import_zod24.z.number().min(1).max(100).default(10),
2379
2388
  min: import_zod24.z.number().min(1).default(1),
2380
- name: import_zod24.z.string().optional(),
2389
+ /** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
2390
+ name: import_zod24.z.string().default("Quantity"),
2381
2391
  rule: CABRule.optional(),
2382
2392
  sectionId: import_zod24.z.uuid().default(() => (0, import_uuid9.v7)()),
2383
2393
  sectionType: import_zod24.z.literal(SectionType.quantity).default(SectionType.quantity)
@@ -4182,10 +4192,11 @@ var bannerMessageContent = (message) => {
4182
4192
  return sanitized ? { ...OFFER_LABELS.addedToCartMessage, en: sanitized } : OFFER_LABELS.addedToCartMessage;
4183
4193
  };
4184
4194
  var coerceIntegrations = (integrations) => Object.fromEntries(
4185
- Object.entries(integrations).map(([key, value]) => [
4186
- key,
4187
- typeof value === "string" ? ["true", "yes"].includes(value.toLowerCase()) : value
4188
- ])
4195
+ Object.entries(integrations).map(([key, value]) => {
4196
+ if (typeof value === "string") return [key, ["true", "yes"].includes(value.toLowerCase())];
4197
+ if (typeof value === "number") return [key, value === 1];
4198
+ return [key, value];
4199
+ })
4189
4200
  );
4190
4201
  var buildBanner = (language) => language?.successBannerEnabled ? [
4191
4202
  {