@rebuy/rebuy 2.37.0-rc.1 → 3.0.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/README.md +43 -2
- package/dist/api.d.ts +1 -2
- package/dist/{client.js → client.cjs} +4 -16
- package/dist/client.d.ts +0 -1
- package/dist/client.mjs +4 -16
- package/dist/cookie.d.ts +0 -1
- package/dist/geolocation.d.ts +0 -1
- package/dist/gwp/getValidGwpProductIds.d.ts +0 -1
- package/dist/gwp/hasUnsupportedRuleTypes.d.ts +0 -1
- package/dist/gwp/{index.js → index.cjs} +0 -1
- package/dist/gwp/index.d.ts +0 -1
- package/dist/gwp/index.mjs +0 -1
- package/dist/gwp/isDefinitiveRuleAnswer.d.ts +0 -1
- package/dist/gwp/shouldRemoveGift.d.ts +0 -1
- package/dist/gwp/types.d.ts +0 -1
- package/dist/identity.d.ts +0 -1
- package/dist/{index.js → index.cjs} +193 -136
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +170 -113
- package/dist/pricing/amountToCents.d.ts +0 -1
- package/dist/pricing/computeCompareAtPrice.d.ts +0 -1
- package/dist/pricing/computeDisplayPrice.d.ts +0 -1
- package/dist/pricing/currencyDecimals.d.ts +0 -1
- package/dist/pricing/{index.js → index.cjs} +0 -1
- package/dist/pricing/index.d.ts +0 -1
- package/dist/pricing/index.mjs +0 -1
- package/dist/pricing/priceVariant.d.ts +0 -1
- package/dist/pricing/types.d.ts +4 -11
- package/dist/{routes.js → routes.cjs} +0 -1
- package/dist/routes.d.ts +0 -1
- package/dist/routes.mjs +0 -1
- package/dist/schema/cabShopConfig.d.ts +0 -1
- package/dist/schema/checkout-and-beyond/{constants.js → constants.cjs} +4 -1
- package/dist/schema/checkout-and-beyond/constants.mjs +4 -1
- package/dist/schema/checkout-and-beyond/{index.js → index.cjs} +68 -38
- package/dist/schema/checkout-and-beyond/index.mjs +67 -37
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/metadata.d.ts +0 -1
- package/dist/schema/offerProduct.d.ts +0 -1
- package/dist/schema/product.d.ts +0 -1
- package/dist/schema/{shop-config.js → shop-config.cjs} +0 -1
- package/dist/schema/shop-config.mjs +0 -1
- package/dist/schema/shopConfig.d.ts +0 -1
- package/dist/schema/smartCart.d.ts +0 -1
- package/dist/schema/{user-config.js → user-config.cjs} +0 -1
- package/dist/schema/user-config.mjs +0 -1
- package/dist/schema/userConfig.d.ts +0 -1
- package/dist/schema/{widget-data.js → widget-data.cjs} +33 -6
- package/dist/schema/widget-data.mjs +35 -8
- package/dist/schema/widgetData.d.ts +48 -25
- package/dist/schema/widgets/abTestingPlaceholder.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/button.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +6 -1
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +11 -1
- package/dist/schema/widgets/checkout-and-beyond/constants.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/dataSource.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/discount.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/giftLabels.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/icons.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts +2 -3
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/layout.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/monetize.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/offerLabels.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/product.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/products.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/regex.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/reviewLabels.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts +44 -16
- package/dist/schema/widgets/checkout-and-beyond/rule.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/shared.d.ts +10 -1
- package/dist/schema/widgets/checkout-and-beyond/switchLabels.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/text.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/uiLabels.d.ts +0 -1
- package/dist/schema/widgets/checkout-and-beyond/utils.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/variants.d.ts +0 -1
- package/dist/schema/widgets/checkoutExtension.d.ts +0 -1
- package/dist/schema/widgets/contentBlock.d.ts +16 -9
- package/dist/schema/widgets/giftWithPurchase.d.ts +0 -1
- package/dist/schema/widgets/lineItemEditor.d.ts +16 -9
- package/dist/schema/widgets/post-purchase-offer/common.d.ts +0 -1
- package/dist/schema/widgets/post-purchase-offer/constants.d.ts +0 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseBlocks.d.ts +0 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseOffer.d.ts +0 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseSettings.d.ts +0 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseWidget.d.ts +0 -1
- package/dist/schema/widgets/progressBar.d.ts +0 -1
- package/dist/schema/widgets/rebuyButton.d.ts +16 -9
- package/dist/schema/widgets/rebuyMonetize.d.ts +0 -1
- package/dist/server/adsEngine.d.ts +0 -1
- package/dist/server/analytics.d.ts +0 -1
- package/dist/server/b2bAvailability.d.ts +0 -1
- package/dist/server/composeOffer.d.ts +0 -1
- package/dist/server/dataSourceResults.d.ts +0 -1
- package/dist/server/giftValidation.d.ts +0 -1
- package/dist/server/{index.js → index.cjs} +222 -201
- package/dist/server/index.d.ts +6 -5
- package/dist/server/index.mjs +218 -197
- package/dist/server/monetizeOffers.d.ts +0 -1
- package/dist/server/requestSchemas.d.ts +0 -1
- package/dist/server/salvageSections.d.ts +1 -11
- package/dist/server/shared.d.ts +6 -1
- package/dist/server/userConfig.d.ts +0 -1
- package/dist/server/widgetSettings.d.ts +0 -1
- package/dist/session.d.ts +0 -1
- package/dist/transforms/contentBlockV1/convertContentBlockImageToV2.d.ts +0 -1
- package/dist/transforms/contentBlockV1/convertContentBlockTextToV2.d.ts +0 -1
- package/dist/transforms/contentBlockV1/convertContentBlockToV2.d.ts +0 -1
- package/dist/transforms/contentBlockV1/convertTextToTiptapParagraph.d.ts +0 -1
- package/dist/transforms/contentBlockV1/stripContentBlockHtml.d.ts +0 -1
- package/dist/transforms/contentBlockV1/types.d.ts +3 -8
- package/dist/transforms/convertNumericObjects.d.ts +7 -1
- package/dist/transforms/deepCamelCase.d.ts +0 -1
- package/dist/transforms/experiments/resolveExperiment.d.ts +0 -1
- package/dist/transforms/htmlToTiptap/buildDefaultTextStyleMark.d.ts +0 -1
- package/dist/transforms/htmlToTiptap/buildLinkMark.d.ts +0 -1
- package/dist/transforms/htmlToTiptap/closeTag.d.ts +0 -1
- package/dist/transforms/htmlToTiptap/constants.d.ts +0 -1
- package/dist/transforms/htmlToTiptap/decodeEntities.d.ts +0 -1
- package/dist/transforms/htmlToTiptap/flushParagraph.d.ts +0 -1
- package/dist/transforms/htmlToTiptap/htmlToTiptap.d.ts +0 -1
- package/dist/transforms/htmlToTiptap/isSkipping.d.ts +0 -1
- package/dist/transforms/htmlToTiptap/isValidHref.d.ts +0 -1
- package/dist/transforms/htmlToTiptap/makeDoc.d.ts +0 -1
- package/dist/transforms/htmlToTiptap/makeParagraph.d.ts +0 -1
- package/dist/transforms/htmlToTiptap/openTag.d.ts +0 -1
- package/dist/transforms/htmlToTiptap/parseAttribs.d.ts +0 -1
- package/dist/transforms/htmlToTiptap/pushText.d.ts +0 -1
- package/dist/transforms/htmlToTiptap/stripHtmlComments.d.ts +0 -1
- package/dist/transforms/htmlToTiptap/types.d.ts +0 -1
- package/dist/transforms/{index.js → index.cjs} +189 -168
- package/dist/transforms/index.d.ts +0 -1
- package/dist/transforms/index.mjs +187 -166
- package/dist/transforms/isCABRootSection.d.ts +0 -1
- package/dist/transforms/isWidgetV1.d.ts +10 -0
- package/dist/transforms/lineItemEditorV1/convertLineItemEditorToV2.d.ts +0 -1
- package/dist/transforms/lineItemEditorV1/types.d.ts +24 -3
- package/dist/transforms/localizedContent.d.ts +0 -1
- package/dist/transforms/monetizeV1/convertMonetizeToV2.d.ts +0 -1
- package/dist/transforms/monetizeV1/types.d.ts +15 -3
- package/dist/transforms/normalizeTextContent.d.ts +0 -1
- package/dist/transforms/normalizeTokens.d.ts +0 -1
- package/dist/transforms/offerV1/buildOfferTemplate.d.ts +2 -2
- package/dist/transforms/offerV1/convertOfferToV2.d.ts +0 -1
- package/dist/transforms/offerV1/offerCard.d.ts +2 -1
- package/dist/transforms/offerV1/offerTemplateSeed.d.ts +0 -1
- package/dist/transforms/offerV1/types.d.ts +16 -10
- package/dist/transforms/parseShielded.d.ts +0 -1
- package/dist/transforms/presentmentThresholds.d.ts +13 -0
- package/dist/transforms/progressBarV1/convertProgressBarToV2.d.ts +0 -1
- package/dist/transforms/progressBarV1/types.d.ts +2 -2
- package/dist/transforms/reactBarChrome.d.ts +0 -1
- package/dist/transforms/smartCart/convertSmartCartProgressBarToV2.d.ts +0 -1
- package/dist/transforms/smartCart/extractSmartCartBars.d.ts +0 -1
- package/dist/transforms/v1Location.d.ts +11 -0
- package/dist/{utilities.js → utilities.cjs} +2 -14
- package/dist/utilities.d.ts +5 -2
- package/dist/utilities.mjs +2 -14
- package/package.json +89 -40
- package/dist/api.d.ts.map +0 -1
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js.map +0 -7
- package/dist/client.mjs.map +0 -7
- package/dist/cookie.d.ts.map +0 -1
- package/dist/geolocation.d.ts.map +0 -1
- package/dist/gwp/getValidGwpProductIds.d.ts.map +0 -1
- package/dist/gwp/hasUnsupportedRuleTypes.d.ts.map +0 -1
- package/dist/gwp/index.d.ts.map +0 -1
- package/dist/gwp/index.js.map +0 -7
- package/dist/gwp/index.mjs.map +0 -7
- package/dist/gwp/isDefinitiveRuleAnswer.d.ts.map +0 -1
- package/dist/gwp/shouldRemoveGift.d.ts.map +0 -1
- package/dist/gwp/types.d.ts.map +0 -1
- package/dist/identity.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -7
- package/dist/index.mjs.map +0 -7
- package/dist/pricing/amountToCents.d.ts.map +0 -1
- package/dist/pricing/computeCompareAtPrice.d.ts.map +0 -1
- package/dist/pricing/computeDisplayPrice.d.ts.map +0 -1
- package/dist/pricing/currencyDecimals.d.ts.map +0 -1
- package/dist/pricing/index.d.ts.map +0 -1
- package/dist/pricing/index.js.map +0 -7
- package/dist/pricing/index.mjs.map +0 -7
- package/dist/pricing/priceVariant.d.ts.map +0 -1
- package/dist/pricing/types.d.ts.map +0 -1
- package/dist/routes.d.ts.map +0 -1
- package/dist/routes.js.map +0 -7
- package/dist/routes.mjs.map +0 -7
- package/dist/schema/cabShopConfig.d.ts.map +0 -1
- package/dist/schema/checkout-and-beyond/constants.js.map +0 -7
- package/dist/schema/checkout-and-beyond/constants.mjs.map +0 -7
- package/dist/schema/checkout-and-beyond/index.js.map +0 -7
- package/dist/schema/checkout-and-beyond/index.mjs.map +0 -7
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/metadata.d.ts.map +0 -1
- package/dist/schema/offerProduct.d.ts.map +0 -1
- package/dist/schema/product.d.ts.map +0 -1
- package/dist/schema/shop-config.js.map +0 -7
- package/dist/schema/shop-config.mjs.map +0 -7
- package/dist/schema/shopConfig.d.ts.map +0 -1
- package/dist/schema/smartCart.d.ts.map +0 -1
- package/dist/schema/user-config.js.map +0 -7
- package/dist/schema/user-config.mjs.map +0 -7
- package/dist/schema/userConfig.d.ts.map +0 -1
- package/dist/schema/widget-data.js.map +0 -7
- package/dist/schema/widget-data.mjs.map +0 -7
- package/dist/schema/widgetData.d.ts.map +0 -1
- package/dist/schema/widgets/abTestingPlaceholder.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/button.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/constants.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/dataSource.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/discount.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/giftLabels.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/icons.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/layout.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/monetize.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/offerLabels.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/product.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/products.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/regex.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/reviewLabels.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/rule.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/shared.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/switchLabels.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/text.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/uiLabels.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/utils.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/variants.d.ts.map +0 -1
- package/dist/schema/widgets/checkoutExtension.d.ts.map +0 -1
- package/dist/schema/widgets/contentBlock.d.ts.map +0 -1
- package/dist/schema/widgets/giftWithPurchase.d.ts.map +0 -1
- package/dist/schema/widgets/lineItemEditor.d.ts.map +0 -1
- package/dist/schema/widgets/post-purchase-offer/common.d.ts.map +0 -1
- package/dist/schema/widgets/post-purchase-offer/constants.d.ts.map +0 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseBlocks.d.ts.map +0 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseOffer.d.ts.map +0 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseSettings.d.ts.map +0 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseWidget.d.ts.map +0 -1
- package/dist/schema/widgets/progressBar.d.ts.map +0 -1
- package/dist/schema/widgets/rebuyButton.d.ts.map +0 -1
- package/dist/schema/widgets/rebuyMonetize.d.ts.map +0 -1
- package/dist/server/adsEngine.d.ts.map +0 -1
- package/dist/server/analytics.d.ts.map +0 -1
- package/dist/server/b2bAvailability.d.ts.map +0 -1
- package/dist/server/composeOffer.d.ts.map +0 -1
- package/dist/server/dataSourceResults.d.ts.map +0 -1
- package/dist/server/giftValidation.d.ts.map +0 -1
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/index.js.map +0 -7
- package/dist/server/index.mjs.map +0 -7
- package/dist/server/monetizeOffers.d.ts.map +0 -1
- package/dist/server/requestSchemas.d.ts.map +0 -1
- package/dist/server/salvageSections.d.ts.map +0 -1
- package/dist/server/shared.d.ts.map +0 -1
- package/dist/server/userConfig.d.ts.map +0 -1
- package/dist/server/widgetSettings.d.ts.map +0 -1
- package/dist/session.d.ts.map +0 -1
- package/dist/transforms/contentBlockV1/convertContentBlockImageToV2.d.ts.map +0 -1
- package/dist/transforms/contentBlockV1/convertContentBlockTextToV2.d.ts.map +0 -1
- package/dist/transforms/contentBlockV1/convertContentBlockToV2.d.ts.map +0 -1
- package/dist/transforms/contentBlockV1/convertTextToTiptapParagraph.d.ts.map +0 -1
- package/dist/transforms/contentBlockV1/stripContentBlockHtml.d.ts.map +0 -1
- package/dist/transforms/contentBlockV1/types.d.ts.map +0 -1
- package/dist/transforms/convertNumericObjects.d.ts.map +0 -1
- package/dist/transforms/deepCamelCase.d.ts.map +0 -1
- package/dist/transforms/experiments/resolveExperiment.d.ts.map +0 -1
- package/dist/transforms/htmlToTiptap/buildDefaultTextStyleMark.d.ts.map +0 -1
- package/dist/transforms/htmlToTiptap/buildLinkMark.d.ts.map +0 -1
- package/dist/transforms/htmlToTiptap/closeTag.d.ts.map +0 -1
- package/dist/transforms/htmlToTiptap/constants.d.ts.map +0 -1
- package/dist/transforms/htmlToTiptap/decodeEntities.d.ts.map +0 -1
- package/dist/transforms/htmlToTiptap/flushParagraph.d.ts.map +0 -1
- package/dist/transforms/htmlToTiptap/htmlToTiptap.d.ts.map +0 -1
- package/dist/transforms/htmlToTiptap/isSkipping.d.ts.map +0 -1
- package/dist/transforms/htmlToTiptap/isValidHref.d.ts.map +0 -1
- package/dist/transforms/htmlToTiptap/makeDoc.d.ts.map +0 -1
- package/dist/transforms/htmlToTiptap/makeParagraph.d.ts.map +0 -1
- package/dist/transforms/htmlToTiptap/openTag.d.ts.map +0 -1
- package/dist/transforms/htmlToTiptap/parseAttribs.d.ts.map +0 -1
- package/dist/transforms/htmlToTiptap/pushText.d.ts.map +0 -1
- package/dist/transforms/htmlToTiptap/stripHtmlComments.d.ts.map +0 -1
- package/dist/transforms/htmlToTiptap/types.d.ts.map +0 -1
- package/dist/transforms/index.d.ts.map +0 -1
- package/dist/transforms/index.js.map +0 -7
- package/dist/transforms/index.mjs.map +0 -7
- package/dist/transforms/isCABRootSection.d.ts.map +0 -1
- package/dist/transforms/lineItemEditorV1/convertLineItemEditorToV2.d.ts.map +0 -1
- package/dist/transforms/lineItemEditorV1/types.d.ts.map +0 -1
- package/dist/transforms/localizedContent.d.ts.map +0 -1
- package/dist/transforms/monetizeV1/convertMonetizeToV2.d.ts.map +0 -1
- package/dist/transforms/monetizeV1/types.d.ts.map +0 -1
- package/dist/transforms/normalizeTextContent.d.ts.map +0 -1
- package/dist/transforms/normalizeTokens.d.ts.map +0 -1
- package/dist/transforms/offerV1/buildOfferTemplate.d.ts.map +0 -1
- package/dist/transforms/offerV1/convertOfferToV2.d.ts.map +0 -1
- package/dist/transforms/offerV1/offerCard.d.ts.map +0 -1
- package/dist/transforms/offerV1/offerTemplateSeed.d.ts.map +0 -1
- package/dist/transforms/offerV1/types.d.ts.map +0 -1
- package/dist/transforms/parseShielded.d.ts.map +0 -1
- package/dist/transforms/progressBarV1/convertProgressBarToV2.d.ts.map +0 -1
- package/dist/transforms/progressBarV1/types.d.ts.map +0 -1
- package/dist/transforms/reactBarChrome.d.ts.map +0 -1
- package/dist/transforms/smartCart/convertSmartCartProgressBarToV2.d.ts.map +0 -1
- package/dist/transforms/smartCart/extractSmartCartBars.d.ts.map +0 -1
- package/dist/utilities.d.ts.map +0 -1
- package/dist/utilities.js.map +0 -7
- package/dist/utilities.mjs.map +0 -7
package/README.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @rebuy/rebuy
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shared zod schemas, legacy→CAB widget transforms, and server orchestrators for Rebuy's Shopify consumers — the library `rebuy-api`, `admin-nextjs`, and `rebuy-shopify-extensions` all build on.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @rebuy/rebuy zod
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`zod ^4.4.3` is a **peer dependency**: consumers install their own copy so every package in a tree composes and `instanceof`-checks against ONE zod instance. Yarn v1 workspaces do not auto-install peers — declare zod explicitly there. `react-hook-form` is an **optional** peer, needed only by form-layer consumers that use the `SectionArrayPath`/`SectionPrefixPath` types against their own forms (type-only — nothing is bundled).
|
|
12
|
+
|
|
13
|
+
Node `^22.14.0 || ^24.10.0 || ^26.0.0` for development; the published artifacts are plain ES2020 (ESM `.mjs` + CJS `.cjs`).
|
|
14
|
+
|
|
15
|
+
## Entry points
|
|
16
|
+
|
|
17
|
+
| Subpath | Contents |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `@rebuy/rebuy` | Root barrel: schemas, client helpers, utilities |
|
|
20
|
+
| `@rebuy/rebuy/client` | `RebuyClient` API client |
|
|
21
|
+
| `@rebuy/rebuy/gwp` | Gift-with-purchase validation helpers |
|
|
22
|
+
| `@rebuy/rebuy/pricing` | Variant pricing/discount forecast (`priceVariant`, `currencyDecimals`) |
|
|
23
|
+
| `@rebuy/rebuy/routes` | `apiRoutes` + the `UPSTREAM_SUFFIXES` upstream-host allowlist |
|
|
24
|
+
| `@rebuy/rebuy/schema/checkout-and-beyond` | The CAB section-tree schema (`CABRootSection` et al.) |
|
|
25
|
+
| `@rebuy/rebuy/schema/checkout-and-beyond/constants` | CAB enums/constants (`SectionType`, `ButtonField`, …) |
|
|
26
|
+
| `@rebuy/rebuy/schema/shop-config` | `ShopConfig` schema |
|
|
27
|
+
| `@rebuy/rebuy/schema/user-config` | `UserConfig` schema |
|
|
28
|
+
| `@rebuy/rebuy/schema/widget-data` | `WidgetData` schema |
|
|
29
|
+
| `@rebuy/rebuy/server` | Server orchestrators for rebuy-api's `/cab/*` routes (settings→tree conversion, data sources, gifts, analytics) + request schemas |
|
|
30
|
+
| `@rebuy/rebuy/transforms` | Legacy v1 widget → CAB tree converters |
|
|
31
|
+
| `@rebuy/rebuy/utilities` | Misc utilities (`getIdFromGraphUrl`, `stripHtml`, `uuid`, …) |
|
|
32
|
+
|
|
33
|
+
Every type derives from a zod schema via `z.infer` — defaults live in the schema (`.default()` at parse time), never in consumer render code.
|
|
34
|
+
|
|
35
|
+
## Development
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm run lint # eslint + prettier (a misformat is a lint error)
|
|
39
|
+
npm run test:coverage # vitest, 100% thresholds over the coverage allowlist
|
|
40
|
+
npm run check-types # tsc --noEmit
|
|
41
|
+
npm run build # types + esbuild bundles + check:dist smoke test
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
After any dependency change, regenerate the lockfile with the pinned npm 10 (`npm run lock && npm run lock:verify`) — never with npm 11. Versions are cut by semantic-release from ESLint-convention commits (`Fix:`, `Update:`, `New:`, `Breaking:`, …); never hand-bump `version`. See [AGENTS.md](./AGENTS.md) for the full contributor contract.
|
package/dist/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type Config = {
|
|
2
2
|
/**
|
|
3
|
-
* @deprecated
|
|
3
|
+
* @deprecated Use `staticDomain` (same host) — `cdnDomain` remains only for legacy callers and goes away in the next major.
|
|
4
4
|
*/
|
|
5
5
|
cdnDomain: string;
|
|
6
6
|
domain: string;
|
|
@@ -28,4 +28,3 @@ export declare class Api {
|
|
|
28
28
|
callApi(method: string, path: string, data: RequestData, options?: FetchOptions): Promise<any>;
|
|
29
29
|
}
|
|
30
30
|
export default Api;
|
|
31
|
-
//# sourceMappingURL=api.d.ts.map
|
|
@@ -26,6 +26,7 @@ __export(client_exports, {
|
|
|
26
26
|
module.exports = __toCommonJS(client_exports);
|
|
27
27
|
|
|
28
28
|
// src/utilities.ts
|
|
29
|
+
var import_uuid = require("uuid");
|
|
29
30
|
function isBase64Encoded(str) {
|
|
30
31
|
const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
31
32
|
return base64Regex.test(str) ? true : false;
|
|
@@ -69,19 +70,7 @@ function firstAvailableVariant(product) {
|
|
|
69
70
|
return selectedVariant;
|
|
70
71
|
}
|
|
71
72
|
function uuid() {
|
|
72
|
-
|
|
73
|
-
let d2 = performance && performance.now && performance.now() * 1e3 || 0;
|
|
74
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
75
|
-
let r = Math.random() * 16;
|
|
76
|
-
if (d > 0) {
|
|
77
|
-
r = (d + r) % 16 | 0;
|
|
78
|
-
d = Math.floor(d / 16);
|
|
79
|
-
} else {
|
|
80
|
-
r = (d2 + r) % 16 | 0;
|
|
81
|
-
d2 = Math.floor(d2 / 16);
|
|
82
|
-
}
|
|
83
|
-
return (c === "x" ? r : r & 3 | 8).toString(16);
|
|
84
|
-
});
|
|
73
|
+
return (0, import_uuid.v4)();
|
|
85
74
|
}
|
|
86
75
|
function sessionId() {
|
|
87
76
|
const config2 = {
|
|
@@ -264,7 +253,7 @@ function serialize(obj) {
|
|
|
264
253
|
// src/api.ts
|
|
265
254
|
var staging = {
|
|
266
255
|
/**
|
|
267
|
-
* @deprecated
|
|
256
|
+
* @deprecated Use `staticDomain` (same host) — `cdnDomain` remains only for legacy callers and goes away in the next major.
|
|
268
257
|
*/
|
|
269
258
|
cdnDomain: "https://cdn.enigneyuber.com",
|
|
270
259
|
domain: "https://enigneyuber.com",
|
|
@@ -322,7 +311,7 @@ var Api = class {
|
|
|
322
311
|
constructor(options) {
|
|
323
312
|
this.config = {
|
|
324
313
|
/**
|
|
325
|
-
* @deprecated
|
|
314
|
+
* @deprecated Use `staticDomain` (same host) — `cdnDomain` remains only for legacy callers and goes away in the next major.
|
|
326
315
|
*/
|
|
327
316
|
cdnDomain: "https://cdn.rebuyengine.com",
|
|
328
317
|
domain: "https://rebuyengine.com",
|
|
@@ -718,4 +707,3 @@ var RebuyClient = class {
|
|
|
718
707
|
}
|
|
719
708
|
};
|
|
720
709
|
var client_default = RebuyClient;
|
|
721
|
-
//# sourceMappingURL=client.js.map
|
package/dist/client.d.ts
CHANGED
package/dist/client.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// src/utilities.ts
|
|
2
|
+
import { v4 as uuidv4 } from "uuid";
|
|
2
3
|
function isBase64Encoded(str) {
|
|
3
4
|
const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
4
5
|
return base64Regex.test(str) ? true : false;
|
|
@@ -42,19 +43,7 @@ function firstAvailableVariant(product) {
|
|
|
42
43
|
return selectedVariant;
|
|
43
44
|
}
|
|
44
45
|
function uuid() {
|
|
45
|
-
|
|
46
|
-
let d2 = performance && performance.now && performance.now() * 1e3 || 0;
|
|
47
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
48
|
-
let r = Math.random() * 16;
|
|
49
|
-
if (d > 0) {
|
|
50
|
-
r = (d + r) % 16 | 0;
|
|
51
|
-
d = Math.floor(d / 16);
|
|
52
|
-
} else {
|
|
53
|
-
r = (d2 + r) % 16 | 0;
|
|
54
|
-
d2 = Math.floor(d2 / 16);
|
|
55
|
-
}
|
|
56
|
-
return (c === "x" ? r : r & 3 | 8).toString(16);
|
|
57
|
-
});
|
|
46
|
+
return uuidv4();
|
|
58
47
|
}
|
|
59
48
|
function sessionId() {
|
|
60
49
|
const config2 = {
|
|
@@ -237,7 +226,7 @@ function serialize(obj) {
|
|
|
237
226
|
// src/api.ts
|
|
238
227
|
var staging = {
|
|
239
228
|
/**
|
|
240
|
-
* @deprecated
|
|
229
|
+
* @deprecated Use `staticDomain` (same host) — `cdnDomain` remains only for legacy callers and goes away in the next major.
|
|
241
230
|
*/
|
|
242
231
|
cdnDomain: "https://cdn.enigneyuber.com",
|
|
243
232
|
domain: "https://enigneyuber.com",
|
|
@@ -295,7 +284,7 @@ var Api = class {
|
|
|
295
284
|
constructor(options) {
|
|
296
285
|
this.config = {
|
|
297
286
|
/**
|
|
298
|
-
* @deprecated
|
|
287
|
+
* @deprecated Use `staticDomain` (same host) — `cdnDomain` remains only for legacy callers and goes away in the next major.
|
|
299
288
|
*/
|
|
300
289
|
cdnDomain: "https://cdn.rebuyengine.com",
|
|
301
290
|
domain: "https://rebuyengine.com",
|
|
@@ -695,4 +684,3 @@ export {
|
|
|
695
684
|
RebuyClient,
|
|
696
685
|
client_default as default
|
|
697
686
|
};
|
|
698
|
-
//# sourceMappingURL=client.mjs.map
|
package/dist/cookie.d.ts
CHANGED
package/dist/geolocation.d.ts
CHANGED
|
@@ -4,4 +4,3 @@ import { type GwpMetadata } from '../gwp/types';
|
|
|
4
4
|
* qualification can't be trusted, so keep it (never remove on uncertainty).
|
|
5
5
|
*/
|
|
6
6
|
export declare const hasUnsupportedRuleTypes: (metadata?: GwpMetadata | null) => boolean;
|
|
7
|
-
//# sourceMappingURL=hasUnsupportedRuleTypes.d.ts.map
|
|
@@ -46,4 +46,3 @@ var isDefinitiveRuleAnswer = (metadata) => metadata != null && (metadata.matched
|
|
|
46
46
|
// src/gwp/shouldRemoveGift.ts
|
|
47
47
|
var hasLostDiscount = (gift) => !gift.discounted && gift.cost > 0;
|
|
48
48
|
var shouldRemoveGift = (gift, validIds) => !validIds.has(gift.productId) || hasLostDiscount(gift);
|
|
49
|
-
//# sourceMappingURL=index.js.map
|
package/dist/gwp/index.d.ts
CHANGED
package/dist/gwp/index.mjs
CHANGED
|
@@ -7,4 +7,3 @@ import { type GwpMetadata } from '../gwp/types';
|
|
|
7
7
|
* `unmatchedRules` IS definitive — the engine answered and nothing qualifies.
|
|
8
8
|
*/
|
|
9
9
|
export declare const isDefinitiveRuleAnswer: (metadata?: GwpMetadata | null) => metadata is GwpMetadata;
|
|
10
|
-
//# sourceMappingURL=isDefinitiveRuleAnswer.d.ts.map
|
|
@@ -12,4 +12,3 @@ export declare const hasLostDiscount: (gift: Pick<GwpGift, "cost" | "discounted"
|
|
|
12
12
|
* discount, so the client must — the complete removal receipt (see rebuy-discount-architecture / GWP E2).
|
|
13
13
|
*/
|
|
14
14
|
export declare const shouldRemoveGift: (gift: Pick<GwpGift, "cost" | "discounted" | "productId">, validIds: Set<number>) => boolean;
|
|
15
|
-
//# sourceMappingURL=shouldRemoveGift.d.ts.map
|
package/dist/gwp/types.d.ts
CHANGED
package/dist/identity.d.ts
CHANGED