@rebuy/rebuy 2.30.0-rc.4 → 2.30.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.
- package/dist/gwp/types.d.ts +6 -1
- package/dist/gwp/types.d.ts.map +1 -1
- package/dist/index.js +29 -12
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +29 -12
- package/dist/index.mjs.map +2 -2
- package/dist/schema/cabShopConfig.d.ts +20 -20
- package/dist/schema/cabShopConfig.d.ts.map +1 -1
- package/dist/schema/checkout-and-beyond/index.js +18 -11
- package/dist/schema/checkout-and-beyond/index.js.map +2 -2
- package/dist/schema/checkout-and-beyond/index.mjs +18 -11
- package/dist/schema/checkout-and-beyond/index.mjs.map +2 -2
- package/dist/schema/widget-data.js +17 -11
- package/dist/schema/widget-data.js.map +2 -2
- package/dist/schema/widget-data.mjs +17 -11
- package/dist/schema/widget-data.mjs.map +2 -2
- package/dist/schema/widgetData.d.ts +27 -27
- package/dist/schema/widgets/checkout-and-beyond/regex.d.ts +5 -0
- package/dist/schema/widgets/checkout-and-beyond/regex.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts +18 -18
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/text.d.ts +4 -4
- package/dist/schema/widgets/checkout-and-beyond/text.d.ts.map +1 -1
- package/dist/schema/widgets/contentBlock.d.ts +9 -9
- package/dist/schema/widgets/lineItemEditor.d.ts +9 -9
- package/dist/schema/widgets/post-purchase-offer/postPurchaseBlocks.d.ts +18 -18
- package/dist/schema/widgets/post-purchase-offer/postPurchaseOffer.d.ts +9 -9
- package/dist/schema/widgets/post-purchase-offer/postPurchaseSettings.d.ts +9 -9
- package/dist/schema/widgets/post-purchase-offer/postPurchaseWidget.d.ts +9 -9
- package/dist/schema/widgets/rebuyButton.d.ts +9 -9
- package/dist/server/adsEngine.d.ts +5 -4
- package/dist/server/adsEngine.d.ts.map +1 -1
- package/dist/server/analytics.d.ts +4 -2
- package/dist/server/analytics.d.ts.map +1 -1
- package/dist/server/composeOffer.d.ts +1 -1
- package/dist/server/composeOffer.d.ts.map +1 -1
- package/dist/server/dataSourceResults.d.ts.map +1 -1
- package/dist/server/giftValidation.d.ts +6 -0
- package/dist/server/giftValidation.d.ts.map +1 -1
- package/dist/server/index.js +124 -57
- package/dist/server/index.js.map +2 -2
- package/dist/server/index.mjs +124 -57
- package/dist/server/index.mjs.map +2 -2
- package/dist/server/monetizeOffers.d.ts.map +1 -1
- package/dist/server/salvageSections.d.ts.map +1 -1
- package/dist/server/shared.d.ts +2 -0
- package/dist/server/shared.d.ts.map +1 -1
- package/dist/transforms/experiments/resolveExperiment.d.ts.map +1 -1
- package/dist/transforms/htmlToTiptap/isValidHref.d.ts +4 -3
- package/dist/transforms/htmlToTiptap/isValidHref.d.ts.map +1 -1
- package/dist/transforms/index.js +39 -23
- package/dist/transforms/index.js.map +2 -2
- package/dist/transforms/index.mjs +39 -23
- package/dist/transforms/index.mjs.map +2 -2
- package/dist/transforms/progressBarV1/convertProgressBarToV2.d.ts.map +1 -1
- package/dist/transforms/progressBarV1/types.d.ts +8 -2
- package/dist/transforms/progressBarV1/types.d.ts.map +1 -1
- package/dist/transforms/smartCart/convertSmartCartProgressBarToV2.d.ts +3 -1
- package/dist/transforms/smartCart/convertSmartCartProgressBarToV2.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/gwp/types.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/** A gift-with-purchase cart line the client asks the server to validate. */
|
|
2
2
|
export type GwpGift = {
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* The gift line's total in the buyer's MARKET currency, MAJOR units (e.g. `19.99`) — a
|
|
5
|
+
* Function-discounted (free) gift is `0`. Only the zero/non-zero distinction is read
|
|
6
|
+
* (`cost > 0` ⇒ the gift lost its discount), so the exact unit isn't load-bearing; send the
|
|
7
|
+
* Shopify cart-line total as-is.
|
|
8
|
+
*/
|
|
4
9
|
cost: number;
|
|
5
10
|
/** Whether the Shopify Function discount is currently allocated to the line. */
|
|
6
11
|
discounted: boolean;
|
package/dist/gwp/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/gwp/types.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,MAAM,MAAM,OAAO,GAAG;IAClB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/gwp/types.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,MAAM,MAAM,OAAO,GAAG;IAClB;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,UAAU,EAAE,OAAO,CAAC;IACpB,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG;IACtB,KAAK,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,EAAE,CAAC;IAC1C,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE;YAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,EAAE,CAAC;CAC/D,CAAC;AAEF,yDAAyD;AACzD,MAAM,MAAM,WAAW,GAAG;IACtB,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,cAAc,CAAC,EAAE,WAAW,EAAE,CAAC;CAClC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -110,6 +110,7 @@ __export(src_exports, {
|
|
|
110
110
|
ProgressTierUnit: () => ProgressTierUnit,
|
|
111
111
|
QuantityInput: () => QuantityInput,
|
|
112
112
|
REVIEW_LABELS: () => REVIEW_LABELS,
|
|
113
|
+
ROOT_RELATIVE_PATH_REGEX: () => ROOT_RELATIVE_PATH_REGEX,
|
|
113
114
|
RebuyButton: () => RebuyButton,
|
|
114
115
|
RebuyButtonV1: () => RebuyButtonV1,
|
|
115
116
|
RebuyClient: () => RebuyClient,
|
|
@@ -1066,7 +1067,17 @@ var CabActiveExperiment = import_zod2.z.object({
|
|
|
1066
1067
|
type: import_zod2.z.string()
|
|
1067
1068
|
});
|
|
1068
1069
|
var CabShopConfig = import_zod2.z.object({
|
|
1069
|
-
|
|
1070
|
+
/**
|
|
1071
|
+
* Per-element resilient: parse as `unknown[]` (non-array → `[]`), then keep only the experiments that
|
|
1072
|
+
* validate. A single drifted experiment drops itself instead of `.catch`-ing the WHOLE array to `[]` and
|
|
1073
|
+
* silently disabling every live A/B test fleet-wide.
|
|
1074
|
+
*/
|
|
1075
|
+
activeExperiments: import_zod2.z.array(import_zod2.z.unknown()).catch([]).default([]).transform(
|
|
1076
|
+
(experiments) => experiments.flatMap((experiment) => {
|
|
1077
|
+
const result = CabActiveExperiment.safeParse(experiment);
|
|
1078
|
+
return result.success ? [result.data] : [];
|
|
1079
|
+
})
|
|
1080
|
+
),
|
|
1070
1081
|
apiKey: import_zod2.z.string(),
|
|
1071
1082
|
/**
|
|
1072
1083
|
* The shop's base-currency ISO code (e.g. `'USD'`). CAB derives the shop minor-unit exponent from it
|
|
@@ -1807,6 +1818,7 @@ var import_zod12 = require("zod");
|
|
|
1807
1818
|
var ARRAY_INDEX_STRING = /^(0|[1-9]\d*)$/;
|
|
1808
1819
|
var DYNAMIC_TOKEN_REGEX = /^\{\{\s*[A-Za-z]+\s*\}\}$/;
|
|
1809
1820
|
var HEX_COLOR_REGEX = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
|
|
1821
|
+
var ROOT_RELATIVE_PATH_REGEX = /^\/(?!\/)/;
|
|
1810
1822
|
var HTML_TAGS_REGEX = /<\/?[a-zA-Z][^>]*>/g;
|
|
1811
1823
|
|
|
1812
1824
|
// src/schema/widgets/checkout-and-beyond/utils.ts
|
|
@@ -1889,7 +1901,12 @@ var TiptapText = import_zod13.z.object({
|
|
|
1889
1901
|
import_zod13.z.object({
|
|
1890
1902
|
attrs: import_zod13.z.object({
|
|
1891
1903
|
class: import_zod13.z.string().nullable(),
|
|
1892
|
-
href: import_zod13.z.union([
|
|
1904
|
+
href: import_zod13.z.union([
|
|
1905
|
+
import_zod13.z.url(),
|
|
1906
|
+
import_zod13.z.literal("#"),
|
|
1907
|
+
import_zod13.z.string().regex(DYNAMIC_TOKEN_REGEX),
|
|
1908
|
+
import_zod13.z.string().regex(ROOT_RELATIVE_PATH_REGEX)
|
|
1909
|
+
]),
|
|
1893
1910
|
rel: import_zod13.z.string().default("noopener noreferrer nofollow"),
|
|
1894
1911
|
target: import_zod13.z.string().default("_blank")
|
|
1895
1912
|
}),
|
|
@@ -2565,17 +2582,17 @@ var UI_LABELS = {
|
|
|
2565
2582
|
};
|
|
2566
2583
|
|
|
2567
2584
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
2568
|
-
var localized = () => import_zod29.z.record(import_zod29.z.string(), import_zod29.z.string());
|
|
2585
|
+
var localized = (fallback) => import_zod29.z.record(import_zod29.z.string(), import_zod29.z.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
2569
2586
|
var CABUILabels = import_zod29.z.object({
|
|
2570
|
-
currentPage: localized(
|
|
2571
|
-
loadingOptions: localized(
|
|
2572
|
-
nextPage: localized(
|
|
2573
|
-
offerDialog: localized(
|
|
2574
|
-
page: localized(
|
|
2575
|
-
previousPage: localized(
|
|
2576
|
-
selected: localized(
|
|
2577
|
-
subscriptionOptions: localized(
|
|
2578
|
-
updating: localized(
|
|
2587
|
+
currentPage: localized(UI_LABELS.currentPage),
|
|
2588
|
+
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
2589
|
+
nextPage: localized(UI_LABELS.nextPage),
|
|
2590
|
+
offerDialog: localized(UI_LABELS.offerDialog),
|
|
2591
|
+
page: localized(UI_LABELS.page),
|
|
2592
|
+
previousPage: localized(UI_LABELS.previousPage),
|
|
2593
|
+
selected: localized(UI_LABELS.selected),
|
|
2594
|
+
subscriptionOptions: localized(UI_LABELS.subscriptionOptions),
|
|
2595
|
+
updating: localized(UI_LABELS.updating)
|
|
2579
2596
|
}).default(() => ({
|
|
2580
2597
|
currentPage: { ...UI_LABELS.currentPage },
|
|
2581
2598
|
loadingOptions: { ...UI_LABELS.loadingOptions },
|