@xenia-martech/sdk-js 1.2.0-dev.6 → 1.2.0-dev.8

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 (42) hide show
  1. package/README.md +2 -2
  2. package/dist/{actions-C18Kv-4w.d.cts → actions-35V37IT0.d.cts} +2 -1
  3. package/dist/{actions-C18Kv-4w.d.ts → actions-35V37IT0.d.ts} +2 -1
  4. package/dist/{chunk-OMMIRSPK.js → chunk-F3WZFXYK.js} +5 -3
  5. package/dist/chunk-F3WZFXYK.js.map +1 -0
  6. package/dist/{chunk-YLMMTKQL.cjs → chunk-IOY6IPUW.cjs} +5 -3
  7. package/dist/chunk-IOY6IPUW.cjs.map +1 -0
  8. package/dist/client/index.d.cts +4 -3
  9. package/dist/client/index.d.ts +4 -3
  10. package/dist/client/react/index.cjs +14 -7
  11. package/dist/client/react/index.cjs.map +1 -1
  12. package/dist/client/react/index.d.cts +10 -4
  13. package/dist/client/react/index.d.ts +10 -4
  14. package/dist/client/react/index.js +14 -7
  15. package/dist/client/react/index.js.map +1 -1
  16. package/dist/cms/contentful.d.cts +3 -2
  17. package/dist/cms/contentful.d.ts +3 -2
  18. package/dist/{consent-DgWdjsSy.d.cts → consent-BgAETCkL.d.cts} +2 -1
  19. package/dist/{consent-Cemn91j3.d.ts → consent-DRCV0N0d.d.ts} +2 -1
  20. package/dist/{cookie-names-CnL65Oly.d.cts → cookie-names-DFItnSLK.d.cts} +2 -1
  21. package/dist/{cookie-names-BvUaW3uo.d.ts → cookie-names-DU3MtcNG.d.ts} +2 -1
  22. package/dist/edge/index.cjs +22 -22
  23. package/dist/edge/index.d.cts +5 -4
  24. package/dist/edge/index.d.ts +5 -4
  25. package/dist/edge/index.js +1 -1
  26. package/dist/index.d.cts +4 -3
  27. package/dist/index.d.ts +4 -3
  28. package/dist/next/index.cjs +23 -19
  29. package/dist/next/index.cjs.map +1 -1
  30. package/dist/next/index.d.cts +7 -5
  31. package/dist/next/index.d.ts +7 -5
  32. package/dist/next/index.js +6 -2
  33. package/dist/next/index.js.map +1 -1
  34. package/dist/{personalize-content-c2DDAV6g.d.ts → personalize-content-Cwc2AomC.d.ts} +2 -1
  35. package/dist/{personalize-content-ghZPKlf1.d.cts → personalize-content-CxSdplMV.d.cts} +2 -1
  36. package/dist/server/index.d.cts +5 -4
  37. package/dist/server/index.d.ts +5 -4
  38. package/dist/{xenia-server-DV8Sjmoo.d.ts → xenia-server-Cf24mL0c.d.ts} +3 -2
  39. package/dist/{xenia-server-C3O-cWQT.d.cts → xenia-server-D-bx14lw.d.cts} +3 -2
  40. package/package.json +10 -10
  41. package/dist/chunk-OMMIRSPK.js.map +0 -1
  42. package/dist/chunk-YLMMTKQL.cjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { C as CmsAdapter, X as XeniaMarker } from '../personalize-content-ghZPKlf1.cjs';
1
+ import { CmsAdapter, XeniaMarker } from '../index.cjs';
2
2
  import '../types-DgVHS4Qw.cjs';
3
3
 
4
4
  /**
@@ -55,4 +55,5 @@ declare function parseMarker(raw: unknown): XeniaMarker | null;
55
55
  */
56
56
  declare function resolveCollection(payload: unknown, asPage?: boolean): unknown;
57
57
 
58
- export { type ContentfulAdapterOptions, type ContentfulClientLike, contentfulAdapter, parseMarker, resolveCollection };
58
+ export { contentfulAdapter, parseMarker, resolveCollection };
59
+ export type { ContentfulAdapterOptions, ContentfulClientLike };
@@ -1,4 +1,4 @@
1
- import { C as CmsAdapter, X as XeniaMarker } from '../personalize-content-c2DDAV6g.js';
1
+ import { CmsAdapter, XeniaMarker } from '../index.js';
2
2
  import '../types-DgVHS4Qw.js';
3
3
 
4
4
  /**
@@ -55,4 +55,5 @@ declare function parseMarker(raw: unknown): XeniaMarker | null;
55
55
  */
56
56
  declare function resolveCollection(payload: unknown, asPage?: boolean): unknown;
57
57
 
58
- export { type ContentfulAdapterOptions, type ContentfulClientLike, contentfulAdapter, parseMarker, resolveCollection };
58
+ export { contentfulAdapter, parseMarker, resolveCollection };
59
+ export type { ContentfulAdapterOptions, ContentfulClientLike };
@@ -245,4 +245,5 @@ declare function edgeConsent(headers: Headers, opts?: {
245
245
  respectDnt?: boolean;
246
246
  }): EdgeConsent;
247
247
 
248
- export { type CachedDecision as C, type DecideInput as D, type EdgeConsent as E, type GeoHeader as G, type LocalTime as L, type Manifest as M, type PublicManifest as P, type SwapGroup as S, type TrailView as T, type VariantSwap as V, type XeniaEdge as X, type DecideOutcome as a, type DecideResult as b, type DecisionCache as c, type DecisionSource as d, type EdgeDecision as e, type EdgeFacts as f, type EdgeMode as g, type ManifestKey as h, type ProfileFacts as i, type ViewerGeo as j, type XeniaEdgeConfig as k, createXeniaEdge as l, decodeVariant as m, deviceOf as n, edgeConsent as o, encodeVariant as p, isBot as q, isPageLoad as r, isPrefetch as s, landingContext as t, localTime as u, memoryDecisionCache as v, seasonOf as w, swapGroups as x, viewerGeo as y };
248
+ export { createXeniaEdge as l, decodeVariant as m, deviceOf as n, edgeConsent as o, encodeVariant as p, isBot as q, isPageLoad as r, isPrefetch as s, landingContext as t, localTime as u, memoryDecisionCache as v, seasonOf as w, swapGroups as x, viewerGeo as y };
249
+ export type { CachedDecision as C, DecideInput as D, EdgeConsent as E, GeoHeader as G, LocalTime as L, Manifest as M, PublicManifest as P, SwapGroup as S, TrailView as T, VariantSwap as V, XeniaEdge as X, DecideOutcome as a, DecideResult as b, DecisionCache as c, DecisionSource as d, EdgeDecision as e, EdgeFacts as f, EdgeMode as g, ManifestKey as h, ProfileFacts as i, ViewerGeo as j, XeniaEdgeConfig as k };
@@ -245,4 +245,5 @@ declare function edgeConsent(headers: Headers, opts?: {
245
245
  respectDnt?: boolean;
246
246
  }): EdgeConsent;
247
247
 
248
- export { type CachedDecision as C, type DecideInput as D, type EdgeConsent as E, type GeoHeader as G, type LocalTime as L, type Manifest as M, type PublicManifest as P, type SwapGroup as S, type TrailView as T, type VariantSwap as V, type XeniaEdge as X, type DecideOutcome as a, type DecideResult as b, type DecisionCache as c, type DecisionSource as d, type EdgeDecision as e, type EdgeFacts as f, type EdgeMode as g, type ManifestKey as h, type ProfileFacts as i, type ViewerGeo as j, type XeniaEdgeConfig as k, createXeniaEdge as l, decodeVariant as m, deviceOf as n, edgeConsent as o, encodeVariant as p, isBot as q, isPageLoad as r, isPrefetch as s, landingContext as t, localTime as u, memoryDecisionCache as v, seasonOf as w, swapGroups as x, viewerGeo as y };
248
+ export { createXeniaEdge as l, decodeVariant as m, deviceOf as n, edgeConsent as o, encodeVariant as p, isBot as q, isPageLoad as r, isPrefetch as s, landingContext as t, localTime as u, memoryDecisionCache as v, seasonOf as w, swapGroups as x, viewerGeo as y };
249
+ export type { CachedDecision as C, DecideInput as D, EdgeConsent as E, GeoHeader as G, LocalTime as L, Manifest as M, PublicManifest as P, SwapGroup as S, TrailView as T, VariantSwap as V, XeniaEdge as X, DecideOutcome as a, DecideResult as b, DecisionCache as c, DecisionSource as d, EdgeDecision as e, EdgeFacts as f, EdgeMode as g, ManifestKey as h, ProfileFacts as i, ViewerGeo as j, XeniaEdgeConfig as k };
@@ -124,4 +124,5 @@ declare const CONSENT_COOKIE: string;
124
124
  */
125
125
  declare function consentCookie(state: ConsentState, prefix?: string, maxAgeDays?: number): string;
126
126
 
127
- export { CONSENT_COOKIE as C, DEFAULT_PREFIX as D, HttpClient as H, type RequestOptions as R, VISITOR_COOKIE as V, CircuitOpenError as a, type HttpClientOptions as b, HttpError as c, type HttpResult as d, buildUrl as e, consentCookie as f, consentCookieName as g, isBrowser as i, parseActions as p, visitorCookieName as v };
127
+ export { CONSENT_COOKIE as C, DEFAULT_PREFIX as D, HttpClient as H, VISITOR_COOKIE as V, CircuitOpenError as a, HttpError as c, buildUrl as e, consentCookie as f, consentCookieName as g, isBrowser as i, parseActions as p, visitorCookieName as v };
128
+ export type { RequestOptions as R, HttpClientOptions as b, HttpResult as d };
@@ -124,4 +124,5 @@ declare const CONSENT_COOKIE: string;
124
124
  */
125
125
  declare function consentCookie(state: ConsentState, prefix?: string, maxAgeDays?: number): string;
126
126
 
127
- export { CONSENT_COOKIE as C, DEFAULT_PREFIX as D, HttpClient as H, type RequestOptions as R, VISITOR_COOKIE as V, CircuitOpenError as a, type HttpClientOptions as b, HttpError as c, type HttpResult as d, buildUrl as e, consentCookie as f, consentCookieName as g, isBrowser as i, parseActions as p, visitorCookieName as v };
127
+ export { CONSENT_COOKIE as C, DEFAULT_PREFIX as D, HttpClient as H, VISITOR_COOKIE as V, CircuitOpenError as a, HttpError as c, buildUrl as e, consentCookie as f, consentCookieName as g, isBrowser as i, parseActions as p, visitorCookieName as v };
128
+ export type { RequestOptions as R, HttpClientOptions as b, HttpResult as d };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkYLMMTKQL_cjs = require('../chunk-YLMMTKQL.cjs');
3
+ var chunkIOY6IPUW_cjs = require('../chunk-IOY6IPUW.cjs');
4
4
  require('../chunk-WHGK55JP.cjs');
5
5
  require('../chunk-N5M4PI7C.cjs');
6
6
 
@@ -190,87 +190,87 @@ function createXeniaEdge(config) {
190
190
 
191
191
  Object.defineProperty(exports, "MAX_TRAIL", {
192
192
  enumerable: true,
193
- get: function () { return chunkYLMMTKQL_cjs.MAX_TRAIL; }
193
+ get: function () { return chunkIOY6IPUW_cjs.MAX_TRAIL; }
194
194
  });
195
195
  Object.defineProperty(exports, "TRAIL_MAX_AGE_S", {
196
196
  enumerable: true,
197
- get: function () { return chunkYLMMTKQL_cjs.TRAIL_MAX_AGE_S; }
197
+ get: function () { return chunkIOY6IPUW_cjs.TRAIL_MAX_AGE_S; }
198
198
  });
199
199
  Object.defineProperty(exports, "decodeVariant", {
200
200
  enumerable: true,
201
- get: function () { return chunkYLMMTKQL_cjs.decodeVariant; }
201
+ get: function () { return chunkIOY6IPUW_cjs.decodeVariant; }
202
202
  });
203
203
  Object.defineProperty(exports, "deviceOf", {
204
204
  enumerable: true,
205
- get: function () { return chunkYLMMTKQL_cjs.deviceOf; }
205
+ get: function () { return chunkIOY6IPUW_cjs.deviceOf; }
206
206
  });
207
207
  Object.defineProperty(exports, "edgeConsent", {
208
208
  enumerable: true,
209
- get: function () { return chunkYLMMTKQL_cjs.edgeConsent; }
209
+ get: function () { return chunkIOY6IPUW_cjs.edgeConsent; }
210
210
  });
211
211
  Object.defineProperty(exports, "encodeVariant", {
212
212
  enumerable: true,
213
- get: function () { return chunkYLMMTKQL_cjs.encodeVariant; }
213
+ get: function () { return chunkIOY6IPUW_cjs.encodeVariant; }
214
214
  });
215
215
  Object.defineProperty(exports, "fetchManifest", {
216
216
  enumerable: true,
217
- get: function () { return chunkYLMMTKQL_cjs.fetchManifest; }
217
+ get: function () { return chunkIOY6IPUW_cjs.fetchManifest; }
218
218
  });
219
219
  Object.defineProperty(exports, "isBot", {
220
220
  enumerable: true,
221
- get: function () { return chunkYLMMTKQL_cjs.isBot; }
221
+ get: function () { return chunkIOY6IPUW_cjs.isBot; }
222
222
  });
223
223
  Object.defineProperty(exports, "isPageLoad", {
224
224
  enumerable: true,
225
- get: function () { return chunkYLMMTKQL_cjs.isPageLoad; }
225
+ get: function () { return chunkIOY6IPUW_cjs.isPageLoad; }
226
226
  });
227
227
  Object.defineProperty(exports, "isPrefetch", {
228
228
  enumerable: true,
229
- get: function () { return chunkYLMMTKQL_cjs.isPrefetch; }
229
+ get: function () { return chunkIOY6IPUW_cjs.isPrefetch; }
230
230
  });
231
231
  Object.defineProperty(exports, "landingContext", {
232
232
  enumerable: true,
233
- get: function () { return chunkYLMMTKQL_cjs.landingContext; }
233
+ get: function () { return chunkIOY6IPUW_cjs.landingContext; }
234
234
  });
235
235
  Object.defineProperty(exports, "localTime", {
236
236
  enumerable: true,
237
- get: function () { return chunkYLMMTKQL_cjs.localTime; }
237
+ get: function () { return chunkIOY6IPUW_cjs.localTime; }
238
238
  });
239
239
  Object.defineProperty(exports, "readTrail", {
240
240
  enumerable: true,
241
- get: function () { return chunkYLMMTKQL_cjs.readTrail; }
241
+ get: function () { return chunkIOY6IPUW_cjs.readTrail; }
242
242
  });
243
243
  Object.defineProperty(exports, "seasonOf", {
244
244
  enumerable: true,
245
- get: function () { return chunkYLMMTKQL_cjs.seasonOf; }
245
+ get: function () { return chunkIOY6IPUW_cjs.seasonOf; }
246
246
  });
247
247
  Object.defineProperty(exports, "swapGroups", {
248
248
  enumerable: true,
249
- get: function () { return chunkYLMMTKQL_cjs.swapGroups; }
249
+ get: function () { return chunkIOY6IPUW_cjs.swapGroups; }
250
250
  });
251
251
  Object.defineProperty(exports, "trailCookieName", {
252
252
  enumerable: true,
253
- get: function () { return chunkYLMMTKQL_cjs.trailCookieName; }
253
+ get: function () { return chunkIOY6IPUW_cjs.trailCookieName; }
254
254
  });
255
255
  Object.defineProperty(exports, "trailCookieValue", {
256
256
  enumerable: true,
257
- get: function () { return chunkYLMMTKQL_cjs.trailCookieValue; }
257
+ get: function () { return chunkIOY6IPUW_cjs.trailCookieValue; }
258
258
  });
259
259
  Object.defineProperty(exports, "trimManifest", {
260
260
  enumerable: true,
261
- get: function () { return chunkYLMMTKQL_cjs.trimManifest; }
261
+ get: function () { return chunkIOY6IPUW_cjs.trimManifest; }
262
262
  });
263
263
  Object.defineProperty(exports, "verifyWebhook", {
264
264
  enumerable: true,
265
- get: function () { return chunkYLMMTKQL_cjs.verifyWebhook; }
265
+ get: function () { return chunkIOY6IPUW_cjs.verifyWebhook; }
266
266
  });
267
267
  Object.defineProperty(exports, "viewerGeo", {
268
268
  enumerable: true,
269
- get: function () { return chunkYLMMTKQL_cjs.viewerGeo; }
269
+ get: function () { return chunkIOY6IPUW_cjs.viewerGeo; }
270
270
  });
271
271
  Object.defineProperty(exports, "withView", {
272
272
  enumerable: true,
273
- get: function () { return chunkYLMMTKQL_cjs.withView; }
273
+ get: function () { return chunkIOY6IPUW_cjs.withView; }
274
274
  });
275
275
  exports.createXeniaEdge = createXeniaEdge;
276
276
  exports.matchesAny = matchesAny;
@@ -1,5 +1,5 @@
1
- import { M as Manifest, P as PublicManifest, T as TrailView } from '../consent-DgWdjsSy.cjs';
2
- export { C as CachedDecision, D as DecideInput, a as DecideOutcome, b as DecideResult, c as DecisionCache, d as DecisionSource, E as EdgeConsent, e as EdgeDecision, f as EdgeFacts, g as EdgeMode, G as GeoHeader, L as LocalTime, h as ManifestKey, i as ProfileFacts, S as SwapGroup, V as VariantSwap, j as ViewerGeo, X as XeniaEdge, k as XeniaEdgeConfig, l as createXeniaEdge, m as decodeVariant, n as deviceOf, o as edgeConsent, p as encodeVariant, q as isBot, r as isPageLoad, s as isPrefetch, t as landingContext, u as localTime, v as memoryDecisionCache, w as seasonOf, x as swapGroups, y as viewerGeo } from '../consent-DgWdjsSy.cjs';
1
+ import { M as Manifest, P as PublicManifest, T as TrailView } from '../consent-BgAETCkL.cjs';
2
+ export { C as CachedDecision, D as DecideInput, a as DecideOutcome, b as DecideResult, c as DecisionCache, d as DecisionSource, E as EdgeConsent, e as EdgeDecision, f as EdgeFacts, g as EdgeMode, G as GeoHeader, L as LocalTime, h as ManifestKey, i as ProfileFacts, S as SwapGroup, V as VariantSwap, j as ViewerGeo, X as XeniaEdge, k as XeniaEdgeConfig, l as createXeniaEdge, m as decodeVariant, n as deviceOf, o as edgeConsent, p as encodeVariant, q as isBot, r as isPageLoad, s as isPrefetch, t as landingContext, u as localTime, v as memoryDecisionCache, w as seasonOf, x as swapGroups, y as viewerGeo } from '../consent-BgAETCkL.cjs';
3
3
  import '../types-DgVHS4Qw.cjs';
4
4
 
5
5
  /**
@@ -22,7 +22,7 @@ interface FetchManifestOptions {
22
22
  /** Default 5000 ms. */
23
23
  timeoutMs?: number;
24
24
  fetch?: typeof fetch;
25
- /** Extra fetch options, e.g. Next.js `{ next: { revalidate } }`. */
25
+ /** Extra fetch options, e.g. Next.js `{ next: { revalidate } }`. Their headers are kept. */
26
26
  init?: RequestInit;
27
27
  }
28
28
  /** Xenia's manifest (`GET /api/personalization/edge/manifest`). Throws on a non-2xx answer. */
@@ -58,4 +58,5 @@ declare function withView(trail: TrailView[], path: string, now?: number): Trail
58
58
  /** The cookie value for a trail (not URI-encoded; cookie setters encode it). */
59
59
  declare function trailCookieValue(trail: TrailView[]): string;
60
60
 
61
- export { type FetchManifestOptions, MAX_TRAIL, Manifest, PublicManifest, TRAIL_MAX_AGE_S, TrailView, fetchManifest, matchesAny, normalizePath, readTrail, trailCookieName, trailCookieValue, trimManifest, verifyWebhook, withView };
61
+ export { MAX_TRAIL, Manifest, PublicManifest, TRAIL_MAX_AGE_S, TrailView, fetchManifest, matchesAny, normalizePath, readTrail, trailCookieName, trailCookieValue, trimManifest, verifyWebhook, withView };
62
+ export type { FetchManifestOptions };
@@ -1,5 +1,5 @@
1
- import { M as Manifest, P as PublicManifest, T as TrailView } from '../consent-Cemn91j3.js';
2
- export { C as CachedDecision, D as DecideInput, a as DecideOutcome, b as DecideResult, c as DecisionCache, d as DecisionSource, E as EdgeConsent, e as EdgeDecision, f as EdgeFacts, g as EdgeMode, G as GeoHeader, L as LocalTime, h as ManifestKey, i as ProfileFacts, S as SwapGroup, V as VariantSwap, j as ViewerGeo, X as XeniaEdge, k as XeniaEdgeConfig, l as createXeniaEdge, m as decodeVariant, n as deviceOf, o as edgeConsent, p as encodeVariant, q as isBot, r as isPageLoad, s as isPrefetch, t as landingContext, u as localTime, v as memoryDecisionCache, w as seasonOf, x as swapGroups, y as viewerGeo } from '../consent-Cemn91j3.js';
1
+ import { M as Manifest, P as PublicManifest, T as TrailView } from '../consent-DRCV0N0d.js';
2
+ export { C as CachedDecision, D as DecideInput, a as DecideOutcome, b as DecideResult, c as DecisionCache, d as DecisionSource, E as EdgeConsent, e as EdgeDecision, f as EdgeFacts, g as EdgeMode, G as GeoHeader, L as LocalTime, h as ManifestKey, i as ProfileFacts, S as SwapGroup, V as VariantSwap, j as ViewerGeo, X as XeniaEdge, k as XeniaEdgeConfig, l as createXeniaEdge, m as decodeVariant, n as deviceOf, o as edgeConsent, p as encodeVariant, q as isBot, r as isPageLoad, s as isPrefetch, t as landingContext, u as localTime, v as memoryDecisionCache, w as seasonOf, x as swapGroups, y as viewerGeo } from '../consent-DRCV0N0d.js';
3
3
  import '../types-DgVHS4Qw.js';
4
4
 
5
5
  /**
@@ -22,7 +22,7 @@ interface FetchManifestOptions {
22
22
  /** Default 5000 ms. */
23
23
  timeoutMs?: number;
24
24
  fetch?: typeof fetch;
25
- /** Extra fetch options, e.g. Next.js `{ next: { revalidate } }`. */
25
+ /** Extra fetch options, e.g. Next.js `{ next: { revalidate } }`. Their headers are kept. */
26
26
  init?: RequestInit;
27
27
  }
28
28
  /** Xenia's manifest (`GET /api/personalization/edge/manifest`). Throws on a non-2xx answer. */
@@ -58,4 +58,5 @@ declare function withView(trail: TrailView[], path: string, now?: number): Trail
58
58
  /** The cookie value for a trail (not URI-encoded; cookie setters encode it). */
59
59
  declare function trailCookieValue(trail: TrailView[]): string;
60
60
 
61
- export { type FetchManifestOptions, MAX_TRAIL, Manifest, PublicManifest, TRAIL_MAX_AGE_S, TrailView, fetchManifest, matchesAny, normalizePath, readTrail, trailCookieName, trailCookieValue, trimManifest, verifyWebhook, withView };
61
+ export { MAX_TRAIL, Manifest, PublicManifest, TRAIL_MAX_AGE_S, TrailView, fetchManifest, matchesAny, normalizePath, readTrail, trailCookieName, trailCookieValue, trimManifest, verifyWebhook, withView };
62
+ export type { FetchManifestOptions };
@@ -1,4 +1,4 @@
1
- export { MAX_TRAIL, TRAIL_MAX_AGE_S, decodeVariant, deviceOf, edgeConsent, encodeVariant, fetchManifest, isBot, isPageLoad, isPrefetch, landingContext, localTime, readTrail, seasonOf, swapGroups, trailCookieName, trailCookieValue, trimManifest, verifyWebhook, viewerGeo, withView } from '../chunk-OMMIRSPK.js';
1
+ export { MAX_TRAIL, TRAIL_MAX_AGE_S, decodeVariant, deviceOf, edgeConsent, encodeVariant, fetchManifest, isBot, isPageLoad, isPrefetch, landingContext, localTime, readTrail, seasonOf, swapGroups, trailCookieName, trailCookieValue, trimManifest, verifyWebhook, viewerGeo, withView } from '../chunk-F3WZFXYK.js';
2
2
  import '../chunk-QEYONKWY.js';
3
3
  import '../chunk-BQ5PJCZ7.js';
4
4
 
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  export { X as XeniaApi } from './api-0IycTYJR.cjs';
2
- export { C as CONSENT_COOKIE, a as CircuitOpenError, D as DEFAULT_PREFIX, H as HttpClient, b as HttpClientOptions, c as HttpError, d as HttpResult, R as RequestOptions, V as VISITOR_COOKIE, e as buildUrl, f as consentCookie, g as consentCookieName, i as isBrowser, p as parseActions, v as visitorCookieName } from './cookie-names-CnL65Oly.cjs';
2
+ export { C as CONSENT_COOKIE, a as CircuitOpenError, D as DEFAULT_PREFIX, H as HttpClient, b as HttpClientOptions, c as HttpError, d as HttpResult, R as RequestOptions, V as VISITOR_COOKIE, e as buildUrl, f as consentCookie, g as consentCookieName, i as isBrowser, p as parseActions, v as visitorCookieName } from './cookie-names-DFItnSLK.cjs';
3
3
  import { J as JsonValue, E as EventContext, W as WebhookResponse } from './types-DgVHS4Qw.cjs';
4
4
  export { A as AnalyticsContext, a as AnalyticsEventName, b as AnalyticsIdentity, c as AnalyticsIngestResponse, C as CircuitBreakerConfig, d as ConsentState, e as EntryDecision, f as EntryFilter, g as EntryQuery, h as EntrySwapOp, i as EventIdentity, H as HttpMethod, I as IdentifyRequest, j as IdentifyResponse, k as InteractionType, l as JsonObject, M as MessageCta, m as MessagePlacement, P as PersonalizationSwap, R as ResolveBatchItem, n as ResolveBatchResult, o as ResolveEntriesResult, p as ResolveOptions, q as ResolveResult, r as RetryConfig, T as TrackOptions, s as WidgetFormSubmit, t as WidgetPrize, u as WidgetSegment, v as WidgetSubmitResponse, w as WidgetType, X as XeniaAction, x as XeniaConfig, y as XeniaEvent } from './types-DgVHS4Qw.cjs';
5
- export { A as AppliedSwap, C as CmsAdapter, E as EntryResolver, P as PagePersonalizeOptions, a as PageRef, b as PersonalizeContentOptions, c as PersonalizeContentResult, X as XeniaMarker, p as pendingTargets, d as personalizeContent, e as personalizePage } from './personalize-content-ghZPKlf1.cjs';
5
+ export { A as AppliedSwap, C as CmsAdapter, E as EntryResolver, P as PagePersonalizeOptions, a as PageRef, b as PersonalizeContentOptions, c as PersonalizeContentResult, X as XeniaMarker, p as pendingTargets, d as personalizeContent, e as personalizePage } from './personalize-content-CxSdplMV.cjs';
6
6
 
7
7
  /**
8
8
  * Generate a ULID (Universally Unique Lexicographically Sortable Identifier):
@@ -110,4 +110,5 @@ declare class LocalStorageResponseStore implements ResponseStore {
110
110
  clear(): void;
111
111
  }
112
112
 
113
- export { type ContentSwap, EventContext, JsonValue, LocalStorageResponseStore, MAX_EVENT_ID_LENGTH, MemoryResponseStore, type ResponseStore, WebhookResponse, contextFromUrl, extractContentSwaps, generateUlid, spliceSlots, toEventId };
113
+ export { EventContext, JsonValue, LocalStorageResponseStore, MAX_EVENT_ID_LENGTH, MemoryResponseStore, WebhookResponse, contextFromUrl, extractContentSwaps, generateUlid, spliceSlots, toEventId };
114
+ export type { ContentSwap, ResponseStore };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  export { X as XeniaApi } from './api-COXWLL5L.js';
2
- export { C as CONSENT_COOKIE, a as CircuitOpenError, D as DEFAULT_PREFIX, H as HttpClient, b as HttpClientOptions, c as HttpError, d as HttpResult, R as RequestOptions, V as VISITOR_COOKIE, e as buildUrl, f as consentCookie, g as consentCookieName, i as isBrowser, p as parseActions, v as visitorCookieName } from './cookie-names-BvUaW3uo.js';
2
+ export { C as CONSENT_COOKIE, a as CircuitOpenError, D as DEFAULT_PREFIX, H as HttpClient, b as HttpClientOptions, c as HttpError, d as HttpResult, R as RequestOptions, V as VISITOR_COOKIE, e as buildUrl, f as consentCookie, g as consentCookieName, i as isBrowser, p as parseActions, v as visitorCookieName } from './cookie-names-DU3MtcNG.js';
3
3
  import { J as JsonValue, E as EventContext, W as WebhookResponse } from './types-DgVHS4Qw.js';
4
4
  export { A as AnalyticsContext, a as AnalyticsEventName, b as AnalyticsIdentity, c as AnalyticsIngestResponse, C as CircuitBreakerConfig, d as ConsentState, e as EntryDecision, f as EntryFilter, g as EntryQuery, h as EntrySwapOp, i as EventIdentity, H as HttpMethod, I as IdentifyRequest, j as IdentifyResponse, k as InteractionType, l as JsonObject, M as MessageCta, m as MessagePlacement, P as PersonalizationSwap, R as ResolveBatchItem, n as ResolveBatchResult, o as ResolveEntriesResult, p as ResolveOptions, q as ResolveResult, r as RetryConfig, T as TrackOptions, s as WidgetFormSubmit, t as WidgetPrize, u as WidgetSegment, v as WidgetSubmitResponse, w as WidgetType, X as XeniaAction, x as XeniaConfig, y as XeniaEvent } from './types-DgVHS4Qw.js';
5
- export { A as AppliedSwap, C as CmsAdapter, E as EntryResolver, P as PagePersonalizeOptions, a as PageRef, b as PersonalizeContentOptions, c as PersonalizeContentResult, X as XeniaMarker, p as pendingTargets, d as personalizeContent, e as personalizePage } from './personalize-content-c2DDAV6g.js';
5
+ export { A as AppliedSwap, C as CmsAdapter, E as EntryResolver, P as PagePersonalizeOptions, a as PageRef, b as PersonalizeContentOptions, c as PersonalizeContentResult, X as XeniaMarker, p as pendingTargets, d as personalizeContent, e as personalizePage } from './personalize-content-Cwc2AomC.js';
6
6
 
7
7
  /**
8
8
  * Generate a ULID (Universally Unique Lexicographically Sortable Identifier):
@@ -110,4 +110,5 @@ declare class LocalStorageResponseStore implements ResponseStore {
110
110
  clear(): void;
111
111
  }
112
112
 
113
- export { type ContentSwap, EventContext, JsonValue, LocalStorageResponseStore, MAX_EVENT_ID_LENGTH, MemoryResponseStore, type ResponseStore, WebhookResponse, contextFromUrl, extractContentSwaps, generateUlid, spliceSlots, toEventId };
113
+ export { EventContext, JsonValue, LocalStorageResponseStore, MAX_EVENT_ID_LENGTH, MemoryResponseStore, WebhookResponse, contextFromUrl, extractContentSwaps, generateUlid, spliceSlots, toEventId };
114
+ export type { ContentSwap, ResponseStore };
@@ -2,7 +2,7 @@
2
2
 
3
3
  var chunk2DR5AVPX_cjs = require('../chunk-2DR5AVPX.cjs');
4
4
  var chunkRWE2OCQL_cjs = require('../chunk-RWE2OCQL.cjs');
5
- var chunkYLMMTKQL_cjs = require('../chunk-YLMMTKQL.cjs');
5
+ var chunkIOY6IPUW_cjs = require('../chunk-IOY6IPUW.cjs');
6
6
  var chunkWHGK55JP_cjs = require('../chunk-WHGK55JP.cjs');
7
7
  var chunkN5M4PI7C_cjs = require('../chunk-N5M4PI7C.cjs');
8
8
  var React = require('react');
@@ -171,7 +171,7 @@ function debugEntry(info) {
171
171
  };
172
172
  }
173
173
  function writeDebug(request, response, entry, cookie) {
174
- if (chunkYLMMTKQL_cjs.isPrefetch(request.headers)) return;
174
+ if (chunkIOY6IPUW_cjs.isPrefetch(request.headers)) return;
175
175
  entry = { ...entry, page: entry.page.slice(0, MAX_PAGE) };
176
176
  const pages = readDebugEntries(request.cookies.get(cookie)?.value);
177
177
  delete pages[entry.page];
@@ -194,20 +194,20 @@ var MAX_QUERY = 20;
194
194
  var MAX_QUERY_VALUE = 500;
195
195
  async function xeniaEdgeProxy(request, opts) {
196
196
  if (request.method !== "GET" && request.method !== "HEAD") return server.NextResponse.next();
197
- if (chunkYLMMTKQL_cjs.isBot(request.headers.get("user-agent"))) return server.NextResponse.next();
197
+ if (chunkIOY6IPUW_cjs.isBot(request.headers.get("user-agent"))) return server.NextResponse.next();
198
198
  const started = Date.now();
199
199
  const prefix = opts.prefix ?? chunkN5M4PI7C_cjs.DEFAULT_PREFIX;
200
200
  const vidCookie = chunkN5M4PI7C_cjs.visitorCookieName(prefix);
201
201
  const ctxCookie = `${prefix}_ctx`;
202
- const trailCookie = chunkYLMMTKQL_cjs.trailCookieName(prefix);
202
+ const trailCookie = chunkIOY6IPUW_cjs.trailCookieName(prefix);
203
203
  const { pathname: path } = request.nextUrl;
204
204
  const existingVisitorId = request.cookies.get(vidCookie)?.value;
205
- const landing = chunkYLMMTKQL_cjs.landingContext(request.nextUrl, request.headers.get("referer"), request.cookies.get(ctxCookie)?.value);
205
+ const landing = chunkIOY6IPUW_cjs.landingContext(request.nextUrl, request.headers.get("referer"), request.cookies.get(ctxCookie)?.value);
206
206
  const qaOn = Boolean(opts.qa);
207
207
  const cities = typeof opts.qa === "object" && opts.qa.cities || QA_CITIES;
208
208
  const qaCookie = `${prefix}_qa_ctx`;
209
209
  const { qa, changed: qaChanged } = qaOn ? readQa(request, cities, qaCookie) : { qa: {}, changed: false };
210
- const detected = chunkYLMMTKQL_cjs.viewerGeo(request, { trust: opts.geoHeaders, devOverride: qaOn && process.env.NODE_ENV === "development" });
210
+ const detected = chunkIOY6IPUW_cjs.viewerGeo(request, { trust: opts.geoHeaders, devOverride: qaOn && process.env.NODE_ENV === "development" });
211
211
  const qaCity = qa.geo && Object.hasOwn(cities, qa.geo) ? cities[qa.geo] : void 0;
212
212
  const { geo, via } = qaCity ? { geo: { ...qaCity, source: "qa" }, via: "qa" } : detected;
213
213
  const ctx = {
@@ -219,11 +219,11 @@ async function xeniaEdgeProxy(request, opts) {
219
219
  geo,
220
220
  geoVia: via,
221
221
  ...qaCity && detected.geo ? { detectedGeo: detected.geo } : {},
222
- device: chunkYLMMTKQL_cjs.deviceOf(request.headers),
222
+ device: chunkIOY6IPUW_cjs.deviceOf(request.headers),
223
223
  landing: landing.ctx,
224
- previousTrail: chunkYLMMTKQL_cjs.readTrail(request.cookies.get(trailCookie)?.value),
224
+ previousTrail: chunkIOY6IPUW_cjs.readTrail(request.cookies.get(trailCookie)?.value),
225
225
  trail: [],
226
- consent: chunkYLMMTKQL_cjs.edgeConsent(request.headers, { prefix, respectDnt: opts.respectDnt }),
226
+ consent: chunkIOY6IPUW_cjs.edgeConsent(request.headers, { prefix, respectDnt: opts.respectDnt }),
227
227
  now: qaNow(qa) ?? /* @__PURE__ */ new Date()
228
228
  };
229
229
  const newVisitor = () => ctx.visitorId !== existingVisitorId;
@@ -235,8 +235,8 @@ async function xeniaEdgeProxy(request, opts) {
235
235
  if (landing.changed || ctx.landing !== landing.ctx) {
236
236
  response.cookies.set(ctxCookie, JSON.stringify(ctx.landing), { path: "/", sameSite: "lax", httpOnly: true });
237
237
  }
238
- if (ctx.consent.analytics && chunkYLMMTKQL_cjs.isPageLoad(request.headers) && ctx.trail.length && ctx.trail !== ctx.previousTrail) {
239
- response.cookies.set(trailCookie, chunkYLMMTKQL_cjs.trailCookieValue(ctx.trail), { path: "/", maxAge: chunkYLMMTKQL_cjs.TRAIL_MAX_AGE_S, sameSite: "lax" });
238
+ if (ctx.consent.analytics && chunkIOY6IPUW_cjs.isPageLoad(request.headers) && ctx.trail.length && ctx.trail !== ctx.previousTrail) {
239
+ response.cookies.set(trailCookie, chunkIOY6IPUW_cjs.trailCookieValue(ctx.trail), { path: "/", maxAge: chunkIOY6IPUW_cjs.TRAIL_MAX_AGE_S, sameSite: "lax" });
240
240
  }
241
241
  response.headers.set("Server-Timing", `xenia;dur=${Date.now() - started};desc="${desc}"`);
242
242
  if (qaChanged) rememberQa(response, qa, qaCookie);
@@ -257,7 +257,7 @@ async function xeniaEdgeProxy(request, opts) {
257
257
  }
258
258
  async function decideAndRespond() {
259
259
  await opts.prepare?.(ctx);
260
- ctx.trail = chunkYLMMTKQL_cjs.withView(ctx.previousTrail, path);
260
+ ctx.trail = chunkIOY6IPUW_cjs.withView(ctx.previousTrail, path);
261
261
  if (opts.skip?.(path)) return finish(base(), "skipped", "site page");
262
262
  const query = {};
263
263
  for (const [k, v] of request.nextUrl.searchParams) {
@@ -266,7 +266,7 @@ async function xeniaEdgeProxy(request, opts) {
266
266
  }
267
267
  const facts = {
268
268
  ...ctx.landing,
269
- ...chunkYLMMTKQL_cjs.localTime(ctx.geo, ctx.now),
269
+ ...chunkIOY6IPUW_cjs.localTime(ctx.geo, ctx.now),
270
270
  device: ctx.device,
271
271
  path,
272
272
  url: request.nextUrl.href,
@@ -307,10 +307,10 @@ async function xeniaEdgeProxy(request, opts) {
307
307
  });
308
308
  const side = await pending;
309
309
  const decisions = opts.filterDecisions ? opts.filterDecisions(outcome.decisions, ctx, side, outcome) : outcome.decisions;
310
- const groups = chunkYLMMTKQL_cjs.swapGroups(decisions);
310
+ const groups = chunkIOY6IPUW_cjs.swapGroups(decisions);
311
311
  let url = await opts.rewrite?.(ctx, groups, side, outcome);
312
312
  if (url === void 0 && groups.length) {
313
- const token = await chunkYLMMTKQL_cjs.encodeVariant(groups, opts.variantSecret, await opts.extra?.(ctx, side, outcome));
313
+ const token = await chunkIOY6IPUW_cjs.encodeVariant(groups, opts.variantSecret, await opts.extra?.(ctx, side, outcome));
314
314
  url = request.nextUrl.clone();
315
315
  url.pathname = `${opts.variantPrefix ?? "/xv"}/${token}${path === "/" ? "" : path}`;
316
316
  }
@@ -318,17 +318,21 @@ async function xeniaEdgeProxy(request, opts) {
318
318
  }
319
319
  }
320
320
  var EMPTY = { version: "", pages: [] };
321
+ var PROCESS_KEY = `${Date.now()}-${Math.random().toString(36).slice(2)}`;
321
322
  var MAX_WEBHOOK_BODY = 64 * 1024;
322
323
  function createManifestRoute(opts) {
323
324
  return async () => {
324
325
  if (!opts.token) return Response.json(EMPTY);
325
326
  try {
326
- const manifest = await chunkYLMMTKQL_cjs.fetchManifest({
327
+ const manifest = await chunkIOY6IPUW_cjs.fetchManifest({
327
328
  baseUrl: opts.baseUrl,
328
329
  token: opts.token,
329
- ...opts.revalidate !== void 0 ? { init: { next: { revalidate: opts.revalidate } } } : {}
330
+ init: {
331
+ headers: { "X-Xenia-Cache-Key": PROCESS_KEY },
332
+ ...opts.revalidate !== void 0 && { next: { revalidate: opts.revalidate } }
333
+ }
330
334
  });
331
- return Response.json(chunkYLMMTKQL_cjs.trimManifest(manifest));
335
+ return Response.json(chunkIOY6IPUW_cjs.trimManifest(manifest));
332
336
  } catch (error) {
333
337
  if (process.env.NEXT_PHASE === "phase-production-build") {
334
338
  console.warn("[xenia] manifest unavailable at build:", error instanceof Error ? error.message : error);
@@ -341,7 +345,7 @@ function createManifestRoute(opts) {
341
345
  function createRevalidateRoute(opts) {
342
346
  return async (request) => {
343
347
  const body = await request.text();
344
- if (body.length > MAX_WEBHOOK_BODY || !await chunkYLMMTKQL_cjs.verifyWebhook({ headers: request.headers, body }, opts.secret ?? "")) {
348
+ if (body.length > MAX_WEBHOOK_BODY || !await chunkIOY6IPUW_cjs.verifyWebhook({ headers: request.headers, body }, opts.secret ?? "")) {
345
349
  return Response.json({ error: "invalid signature" }, { status: 401 });
346
350
  }
347
351
  const event = request.headers.get("x-xenia-event") ?? "";