@rebuy/rebuy 3.62.1 → 3.62.2

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.
@@ -6213,10 +6213,22 @@ var findMonetizeMarker = (section) => {
6213
6213
  }
6214
6214
  return void 0;
6215
6215
  };
6216
+ var HYDRATION_LEGS = {
6217
+ "/api/v1/offers": "ads-offers",
6218
+ "/api/v1/user/config": "user-config"
6219
+ };
6216
6220
  var hydrateMonetizeMarkers = async (converted, input, ctx, config) => {
6217
6221
  if (!input.monetize || !isCABTree(converted)) return;
6218
6222
  const first = findMonetizeMarker(converted);
6219
6223
  if (!first) return;
6224
+ let leg = "none";
6225
+ const tracked = {
6226
+ ...ctx,
6227
+ fetchUpstream: (path, ...rest) => {
6228
+ leg = HYDRATION_LEGS[path];
6229
+ return ctx.fetchUpstream(path, ...rest);
6230
+ }
6231
+ };
6220
6232
  try {
6221
6233
  const { ads, offers } = await fetchMonetizeOffers(
6222
6234
  {
@@ -6225,14 +6237,15 @@ var hydrateMonetizeMarkers = async (converted, input, ctx, config) => {
6225
6237
  shop: input.shop,
6226
6238
  visitorId: input.monetize.visitorId || input.visitorId
6227
6239
  },
6228
- ctx,
6240
+ tracked,
6229
6241
  config ?? void 0
6230
6242
  );
6231
6243
  first.offers = offers;
6232
6244
  if (ads) first.ads = ads;
6233
6245
  } catch (err) {
6246
+ const message = err instanceof Error ? err.message : String(err);
6234
6247
  ctx.reportDrift?.({
6235
- detail: `inline hydration failed: ${err instanceof Error ? err.message : String(err)}`,
6248
+ detail: `inline hydration failed (${String(leg)}): ${message}`,
6236
6249
  kind: "monetizeOffer"
6237
6250
  });
6238
6251
  }
@@ -6140,10 +6140,22 @@ var findMonetizeMarker = (section) => {
6140
6140
  }
6141
6141
  return void 0;
6142
6142
  };
6143
+ var HYDRATION_LEGS = {
6144
+ "/api/v1/offers": "ads-offers",
6145
+ "/api/v1/user/config": "user-config"
6146
+ };
6143
6147
  var hydrateMonetizeMarkers = async (converted, input, ctx, config) => {
6144
6148
  if (!input.monetize || !isCABTree(converted)) return;
6145
6149
  const first = findMonetizeMarker(converted);
6146
6150
  if (!first) return;
6151
+ let leg = "none";
6152
+ const tracked = {
6153
+ ...ctx,
6154
+ fetchUpstream: (path, ...rest) => {
6155
+ leg = HYDRATION_LEGS[path];
6156
+ return ctx.fetchUpstream(path, ...rest);
6157
+ }
6158
+ };
6147
6159
  try {
6148
6160
  const { ads, offers } = await fetchMonetizeOffers(
6149
6161
  {
@@ -6152,14 +6164,15 @@ var hydrateMonetizeMarkers = async (converted, input, ctx, config) => {
6152
6164
  shop: input.shop,
6153
6165
  visitorId: input.monetize.visitorId || input.visitorId
6154
6166
  },
6155
- ctx,
6167
+ tracked,
6156
6168
  config ?? void 0
6157
6169
  );
6158
6170
  first.offers = offers;
6159
6171
  if (ads) first.ads = ads;
6160
6172
  } catch (err) {
6173
+ const message = err instanceof Error ? err.message : String(err);
6161
6174
  ctx.reportDrift?.({
6162
- detail: `inline hydration failed: ${err instanceof Error ? err.message : String(err)}`,
6175
+ detail: `inline hydration failed (${String(leg)}): ${message}`,
6163
6176
  kind: "monetizeOffer"
6164
6177
  });
6165
6178
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebuy/rebuy",
3
- "version": "3.62.1",
3
+ "version": "3.62.2",
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.",