@cross-deck/web 1.10.3 → 1.11.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.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PublicEntitlement, C as CrossdeckOptions, I as IdentifyOptions, A as AliasResult, G as GroupTraits, E as EventProperties, a as PurchaseResult, H as HeartbeatResponse, D as Diagnostics, K as KeyValueStorage } from './types-B9sxUuKh.mjs';
2
- export { b as AuditRail, c as AutoTrackOptions, d as EntitlementsListResponse, e as Environment, f as Platform } from './types-B9sxUuKh.mjs';
1
+ import { P as PublicEntitlement, C as CrossdeckOptions, I as IdentifyOptions, A as AliasResult, G as GroupTraits, E as EventProperties, a as PurchaseResult, H as HeartbeatResponse, D as Diagnostics, K as KeyValueStorage } from './types-iqtsOTGy.mjs';
2
+ export { b as AuditRail, c as AutoTrackOptions, d as EntitlementsListResponse, e as Environment, f as Platform } from './types-iqtsOTGy.mjs';
3
3
 
4
4
  /**
5
5
  * Durable last-known-good cache of the customer's entitlements.
@@ -969,7 +969,7 @@ declare class MemoryStorage implements KeyValueStorage {
969
969
  *
970
970
  * Do NOT edit by hand — `node scripts/sync-sdk-versions.mjs`.
971
971
  */
972
- declare const SDK_VERSION = "1.10.3";
972
+ declare const SDK_VERSION = "1.11.2";
973
973
  declare const SDK_NAME = "@cross-deck/web";
974
974
 
975
975
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PublicEntitlement, C as CrossdeckOptions, I as IdentifyOptions, A as AliasResult, G as GroupTraits, E as EventProperties, a as PurchaseResult, H as HeartbeatResponse, D as Diagnostics, K as KeyValueStorage } from './types-B9sxUuKh.js';
2
- export { b as AuditRail, c as AutoTrackOptions, d as EntitlementsListResponse, e as Environment, f as Platform } from './types-B9sxUuKh.js';
1
+ import { P as PublicEntitlement, C as CrossdeckOptions, I as IdentifyOptions, A as AliasResult, G as GroupTraits, E as EventProperties, a as PurchaseResult, H as HeartbeatResponse, D as Diagnostics, K as KeyValueStorage } from './types-iqtsOTGy.js';
2
+ export { b as AuditRail, c as AutoTrackOptions, d as EntitlementsListResponse, e as Environment, f as Platform } from './types-iqtsOTGy.js';
3
3
 
4
4
  /**
5
5
  * Durable last-known-good cache of the customer's entitlements.
@@ -969,7 +969,7 @@ declare class MemoryStorage implements KeyValueStorage {
969
969
  *
970
970
  * Do NOT edit by hand — `node scripts/sync-sdk-versions.mjs`.
971
971
  */
972
- declare const SDK_VERSION = "1.10.3";
972
+ declare const SDK_VERSION = "1.11.2";
973
973
  declare const SDK_NAME = "@cross-deck/web";
974
974
 
975
975
  /**
package/dist/index.mjs CHANGED
@@ -69,7 +69,7 @@ function typeMapForStatus(status) {
69
69
  }
70
70
 
71
71
  // src/_version.ts
72
- var SDK_VERSION = "1.10.3";
72
+ var SDK_VERSION = "1.11.2";
73
73
  var SDK_NAME = "@cross-deck/web";
74
74
 
75
75
  // src/http.ts
@@ -1297,6 +1297,7 @@ var CookieStorage = class {
1297
1297
  this.maxAgeSec = options?.maxAgeSec ?? 63072e3;
1298
1298
  this.secure = options?.secure ?? defaultSecure();
1299
1299
  this.sameSite = options?.sameSite ?? "Lax";
1300
+ this.domain = options?.domain || void 0;
1300
1301
  }
1301
1302
  getItem(key) {
1302
1303
  if (!hasDocument()) return null;
@@ -1323,6 +1324,7 @@ var CookieStorage = class {
1323
1324
  `Max-Age=${this.maxAgeSec}`,
1324
1325
  `SameSite=${this.sameSite}`
1325
1326
  ];
1327
+ if (this.domain) parts.push(`Domain=${this.domain}`);
1326
1328
  if (this.secure) parts.push("Secure");
1327
1329
  try {
1328
1330
  doc.cookie = parts.join("; ");
@@ -1338,6 +1340,7 @@ var CookieStorage = class {
1338
1340
  "Max-Age=0",
1339
1341
  `SameSite=${this.sameSite}`
1340
1342
  ];
1343
+ if (this.domain) parts.push(`Domain=${this.domain}`);
1341
1344
  if (this.secure) parts.push("Secure");
1342
1345
  try {
1343
1346
  doc.cookie = parts.join("; ");
@@ -1345,6 +1348,34 @@ var CookieStorage = class {
1345
1348
  }
1346
1349
  }
1347
1350
  };
1351
+ function resolveCookieDomain(config) {
1352
+ if (config === void 0 || config === "none" || config === "") return void 0;
1353
+ if (config !== "auto") {
1354
+ const d = config.trim().toLowerCase();
1355
+ return d.startsWith(".") ? d : `.${d}`;
1356
+ }
1357
+ if (!hasDocument()) return void 0;
1358
+ const doc = globalThis.document;
1359
+ const loc = globalThis.location;
1360
+ const host = (loc?.hostname ?? "").toLowerCase();
1361
+ if (!host || host === "localhost" || /^\d{1,3}(\.\d{1,3}){3}$/.test(host) || host.indexOf(".") === -1) {
1362
+ return void 0;
1363
+ }
1364
+ const labels = host.split(".");
1365
+ for (let i = labels.length - 2; i >= 0; i--) {
1366
+ const candidate = "." + labels.slice(i).join(".");
1367
+ const testKey = "__cd_domain_probe";
1368
+ try {
1369
+ doc.cookie = `${testKey}=1; Domain=${candidate}; Path=/; SameSite=Lax`;
1370
+ const accepted = doc.cookie.indexOf(`${testKey}=1`) !== -1;
1371
+ doc.cookie = `${testKey}=; Domain=${candidate}; Path=/; Max-Age=0; SameSite=Lax`;
1372
+ if (accepted) return candidate;
1373
+ } catch {
1374
+ return void 0;
1375
+ }
1376
+ }
1377
+ return void 0;
1378
+ }
1348
1379
  function detectDefaultStorage() {
1349
1380
  try {
1350
1381
  const ls = globalThis.localStorage;
@@ -2677,7 +2708,7 @@ var BreadcrumbBuffer = class {
2677
2708
 
2678
2709
  // src/_diagnostic-telemetry.ts
2679
2710
  var DIAGNOSTIC_TELEMETRY_ENDPOINT = "https://api.cross-deck.com/v1/events";
2680
- var DIAGNOSTIC_TELEMETRY_PUBLISHABLE_KEY = "cd_pub_live_9490e7aa029c432abf";
2711
+ var DIAGNOSTIC_TELEMETRY_PUBLISHABLE_KEY = "cd_pub_live_eea2f84dbb834a45b7";
2681
2712
  function isDiagnosticTelemetryEnabled() {
2682
2713
  return !DIAGNOSTIC_TELEMETRY_PUBLISHABLE_KEY.startsWith(
2683
2714
  "cd_pub_RELIABILITY_PLACEHOLDER"
@@ -4624,7 +4655,7 @@ var CrossdeckClient = class {
4624
4655
  const effectiveStorage = persistIdentity ? storage : new MemoryStorage();
4625
4656
  const useCookieRedundancy = persistIdentity && !options.storage && // honour caller's adapter choice
4626
4657
  typeof globalThis.document !== "undefined";
4627
- const cookieStore = useCookieRedundancy ? new CookieStorage() : void 0;
4658
+ const cookieStore = useCookieRedundancy ? new CookieStorage({ domain: resolveCookieDomain(options.cookieDomain ?? "auto") }) : void 0;
4628
4659
  const identity = new IdentityStore(effectiveStorage, opts.storagePrefix, cookieStore);
4629
4660
  const entitlements = new EntitlementCache(
4630
4661
  effectiveStorage,
@@ -5574,7 +5605,7 @@ var CrossdeckClient = class {
5574
5605
  }
5575
5606
  }
5576
5607
  this.state.autoTracker?.uninstall();
5577
- this.state.identity.reset();
5608
+ if (this.state.developerUserId) this.state.identity.reset();
5578
5609
  bridgeReadCost({ actor: void 0 });
5579
5610
  this.state.entitlements.clearAll();
5580
5611
  this.state.events.reset();