@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.
- package/dist/index.js +16 -5
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +16 -5
- package/dist/index.mjs.map +2 -2
- package/dist/pricing/computeDisplayPrice.d.ts +18 -4
- package/dist/pricing/computeDisplayPrice.d.ts.map +1 -1
- package/dist/pricing/index.js +14 -10
- package/dist/pricing/index.js.map +2 -2
- package/dist/pricing/index.mjs +14 -10
- package/dist/pricing/index.mjs.map +2 -2
- package/dist/pricing/priceVariant.d.ts +6 -2
- package/dist/pricing/priceVariant.d.ts.map +1 -1
- package/dist/pricing/types.d.ts +9 -0
- package/dist/pricing/types.d.ts.map +1 -1
- package/dist/schema/cabShopConfig.d.ts +2 -0
- package/dist/schema/cabShopConfig.d.ts.map +1 -1
- package/dist/schema/checkout-and-beyond/index.js +4 -1
- package/dist/schema/checkout-and-beyond/index.js.map +2 -2
- package/dist/schema/checkout-and-beyond/index.mjs +4 -1
- package/dist/schema/checkout-and-beyond/index.mjs.map +2 -2
- package/dist/schema/widget-data.js +4 -1
- package/dist/schema/widget-data.js.map +2 -2
- package/dist/schema/widget-data.mjs +4 -1
- package/dist/schema/widget-data.mjs.map +2 -2
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +3 -2
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts.map +1 -1
- package/dist/server/analytics.d.ts +12 -1
- package/dist/server/analytics.d.ts.map +1 -1
- package/dist/server/dataSourceResults.d.ts +6 -0
- package/dist/server/dataSourceResults.d.ts.map +1 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +148 -6
- package/dist/server/index.js.map +4 -4
- package/dist/server/index.mjs +148 -6
- package/dist/server/index.mjs.map +4 -4
- package/dist/server/requestSchemas.d.ts +226 -0
- package/dist/server/requestSchemas.d.ts.map +1 -0
- package/dist/server/shared.d.ts +5 -139
- package/dist/server/shared.d.ts.map +1 -1
- package/dist/transforms/index.js +9 -5
- package/dist/transforms/index.js.map +2 -2
- package/dist/transforms/index.mjs +9 -5
- package/dist/transforms/index.mjs.map +2 -2
- package/dist/transforms/offerV1/convertOfferToV2.d.ts.map +1 -1
- package/dist/transforms/offerV1/types.d.ts +5 -2
- package/dist/transforms/offerV1/types.d.ts.map +1 -1
- 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
|
-
|
|
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 === "
|
|
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
|
{
|