@rebuy/rebuy 2.36.0 → 3.0.0-rc.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.
Files changed (325) hide show
  1. package/README.md +43 -2
  2. package/dist/api.d.ts +1 -2
  3. package/dist/{client.js → client.cjs} +4 -16
  4. package/dist/client.d.ts +0 -1
  5. package/dist/client.mjs +4 -16
  6. package/dist/cookie.d.ts +0 -1
  7. package/dist/geolocation.d.ts +0 -1
  8. package/dist/gwp/getValidGwpProductIds.d.ts +0 -1
  9. package/dist/gwp/hasUnsupportedRuleTypes.d.ts +0 -1
  10. package/dist/gwp/{index.js → index.cjs} +0 -1
  11. package/dist/gwp/index.d.ts +0 -1
  12. package/dist/gwp/index.mjs +0 -1
  13. package/dist/gwp/isDefinitiveRuleAnswer.d.ts +0 -1
  14. package/dist/gwp/shouldRemoveGift.d.ts +0 -1
  15. package/dist/gwp/types.d.ts +0 -1
  16. package/dist/identity.d.ts +0 -1
  17. package/dist/{index.js → index.cjs} +207 -124
  18. package/dist/index.d.ts +0 -1
  19. package/dist/index.mjs +184 -101
  20. package/dist/pricing/amountToCents.d.ts +0 -1
  21. package/dist/pricing/computeCompareAtPrice.d.ts +0 -1
  22. package/dist/pricing/computeDisplayPrice.d.ts +0 -1
  23. package/dist/pricing/currencyDecimals.d.ts +0 -1
  24. package/dist/pricing/{index.js → index.cjs} +0 -1
  25. package/dist/pricing/index.d.ts +0 -1
  26. package/dist/pricing/index.mjs +0 -1
  27. package/dist/pricing/priceVariant.d.ts +0 -1
  28. package/dist/pricing/types.d.ts +4 -11
  29. package/dist/{routes.js → routes.cjs} +0 -1
  30. package/dist/routes.d.ts +0 -1
  31. package/dist/routes.mjs +0 -1
  32. package/dist/schema/cabShopConfig.d.ts +0 -1
  33. package/dist/schema/checkout-and-beyond/{constants.js → constants.cjs} +4 -1
  34. package/dist/schema/checkout-and-beyond/constants.mjs +4 -1
  35. package/dist/schema/checkout-and-beyond/{index.js → index.cjs} +68 -38
  36. package/dist/schema/checkout-and-beyond/index.mjs +67 -37
  37. package/dist/schema/index.d.ts +1 -1
  38. package/dist/schema/metadata.d.ts +0 -1
  39. package/dist/schema/offerProduct.d.ts +0 -1
  40. package/dist/schema/product.d.ts +0 -1
  41. package/dist/schema/{shop-config.js → shop-config.cjs} +0 -1
  42. package/dist/schema/shop-config.mjs +0 -1
  43. package/dist/schema/shopConfig.d.ts +0 -1
  44. package/dist/schema/smartCart.d.ts +0 -1
  45. package/dist/schema/{user-config.js → user-config.cjs} +0 -1
  46. package/dist/schema/user-config.mjs +0 -1
  47. package/dist/schema/userConfig.d.ts +0 -1
  48. package/dist/schema/{widget-data.js → widget-data.cjs} +33 -6
  49. package/dist/schema/widget-data.mjs +35 -8
  50. package/dist/schema/widgetData.d.ts +48 -25
  51. package/dist/schema/widgets/abTestingPlaceholder.d.ts +0 -1
  52. package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +0 -1
  53. package/dist/schema/widgets/checkout-and-beyond/button.d.ts +0 -1
  54. package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +6 -1
  55. package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +0 -1
  56. package/dist/schema/widgets/checkout-and-beyond/common.d.ts +11 -1
  57. package/dist/schema/widgets/checkout-and-beyond/constants.d.ts +0 -1
  58. package/dist/schema/widgets/checkout-and-beyond/dataSource.d.ts +0 -1
  59. package/dist/schema/widgets/checkout-and-beyond/discount.d.ts +0 -1
  60. package/dist/schema/widgets/checkout-and-beyond/giftLabels.d.ts +0 -1
  61. package/dist/schema/widgets/checkout-and-beyond/icons.d.ts +1 -2
  62. package/dist/schema/widgets/checkout-and-beyond/image.d.ts +2 -3
  63. package/dist/schema/widgets/checkout-and-beyond/index.d.ts +0 -1
  64. package/dist/schema/widgets/checkout-and-beyond/layout.d.ts +0 -1
  65. package/dist/schema/widgets/checkout-and-beyond/monetize.d.ts +0 -1
  66. package/dist/schema/widgets/checkout-and-beyond/offerLabels.d.ts +0 -1
  67. package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +0 -1
  68. package/dist/schema/widgets/checkout-and-beyond/product.d.ts +0 -1
  69. package/dist/schema/widgets/checkout-and-beyond/products.d.ts +0 -1
  70. package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +0 -1
  71. package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts +0 -1
  72. package/dist/schema/widgets/checkout-and-beyond/regex.d.ts +0 -1
  73. package/dist/schema/widgets/checkout-and-beyond/reviewLabels.d.ts +0 -1
  74. package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts +0 -1
  75. package/dist/schema/widgets/checkout-and-beyond/root.d.ts +44 -16
  76. package/dist/schema/widgets/checkout-and-beyond/rule.d.ts +0 -1
  77. package/dist/schema/widgets/checkout-and-beyond/shared.d.ts +10 -1
  78. package/dist/schema/widgets/checkout-and-beyond/switchLabels.d.ts +0 -1
  79. package/dist/schema/widgets/checkout-and-beyond/text.d.ts +0 -1
  80. package/dist/schema/widgets/checkout-and-beyond/uiLabels.d.ts +0 -1
  81. package/dist/schema/widgets/checkout-and-beyond/utils.d.ts +1 -2
  82. package/dist/schema/widgets/checkout-and-beyond/variants.d.ts +0 -1
  83. package/dist/schema/widgets/checkoutExtension.d.ts +0 -1
  84. package/dist/schema/widgets/contentBlock.d.ts +16 -9
  85. package/dist/schema/widgets/giftWithPurchase.d.ts +0 -1
  86. package/dist/schema/widgets/lineItemEditor.d.ts +16 -9
  87. package/dist/schema/widgets/post-purchase-offer/common.d.ts +0 -1
  88. package/dist/schema/widgets/post-purchase-offer/constants.d.ts +0 -1
  89. package/dist/schema/widgets/post-purchase-offer/postPurchaseBlocks.d.ts +0 -1
  90. package/dist/schema/widgets/post-purchase-offer/postPurchaseOffer.d.ts +0 -1
  91. package/dist/schema/widgets/post-purchase-offer/postPurchaseSettings.d.ts +0 -1
  92. package/dist/schema/widgets/post-purchase-offer/postPurchaseWidget.d.ts +0 -1
  93. package/dist/schema/widgets/progressBar.d.ts +0 -1
  94. package/dist/schema/widgets/rebuyButton.d.ts +16 -9
  95. package/dist/schema/widgets/rebuyMonetize.d.ts +0 -1
  96. package/dist/server/adsEngine.d.ts +0 -1
  97. package/dist/server/analytics.d.ts +0 -1
  98. package/dist/server/b2bAvailability.d.ts +0 -1
  99. package/dist/server/composeOffer.d.ts +0 -1
  100. package/dist/server/dataSourceResults.d.ts +0 -1
  101. package/dist/server/giftValidation.d.ts +0 -1
  102. package/dist/server/{index.js → index.cjs} +236 -189
  103. package/dist/server/index.d.ts +6 -5
  104. package/dist/server/index.mjs +232 -185
  105. package/dist/server/monetizeOffers.d.ts +0 -1
  106. package/dist/server/requestSchemas.d.ts +0 -1
  107. package/dist/server/salvageSections.d.ts +1 -11
  108. package/dist/server/shared.d.ts +6 -1
  109. package/dist/server/userConfig.d.ts +0 -1
  110. package/dist/server/widgetSettings.d.ts +0 -1
  111. package/dist/session.d.ts +0 -1
  112. package/dist/transforms/contentBlockV1/convertContentBlockImageToV2.d.ts +0 -1
  113. package/dist/transforms/contentBlockV1/convertContentBlockTextToV2.d.ts +0 -1
  114. package/dist/transforms/contentBlockV1/convertContentBlockToV2.d.ts +0 -1
  115. package/dist/transforms/contentBlockV1/convertTextToTiptapParagraph.d.ts +0 -1
  116. package/dist/transforms/contentBlockV1/stripContentBlockHtml.d.ts +0 -1
  117. package/dist/transforms/contentBlockV1/types.d.ts +3 -8
  118. package/dist/transforms/convertNumericObjects.d.ts +7 -1
  119. package/dist/transforms/deepCamelCase.d.ts +0 -1
  120. package/dist/transforms/experiments/resolveExperiment.d.ts +0 -1
  121. package/dist/transforms/htmlToTiptap/buildDefaultTextStyleMark.d.ts +0 -1
  122. package/dist/transforms/htmlToTiptap/buildLinkMark.d.ts +0 -1
  123. package/dist/transforms/htmlToTiptap/closeTag.d.ts +0 -1
  124. package/dist/transforms/htmlToTiptap/constants.d.ts +0 -1
  125. package/dist/transforms/htmlToTiptap/decodeEntities.d.ts +0 -1
  126. package/dist/transforms/htmlToTiptap/flushParagraph.d.ts +0 -1
  127. package/dist/transforms/htmlToTiptap/htmlToTiptap.d.ts +0 -1
  128. package/dist/transforms/htmlToTiptap/isSkipping.d.ts +0 -1
  129. package/dist/transforms/htmlToTiptap/isValidHref.d.ts +0 -1
  130. package/dist/transforms/htmlToTiptap/makeDoc.d.ts +0 -1
  131. package/dist/transforms/htmlToTiptap/makeParagraph.d.ts +0 -1
  132. package/dist/transforms/htmlToTiptap/openTag.d.ts +0 -1
  133. package/dist/transforms/htmlToTiptap/parseAttribs.d.ts +0 -1
  134. package/dist/transforms/htmlToTiptap/pushText.d.ts +0 -1
  135. package/dist/transforms/htmlToTiptap/stripHtmlComments.d.ts +0 -1
  136. package/dist/transforms/htmlToTiptap/types.d.ts +0 -1
  137. package/dist/transforms/{index.js → index.cjs} +203 -156
  138. package/dist/transforms/index.d.ts +0 -1
  139. package/dist/transforms/index.mjs +201 -154
  140. package/dist/transforms/isCABRootSection.d.ts +0 -1
  141. package/dist/transforms/isWidgetV1.d.ts +10 -0
  142. package/dist/transforms/lineItemEditorV1/convertLineItemEditorToV2.d.ts +0 -1
  143. package/dist/transforms/lineItemEditorV1/types.d.ts +24 -3
  144. package/dist/transforms/localizedContent.d.ts +0 -1
  145. package/dist/transforms/monetizeV1/convertMonetizeToV2.d.ts +0 -1
  146. package/dist/transforms/monetizeV1/types.d.ts +15 -3
  147. package/dist/transforms/normalizeTextContent.d.ts +0 -1
  148. package/dist/transforms/normalizeTokens.d.ts +0 -1
  149. package/dist/transforms/offerV1/buildOfferTemplate.d.ts +2 -2
  150. package/dist/transforms/offerV1/convertOfferToV2.d.ts +0 -1
  151. package/dist/transforms/offerV1/offerCard.d.ts +2 -1
  152. package/dist/transforms/offerV1/offerTemplateSeed.d.ts +0 -1
  153. package/dist/transforms/offerV1/types.d.ts +16 -10
  154. package/dist/transforms/parseShielded.d.ts +0 -1
  155. package/dist/transforms/presentmentThresholds.d.ts +13 -0
  156. package/dist/transforms/progressBarV1/convertProgressBarToV2.d.ts +0 -1
  157. package/dist/transforms/progressBarV1/types.d.ts +2 -2
  158. package/dist/transforms/reactBarChrome.d.ts +0 -1
  159. package/dist/transforms/smartCart/convertSmartCartProgressBarToV2.d.ts +0 -1
  160. package/dist/transforms/smartCart/extractSmartCartBars.d.ts +0 -1
  161. package/dist/transforms/v1Location.d.ts +11 -0
  162. package/dist/{utilities.js → utilities.cjs} +2 -14
  163. package/dist/utilities.d.ts +5 -2
  164. package/dist/utilities.mjs +2 -14
  165. package/package.json +89 -40
  166. package/dist/api.d.ts.map +0 -1
  167. package/dist/client.d.ts.map +0 -1
  168. package/dist/client.js.map +0 -7
  169. package/dist/client.mjs.map +0 -7
  170. package/dist/cookie.d.ts.map +0 -1
  171. package/dist/geolocation.d.ts.map +0 -1
  172. package/dist/gwp/getValidGwpProductIds.d.ts.map +0 -1
  173. package/dist/gwp/hasUnsupportedRuleTypes.d.ts.map +0 -1
  174. package/dist/gwp/index.d.ts.map +0 -1
  175. package/dist/gwp/index.js.map +0 -7
  176. package/dist/gwp/index.mjs.map +0 -7
  177. package/dist/gwp/isDefinitiveRuleAnswer.d.ts.map +0 -1
  178. package/dist/gwp/shouldRemoveGift.d.ts.map +0 -1
  179. package/dist/gwp/types.d.ts.map +0 -1
  180. package/dist/identity.d.ts.map +0 -1
  181. package/dist/index.d.ts.map +0 -1
  182. package/dist/index.js.map +0 -7
  183. package/dist/index.mjs.map +0 -7
  184. package/dist/pricing/amountToCents.d.ts.map +0 -1
  185. package/dist/pricing/computeCompareAtPrice.d.ts.map +0 -1
  186. package/dist/pricing/computeDisplayPrice.d.ts.map +0 -1
  187. package/dist/pricing/currencyDecimals.d.ts.map +0 -1
  188. package/dist/pricing/index.d.ts.map +0 -1
  189. package/dist/pricing/index.js.map +0 -7
  190. package/dist/pricing/index.mjs.map +0 -7
  191. package/dist/pricing/priceVariant.d.ts.map +0 -1
  192. package/dist/pricing/types.d.ts.map +0 -1
  193. package/dist/routes.d.ts.map +0 -1
  194. package/dist/routes.js.map +0 -7
  195. package/dist/routes.mjs.map +0 -7
  196. package/dist/schema/cabShopConfig.d.ts.map +0 -1
  197. package/dist/schema/checkout-and-beyond/constants.js.map +0 -7
  198. package/dist/schema/checkout-and-beyond/constants.mjs.map +0 -7
  199. package/dist/schema/checkout-and-beyond/index.js.map +0 -7
  200. package/dist/schema/checkout-and-beyond/index.mjs.map +0 -7
  201. package/dist/schema/index.d.ts.map +0 -1
  202. package/dist/schema/metadata.d.ts.map +0 -1
  203. package/dist/schema/offerProduct.d.ts.map +0 -1
  204. package/dist/schema/product.d.ts.map +0 -1
  205. package/dist/schema/shop-config.js.map +0 -7
  206. package/dist/schema/shop-config.mjs.map +0 -7
  207. package/dist/schema/shopConfig.d.ts.map +0 -1
  208. package/dist/schema/smartCart.d.ts.map +0 -1
  209. package/dist/schema/user-config.js.map +0 -7
  210. package/dist/schema/user-config.mjs.map +0 -7
  211. package/dist/schema/userConfig.d.ts.map +0 -1
  212. package/dist/schema/widget-data.js.map +0 -7
  213. package/dist/schema/widget-data.mjs.map +0 -7
  214. package/dist/schema/widgetData.d.ts.map +0 -1
  215. package/dist/schema/widgets/abTestingPlaceholder.d.ts.map +0 -1
  216. package/dist/schema/widgets/checkout-and-beyond/banner.d.ts.map +0 -1
  217. package/dist/schema/widgets/checkout-and-beyond/button.d.ts.map +0 -1
  218. package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts.map +0 -1
  219. package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts.map +0 -1
  220. package/dist/schema/widgets/checkout-and-beyond/common.d.ts.map +0 -1
  221. package/dist/schema/widgets/checkout-and-beyond/constants.d.ts.map +0 -1
  222. package/dist/schema/widgets/checkout-and-beyond/dataSource.d.ts.map +0 -1
  223. package/dist/schema/widgets/checkout-and-beyond/discount.d.ts.map +0 -1
  224. package/dist/schema/widgets/checkout-and-beyond/giftLabels.d.ts.map +0 -1
  225. package/dist/schema/widgets/checkout-and-beyond/icons.d.ts.map +0 -1
  226. package/dist/schema/widgets/checkout-and-beyond/image.d.ts.map +0 -1
  227. package/dist/schema/widgets/checkout-and-beyond/index.d.ts.map +0 -1
  228. package/dist/schema/widgets/checkout-and-beyond/layout.d.ts.map +0 -1
  229. package/dist/schema/widgets/checkout-and-beyond/monetize.d.ts.map +0 -1
  230. package/dist/schema/widgets/checkout-and-beyond/offerLabels.d.ts.map +0 -1
  231. package/dist/schema/widgets/checkout-and-beyond/offers.d.ts.map +0 -1
  232. package/dist/schema/widgets/checkout-and-beyond/product.d.ts.map +0 -1
  233. package/dist/schema/widgets/checkout-and-beyond/products.d.ts.map +0 -1
  234. package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts.map +0 -1
  235. package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts.map +0 -1
  236. package/dist/schema/widgets/checkout-and-beyond/regex.d.ts.map +0 -1
  237. package/dist/schema/widgets/checkout-and-beyond/reviewLabels.d.ts.map +0 -1
  238. package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts.map +0 -1
  239. package/dist/schema/widgets/checkout-and-beyond/root.d.ts.map +0 -1
  240. package/dist/schema/widgets/checkout-and-beyond/rule.d.ts.map +0 -1
  241. package/dist/schema/widgets/checkout-and-beyond/shared.d.ts.map +0 -1
  242. package/dist/schema/widgets/checkout-and-beyond/switchLabels.d.ts.map +0 -1
  243. package/dist/schema/widgets/checkout-and-beyond/text.d.ts.map +0 -1
  244. package/dist/schema/widgets/checkout-and-beyond/uiLabels.d.ts.map +0 -1
  245. package/dist/schema/widgets/checkout-and-beyond/utils.d.ts.map +0 -1
  246. package/dist/schema/widgets/checkout-and-beyond/variants.d.ts.map +0 -1
  247. package/dist/schema/widgets/checkoutExtension.d.ts.map +0 -1
  248. package/dist/schema/widgets/contentBlock.d.ts.map +0 -1
  249. package/dist/schema/widgets/giftWithPurchase.d.ts.map +0 -1
  250. package/dist/schema/widgets/lineItemEditor.d.ts.map +0 -1
  251. package/dist/schema/widgets/post-purchase-offer/common.d.ts.map +0 -1
  252. package/dist/schema/widgets/post-purchase-offer/constants.d.ts.map +0 -1
  253. package/dist/schema/widgets/post-purchase-offer/postPurchaseBlocks.d.ts.map +0 -1
  254. package/dist/schema/widgets/post-purchase-offer/postPurchaseOffer.d.ts.map +0 -1
  255. package/dist/schema/widgets/post-purchase-offer/postPurchaseSettings.d.ts.map +0 -1
  256. package/dist/schema/widgets/post-purchase-offer/postPurchaseWidget.d.ts.map +0 -1
  257. package/dist/schema/widgets/progressBar.d.ts.map +0 -1
  258. package/dist/schema/widgets/rebuyButton.d.ts.map +0 -1
  259. package/dist/schema/widgets/rebuyMonetize.d.ts.map +0 -1
  260. package/dist/server/adsEngine.d.ts.map +0 -1
  261. package/dist/server/analytics.d.ts.map +0 -1
  262. package/dist/server/b2bAvailability.d.ts.map +0 -1
  263. package/dist/server/composeOffer.d.ts.map +0 -1
  264. package/dist/server/dataSourceResults.d.ts.map +0 -1
  265. package/dist/server/giftValidation.d.ts.map +0 -1
  266. package/dist/server/index.d.ts.map +0 -1
  267. package/dist/server/index.js.map +0 -7
  268. package/dist/server/index.mjs.map +0 -7
  269. package/dist/server/monetizeOffers.d.ts.map +0 -1
  270. package/dist/server/requestSchemas.d.ts.map +0 -1
  271. package/dist/server/salvageSections.d.ts.map +0 -1
  272. package/dist/server/shared.d.ts.map +0 -1
  273. package/dist/server/userConfig.d.ts.map +0 -1
  274. package/dist/server/widgetSettings.d.ts.map +0 -1
  275. package/dist/session.d.ts.map +0 -1
  276. package/dist/transforms/contentBlockV1/convertContentBlockImageToV2.d.ts.map +0 -1
  277. package/dist/transforms/contentBlockV1/convertContentBlockTextToV2.d.ts.map +0 -1
  278. package/dist/transforms/contentBlockV1/convertContentBlockToV2.d.ts.map +0 -1
  279. package/dist/transforms/contentBlockV1/convertTextToTiptapParagraph.d.ts.map +0 -1
  280. package/dist/transforms/contentBlockV1/stripContentBlockHtml.d.ts.map +0 -1
  281. package/dist/transforms/contentBlockV1/types.d.ts.map +0 -1
  282. package/dist/transforms/convertNumericObjects.d.ts.map +0 -1
  283. package/dist/transforms/deepCamelCase.d.ts.map +0 -1
  284. package/dist/transforms/experiments/resolveExperiment.d.ts.map +0 -1
  285. package/dist/transforms/htmlToTiptap/buildDefaultTextStyleMark.d.ts.map +0 -1
  286. package/dist/transforms/htmlToTiptap/buildLinkMark.d.ts.map +0 -1
  287. package/dist/transforms/htmlToTiptap/closeTag.d.ts.map +0 -1
  288. package/dist/transforms/htmlToTiptap/constants.d.ts.map +0 -1
  289. package/dist/transforms/htmlToTiptap/decodeEntities.d.ts.map +0 -1
  290. package/dist/transforms/htmlToTiptap/flushParagraph.d.ts.map +0 -1
  291. package/dist/transforms/htmlToTiptap/htmlToTiptap.d.ts.map +0 -1
  292. package/dist/transforms/htmlToTiptap/isSkipping.d.ts.map +0 -1
  293. package/dist/transforms/htmlToTiptap/isValidHref.d.ts.map +0 -1
  294. package/dist/transforms/htmlToTiptap/makeDoc.d.ts.map +0 -1
  295. package/dist/transforms/htmlToTiptap/makeParagraph.d.ts.map +0 -1
  296. package/dist/transforms/htmlToTiptap/openTag.d.ts.map +0 -1
  297. package/dist/transforms/htmlToTiptap/parseAttribs.d.ts.map +0 -1
  298. package/dist/transforms/htmlToTiptap/pushText.d.ts.map +0 -1
  299. package/dist/transforms/htmlToTiptap/stripHtmlComments.d.ts.map +0 -1
  300. package/dist/transforms/htmlToTiptap/types.d.ts.map +0 -1
  301. package/dist/transforms/index.d.ts.map +0 -1
  302. package/dist/transforms/index.js.map +0 -7
  303. package/dist/transforms/index.mjs.map +0 -7
  304. package/dist/transforms/isCABRootSection.d.ts.map +0 -1
  305. package/dist/transforms/lineItemEditorV1/convertLineItemEditorToV2.d.ts.map +0 -1
  306. package/dist/transforms/lineItemEditorV1/types.d.ts.map +0 -1
  307. package/dist/transforms/localizedContent.d.ts.map +0 -1
  308. package/dist/transforms/monetizeV1/convertMonetizeToV2.d.ts.map +0 -1
  309. package/dist/transforms/monetizeV1/types.d.ts.map +0 -1
  310. package/dist/transforms/normalizeTextContent.d.ts.map +0 -1
  311. package/dist/transforms/normalizeTokens.d.ts.map +0 -1
  312. package/dist/transforms/offerV1/buildOfferTemplate.d.ts.map +0 -1
  313. package/dist/transforms/offerV1/convertOfferToV2.d.ts.map +0 -1
  314. package/dist/transforms/offerV1/offerCard.d.ts.map +0 -1
  315. package/dist/transforms/offerV1/offerTemplateSeed.d.ts.map +0 -1
  316. package/dist/transforms/offerV1/types.d.ts.map +0 -1
  317. package/dist/transforms/parseShielded.d.ts.map +0 -1
  318. package/dist/transforms/progressBarV1/convertProgressBarToV2.d.ts.map +0 -1
  319. package/dist/transforms/progressBarV1/types.d.ts.map +0 -1
  320. package/dist/transforms/reactBarChrome.d.ts.map +0 -1
  321. package/dist/transforms/smartCart/convertSmartCartProgressBarToV2.d.ts.map +0 -1
  322. package/dist/transforms/smartCart/extractSmartCartBars.d.ts.map +0 -1
  323. package/dist/utilities.d.ts.map +0 -1
  324. package/dist/utilities.js.map +0 -7
  325. package/dist/utilities.mjs.map +0 -7
package/README.md CHANGED
@@ -1,3 +1,44 @@
1
- # Rebuy
1
+ # @rebuy/rebuy
2
2
 
3
- Rebuy base package containing reusable API client, functions, and other common utilities. Initially developed for [@rebuy/rebuy-hydrogen](https://www.npmjs.com/package/@rebuy/rebuy-hydrogen).
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
- let d = (/* @__PURE__ */ new Date()).getTime();
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
@@ -11,4 +11,3 @@ export declare class RebuyClient {
11
11
  trackProductViewed(data: Record<string, any>): Promise<any>;
12
12
  }
13
13
  export default RebuyClient;
14
- //# sourceMappingURL=client.d.ts.map
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
- let d = (/* @__PURE__ */ new Date()).getTime();
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
@@ -54,4 +54,3 @@ declare const _default: {
54
54
  set: typeof set;
55
55
  };
56
56
  export default _default;
57
- //# sourceMappingURL=cookie.d.ts.map
@@ -5,4 +5,3 @@ export declare class Geolocation {
5
5
  geolocation(): Promise<any>;
6
6
  }
7
7
  export default Geolocation;
8
- //# sourceMappingURL=geolocation.d.ts.map
@@ -5,4 +5,3 @@ import { type MatchedRule } from '../gwp/types';
5
5
  * not in this set no longer qualifies and should be removed.
6
6
  */
7
7
  export declare const getValidGwpProductIds: (matchedRules?: MatchedRule[]) => Set<number>;
8
- //# sourceMappingURL=getValidGwpProductIds.d.ts.map
@@ -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
@@ -3,4 +3,3 @@ export * from '../gwp/hasUnsupportedRuleTypes';
3
3
  export * from '../gwp/isDefinitiveRuleAnswer';
4
4
  export * from '../gwp/shouldRemoveGift';
5
5
  export * from '../gwp/types';
6
- //# sourceMappingURL=index.d.ts.map
@@ -23,4 +23,3 @@ export {
23
23
  isDefinitiveRuleAnswer,
24
24
  shouldRemoveGift
25
25
  };
26
- //# sourceMappingURL=index.mjs.map
@@ -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
@@ -37,4 +37,3 @@ export type GwpMetadata = {
37
37
  matchedRules?: MatchedRule[];
38
38
  unmatchedRules?: MatchedRule[];
39
39
  };
40
- //# sourceMappingURL=types.d.ts.map
@@ -8,4 +8,3 @@ export declare class Identity {
8
8
  geolocation(): Promise<any>;
9
9
  }
10
10
  export default Identity;
11
- //# sourceMappingURL=identity.d.ts.map