@rebuy/rebuy 3.26.0 → 3.28.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.
Files changed (51) hide show
  1. package/dist/index.cjs +902 -750
  2. package/dist/index.mjs +901 -749
  3. package/dist/schema/checkout-and-beyond/constants.cjs +5 -0
  4. package/dist/schema/checkout-and-beyond/constants.mjs +5 -0
  5. package/dist/schema/checkout-and-beyond/index.cjs +97 -68
  6. package/dist/schema/checkout-and-beyond/index.mjs +97 -68
  7. package/dist/schema/index.d.ts +6 -0
  8. package/dist/schema/postPurchaseEligibility.d.ts +2 -2
  9. package/dist/schema/postPurchaseExitPolicy.d.ts +20 -0
  10. package/dist/schema/postPurchaseIdentity.d.ts +9 -0
  11. package/dist/schema/postPurchaseOrderDecision.d.ts +10 -0
  12. package/dist/schema/postPurchasePolicy.d.ts +62 -0
  13. package/dist/schema/postPurchaseSelection.d.ts +29 -0
  14. package/dist/schema/postPurchaseSession.d.ts +112 -0
  15. package/dist/schema/postPurchaseSessionClose.d.ts +25 -0
  16. package/dist/schema/postPurchaseShadow.d.ts +56 -1
  17. package/dist/schema/postPurchaseSkipTrace.d.ts +2 -2
  18. package/dist/schema/widget-data.cjs +160 -135
  19. package/dist/schema/widget-data.mjs +160 -135
  20. package/dist/schema/widgetData.d.ts +24 -0
  21. package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +8 -0
  22. package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +8 -0
  23. package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +8 -0
  24. package/dist/schema/widgets/checkout-and-beyond/common.d.ts +13 -1
  25. package/dist/schema/widgets/checkout-and-beyond/index.d.ts +1 -0
  26. package/dist/schema/widgets/checkout-and-beyond/layout.d.ts +17 -1
  27. package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +8 -0
  28. package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +8 -0
  29. package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts +2 -0
  30. package/dist/schema/widgets/checkout-and-beyond/root.d.ts +8 -0
  31. package/dist/schema/widgets/checkout-and-beyond/separator.d.ts +192 -0
  32. package/dist/schema/widgets/checkout-and-beyond/shared.d.ts +2 -1
  33. package/dist/schema/widgets/contentBlock.d.ts +8 -0
  34. package/dist/schema/widgets/lineItemEditor.d.ts +8 -0
  35. package/dist/schema/widgets/post-purchase-offer/constants.d.ts +2 -2
  36. package/dist/schema/widgets/rebuyButton.d.ts +8 -0
  37. package/dist/server/index.cjs +601 -188
  38. package/dist/server/index.mjs +601 -188
  39. package/dist/server/requestSchemas.d.ts +1 -1
  40. package/dist/transforms/index.cjs +481 -59
  41. package/dist/transforms/index.d.ts +2 -0
  42. package/dist/transforms/index.mjs +481 -59
  43. package/dist/transforms/postPurchase/convertCalloutBlock.d.ts +8 -0
  44. package/dist/transforms/postPurchase/convertMessagePreview.d.ts +8 -0
  45. package/dist/transforms/postPurchase/convertPayButtonBlock.d.ts +4 -0
  46. package/dist/transforms/postPurchase/convertSeparatorBlock.d.ts +4 -0
  47. package/dist/transforms/postPurchase/convertTextBlock.d.ts +4 -0
  48. package/dist/transforms/postPurchase/convertTimerBlock.d.ts +4 -0
  49. package/dist/transforms/postPurchase/styledTextRun.d.ts +3 -0
  50. package/dist/transforms/postPurchase/types.d.ts +8 -0
  51. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ import { CABLayoutSection } from '../../schema/widgets/checkout-and-beyond/layout';
2
+ import { type Reporter } from '../../server/shared';
3
+ /**
4
+ * A legacy callout is a `layout` wearing the `callout` frame — passive offer framing, not a status banner, so
5
+ * it is not its own section type. Plain callouts apply block styles per field; mixed/rich callouts keep their
6
+ * authored documents verbatim.
7
+ */
8
+ export declare const convertCalloutBlock: (raw: unknown, report?: Reporter) => CABLayoutSection[];
@@ -0,0 +1,8 @@
1
+ import { CABRootSection } from '../../schema/widgets/checkout-and-beyond/root';
2
+ import { type Reporter } from '../../server/shared';
3
+ /**
4
+ * Converts a saved post-purchase widget's blocks into a CAB preview tree. Only the five converters this
5
+ * slice ships handle their block; every other block type — future (image/image_content/product_information)
6
+ * or truly unknown — reports and drops only itself, and an unreadable block (no `type`) does the same.
7
+ */
8
+ export declare const convertMessagePreview: (id: number, settings: unknown, report?: Reporter) => CABRootSection;
@@ -0,0 +1,4 @@
1
+ import { CABLayoutSection } from '../../schema/widgets/checkout-and-beyond/layout';
2
+ import type { Reporter } from '../../server/shared';
3
+ /** The frame carries an inert action slot; the sole card supplies its captured action and total. */
4
+ export declare const convertPayButtonBlock: (raw: unknown, report?: Reporter) => CABLayoutSection[];
@@ -0,0 +1,4 @@
1
+ import { CABSeparatorSection } from '../../schema/widgets/checkout-and-beyond/separator';
2
+ import { type Reporter } from '../../server/shared';
3
+ /** Passive visual separation; the legacy block carries no styling to preserve. */
4
+ export declare const convertSeparatorBlock: (raw: unknown, report?: Reporter) => CABSeparatorSection[];
@@ -0,0 +1,4 @@
1
+ import { CABLayoutSection } from '../../schema/widgets/checkout-and-beyond/layout';
2
+ import { type Reporter } from '../../server/shared';
3
+ /** Plain string fields get fixed role styling; a mixed/rich field keeps its authored document verbatim. */
4
+ export declare const convertTextBlock: (raw: unknown, report?: Reporter) => CABLayoutSection[];
@@ -0,0 +1,4 @@
1
+ import { CABBannerSection } from '../../schema/widgets/checkout-and-beyond/banner';
2
+ import { type Reporter } from '../../server/shared';
3
+ /** Timer settings describe a passive display; only the session (not this converter) owns duration and expiry. */
4
+ export declare const convertTimerBlock: (raw: unknown, report?: Reporter) => CABBannerSection[];
@@ -0,0 +1,3 @@
1
+ import { type TiptapText } from '../../schema/widgets/checkout-and-beyond/text';
2
+ /** A single styled Tiptap text run; the legacy size name maps onto CAB's inline size scale. */
3
+ export declare const styledTextRun: (text: string, emphasized: boolean, size: string) => TiptapText;
@@ -0,0 +1,8 @@
1
+ import { WidgetType } from '../../schema/widgets/checkout-and-beyond/constants';
2
+ /** A saved post-purchase message-block widget: `type` plus its ordered `blocks`, no `version` discriminator. */
3
+ export type V1PostPurchaseSettings = {
4
+ blocks: unknown[];
5
+ type: typeof WidgetType.shopify_post_purchase_extension;
6
+ };
7
+ /** Identifies a saved post-purchase widget by shape: the extension's `type` literal plus a `blocks` array. */
8
+ export declare const isPostPurchaseV1: (data: unknown) => data is V1PostPurchaseSettings;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebuy/rebuy",
3
- "version": "3.26.0",
3
+ "version": "3.28.0",
4
4
  "description": "Shared zod schemas, legacy-to-CAB widget transforms, and server orchestrators for Rebuy's Shopify consumers (rebuy-api, admin-nextjs, rebuy-shopify-extensions)",
5
5
  "license": "MIT",
6
6
  "author": "Rebuy, Inc.",