@rebuy/rebuy 3.37.0 → 3.38.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.
@@ -19,6 +19,7 @@ export declare const AdsEngineOffer: z.ZodObject<{
19
19
  id: z.ZodString;
20
20
  image_alt: z.ZodCatch<z.ZodString>;
21
21
  image_url: z.ZodOptional<z.ZodString>;
22
+ privacy_url: z.ZodCatch<z.ZodOptional<z.ZodString>>;
22
23
  view_url: z.ZodString;
23
24
  }, z.core.$strip>;
24
25
  export type AdsEngineOffer = z.infer<typeof AdsEngineOffer>;
@@ -4929,6 +4929,8 @@ var AdsEngineOffer = import_zod37.z.object({
4929
4929
  /** Advertiser-supplied image alt; the composed card falls back to the stripped headline when empty. */
4930
4930
  image_alt: import_zod37.z.string().catch(""),
4931
4931
  image_url: import_zod37.z.string().optional(),
4932
+ /** The serving network's own privacy page (Falcon, REB-24744); the card prefers it over the widget setting. A bad value drops only this field, never the offer. */
4933
+ privacy_url: import_zod37.z.string().optional().catch(void 0),
4932
4934
  view_url: import_zod37.z.string()
4933
4935
  });
4934
4936
  var AdsEngineResponse = import_zod37.z.object({
@@ -5098,6 +5100,10 @@ var headerSections = (input, storeName) => [
5098
5100
  },
5099
5101
  text(input.orderName ? `Order ${input.orderName} Confirmed` : "Order Confirmed")
5100
5102
  ];
5103
+ var privacyHref = (offer, input) => {
5104
+ const href = [offer.privacy_url, input.privacyPolicyUrl].find((url) => url && isValidHref(url));
5105
+ return href ? { href } : {};
5106
+ };
5101
5107
  var SHOW_EXTENDED = "showExtendedDisclaimer";
5102
5108
  var LEGAL_STYLE = { defaultTextStyle: { color: TextColorName.subdued, fontSize: "extraSmall" } };
5103
5109
  var legalCopy = (raw, visibleWhen) => ({
@@ -5197,9 +5203,11 @@ var composeOfferCard = (offer, input, storeName) => {
5197
5203
  * rejection here would silently drop the whole batch), and `isValidHref` also blocks the
5198
5204
  * `javascript:`-style schemes that `z.url()` alone would let through. It accepts strictly less
5199
5205
  * than the TiptapText href union (same token/root-relative regexes + a scheme allowlist), so a
5200
- * gated href can never fail the parse.
5206
+ * gated href can never fail the parse. A network-supplied `privacy_url` (REB-24744) goes through
5207
+ * the same gate but only counts toward showing the footer when it passes: an unsafe network URL
5208
+ * must never add a link-less "Privacy Policy" to a card that had no footer before.
5201
5209
  */
5202
- ...input.privacyPolicyUrl ? [
5210
+ ...offer.privacy_url && isValidHref(offer.privacy_url) || input.privacyPolicyUrl ? [
5203
5211
  {
5204
5212
  alignment: { horizontal: HorizontalAlignment.end, vertical: VerticalAlignment.top },
5205
5213
  sections: [
@@ -5207,7 +5215,7 @@ var composeOfferCard = (offer, input, storeName) => {
5207
5215
  align: "end",
5208
5216
  color: TextColorName.subdued,
5209
5217
  fontSize: "extraSmall",
5210
- ...isValidHref(input.privacyPolicyUrl) && { href: input.privacyPolicyUrl }
5218
+ ...privacyHref(offer, input)
5211
5219
  })
5212
5220
  ],
5213
5221
  sectionType: SectionType.layout
@@ -4859,6 +4859,8 @@ var AdsEngineOffer = z37.object({
4859
4859
  /** Advertiser-supplied image alt; the composed card falls back to the stripped headline when empty. */
4860
4860
  image_alt: z37.string().catch(""),
4861
4861
  image_url: z37.string().optional(),
4862
+ /** The serving network's own privacy page (Falcon, REB-24744); the card prefers it over the widget setting. A bad value drops only this field, never the offer. */
4863
+ privacy_url: z37.string().optional().catch(void 0),
4862
4864
  view_url: z37.string()
4863
4865
  });
4864
4866
  var AdsEngineResponse = z37.object({
@@ -5028,6 +5030,10 @@ var headerSections = (input, storeName) => [
5028
5030
  },
5029
5031
  text(input.orderName ? `Order ${input.orderName} Confirmed` : "Order Confirmed")
5030
5032
  ];
5033
+ var privacyHref = (offer, input) => {
5034
+ const href = [offer.privacy_url, input.privacyPolicyUrl].find((url) => url && isValidHref(url));
5035
+ return href ? { href } : {};
5036
+ };
5031
5037
  var SHOW_EXTENDED = "showExtendedDisclaimer";
5032
5038
  var LEGAL_STYLE = { defaultTextStyle: { color: TextColorName.subdued, fontSize: "extraSmall" } };
5033
5039
  var legalCopy = (raw, visibleWhen) => ({
@@ -5127,9 +5133,11 @@ var composeOfferCard = (offer, input, storeName) => {
5127
5133
  * rejection here would silently drop the whole batch), and `isValidHref` also blocks the
5128
5134
  * `javascript:`-style schemes that `z.url()` alone would let through. It accepts strictly less
5129
5135
  * than the TiptapText href union (same token/root-relative regexes + a scheme allowlist), so a
5130
- * gated href can never fail the parse.
5136
+ * gated href can never fail the parse. A network-supplied `privacy_url` (REB-24744) goes through
5137
+ * the same gate but only counts toward showing the footer when it passes: an unsafe network URL
5138
+ * must never add a link-less "Privacy Policy" to a card that had no footer before.
5131
5139
  */
5132
- ...input.privacyPolicyUrl ? [
5140
+ ...offer.privacy_url && isValidHref(offer.privacy_url) || input.privacyPolicyUrl ? [
5133
5141
  {
5134
5142
  alignment: { horizontal: HorizontalAlignment.end, vertical: VerticalAlignment.top },
5135
5143
  sections: [
@@ -5137,7 +5145,7 @@ var composeOfferCard = (offer, input, storeName) => {
5137
5145
  align: "end",
5138
5146
  color: TextColorName.subdued,
5139
5147
  fontSize: "extraSmall",
5140
- ...isValidHref(input.privacyPolicyUrl) && { href: input.privacyPolicyUrl }
5148
+ ...privacyHref(offer, input)
5141
5149
  })
5142
5150
  ],
5143
5151
  sectionType: SectionType.layout
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebuy/rebuy",
3
- "version": "3.37.0",
3
+ "version": "3.38.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.",