@cross-deck/web 1.6.3 → 1.7.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.
- package/CHANGELOG.md +46 -29
- package/dist/contracts.json +12 -12
- package/dist/crossdeck.umd.min.js +2 -2
- package/dist/crossdeck.umd.min.js.map +1 -1
- package/dist/error-codes.json +1 -1
- package/dist/index.cjs +110 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +110 -23
- package/dist/index.mjs.map +1 -1
- package/dist/react.cjs +99 -12
- package/dist/react.cjs.map +1 -1
- package/dist/react.mjs +99 -12
- package/dist/react.mjs.map +1 -1
- package/dist/vue.cjs +99 -12
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.mjs +99 -12
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -247,9 +247,9 @@ declare const CrossdeckContracts: {
|
|
|
247
247
|
/** Filter by lifecycle status. */
|
|
248
248
|
readonly withStatus: (status: ContractStatus) => readonly Contract[];
|
|
249
249
|
/** Semver of the SDK release these contracts were bundled with. */
|
|
250
|
-
readonly sdkVersion: "1.
|
|
250
|
+
readonly sdkVersion: "1.7.0";
|
|
251
251
|
/** Fully-qualified bundle identifier — e.g. `@cross-deck/web@1.4.2`. */
|
|
252
|
-
readonly bundledIn: "@cross-deck/web@1.
|
|
252
|
+
readonly bundledIn: "@cross-deck/web@1.7.0";
|
|
253
253
|
/**
|
|
254
254
|
* Resolve a failing test back to the contract it exercises.
|
|
255
255
|
* Used by test-framework hooks (Vitest `afterEach`, XCTest
|
|
@@ -936,7 +936,7 @@ declare class MemoryStorage implements KeyValueStorage {
|
|
|
936
936
|
*
|
|
937
937
|
* Do NOT edit by hand — `node scripts/sync-sdk-versions.mjs`.
|
|
938
938
|
*/
|
|
939
|
-
declare const SDK_VERSION = "1.
|
|
939
|
+
declare const SDK_VERSION = "1.7.0";
|
|
940
940
|
declare const SDK_NAME = "@cross-deck/web";
|
|
941
941
|
|
|
942
942
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -247,9 +247,9 @@ declare const CrossdeckContracts: {
|
|
|
247
247
|
/** Filter by lifecycle status. */
|
|
248
248
|
readonly withStatus: (status: ContractStatus) => readonly Contract[];
|
|
249
249
|
/** Semver of the SDK release these contracts were bundled with. */
|
|
250
|
-
readonly sdkVersion: "1.
|
|
250
|
+
readonly sdkVersion: "1.7.0";
|
|
251
251
|
/** Fully-qualified bundle identifier — e.g. `@cross-deck/web@1.4.2`. */
|
|
252
|
-
readonly bundledIn: "@cross-deck/web@1.
|
|
252
|
+
readonly bundledIn: "@cross-deck/web@1.7.0";
|
|
253
253
|
/**
|
|
254
254
|
* Resolve a failing test back to the contract it exercises.
|
|
255
255
|
* Used by test-framework hooks (Vitest `afterEach`, XCTest
|
|
@@ -936,7 +936,7 @@ declare class MemoryStorage implements KeyValueStorage {
|
|
|
936
936
|
*
|
|
937
937
|
* Do NOT edit by hand — `node scripts/sync-sdk-versions.mjs`.
|
|
938
938
|
*/
|
|
939
|
-
declare const SDK_VERSION = "1.
|
|
939
|
+
declare const SDK_VERSION = "1.7.0";
|
|
940
940
|
declare const SDK_NAME = "@cross-deck/web";
|
|
941
941
|
|
|
942
942
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -64,7 +64,7 @@ function typeMapForStatus(status) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
// src/_version.ts
|
|
67
|
-
var SDK_VERSION = "1.
|
|
67
|
+
var SDK_VERSION = "1.7.0";
|
|
68
68
|
var SDK_NAME = "@cross-deck/web";
|
|
69
69
|
|
|
70
70
|
// src/http.ts
|
|
@@ -980,9 +980,13 @@ var EventQueue = class {
|
|
|
980
980
|
const env = this.cfg.envelope();
|
|
981
981
|
const result = await this.cfg.http.request("POST", "/events", {
|
|
982
982
|
body: {
|
|
983
|
-
//
|
|
984
|
-
//
|
|
985
|
-
//
|
|
983
|
+
// Event Envelope v1 batch envelope (backend/docs/
|
|
984
|
+
// event-envelope-spec-v1.md §1). `envelopeVersion` is the
|
|
985
|
+
// schema/wire version the server parses against ("can I parse
|
|
986
|
+
// this?") and is DISTINCT from `sdk.version` ("which build is in
|
|
987
|
+
// the wild?") — two questions, two fields, never conflated. The
|
|
988
|
+
// backend refuses payloads with a missing/unknown envelopeVersion.
|
|
989
|
+
envelopeVersion: 1,
|
|
986
990
|
appId: env.appId,
|
|
987
991
|
environment: env.environment,
|
|
988
992
|
sdk: env.sdk,
|
|
@@ -1437,6 +1441,15 @@ var AutoTracker = class {
|
|
|
1437
1441
|
this.cleanups = [];
|
|
1438
1442
|
/** Last time we flushed lastActivityAt to storage (throttle gate). */
|
|
1439
1443
|
this.lastPersistAt = 0;
|
|
1444
|
+
/**
|
|
1445
|
+
* Event Envelope v1 §3 — per-session monotonic sequence counter.
|
|
1446
|
+
* The single owner of the seq counter lives here, alongside all other
|
|
1447
|
+
* session state. Incremented atomically at track() time (via nextSeq()),
|
|
1448
|
+
* reset to 0 whenever a new session boundary is crossed (startNewSession
|
|
1449
|
+
* path + resetSession). Persists across background/foreground within a
|
|
1450
|
+
* session — only a real session boundary (not a tab hide/show) resets it.
|
|
1451
|
+
*/
|
|
1452
|
+
this._sessionSeq = 0;
|
|
1440
1453
|
/**
|
|
1441
1454
|
* Stable per-page-view identifier. Minted at every `page.viewed`
|
|
1442
1455
|
* emission and attached to every subsequent event until the next
|
|
@@ -1521,6 +1534,20 @@ var AutoTracker = class {
|
|
|
1521
1534
|
get currentAcquisition() {
|
|
1522
1535
|
return this.session?.acquisition ?? EMPTY_ACQUISITION;
|
|
1523
1536
|
}
|
|
1537
|
+
/**
|
|
1538
|
+
* Event Envelope v1 §3 — return the next seq value for the current session
|
|
1539
|
+
* and advance the counter. Called SYNCHRONOUSLY at track() time, before any
|
|
1540
|
+
* async dispatch, so the seq assignment order is deterministic (call order,
|
|
1541
|
+
* not scheduler luck). The counter is reset to 0 at every session boundary;
|
|
1542
|
+
* it is NOT reset by tab hide/show (spec §3 clause 1: backgrounding does not
|
|
1543
|
+
* reset seq). When no session is active (Node, before init, after uninstall),
|
|
1544
|
+
* returns 0 and leaves the counter unchanged — fallback, not an error.
|
|
1545
|
+
*/
|
|
1546
|
+
nextSeq() {
|
|
1547
|
+
const seq = this._sessionSeq;
|
|
1548
|
+
this._sessionSeq += 1;
|
|
1549
|
+
return seq;
|
|
1550
|
+
}
|
|
1524
1551
|
// ---------- sessions ----------
|
|
1525
1552
|
installSessionTracking() {
|
|
1526
1553
|
const now = Date.now();
|
|
@@ -1572,6 +1599,7 @@ var AutoTracker = class {
|
|
|
1572
1599
|
}
|
|
1573
1600
|
startNewSession() {
|
|
1574
1601
|
const now = Date.now();
|
|
1602
|
+
this._sessionSeq = 0;
|
|
1575
1603
|
return {
|
|
1576
1604
|
sessionId: mintSessionId(),
|
|
1577
1605
|
startedAt: now,
|
|
@@ -2300,6 +2328,40 @@ function writeJson(storage, key, value) {
|
|
|
2300
2328
|
}
|
|
2301
2329
|
}
|
|
2302
2330
|
|
|
2331
|
+
// src/internal-opt-out.ts
|
|
2332
|
+
var INTERNAL_OPT_OUT_PROPERTY = "$crossdeck_internal";
|
|
2333
|
+
var STORAGE_KEY = "crossdeck.internalOptOut";
|
|
2334
|
+
function localStore() {
|
|
2335
|
+
try {
|
|
2336
|
+
return typeof localStorage !== "undefined" ? localStorage : null;
|
|
2337
|
+
} catch {
|
|
2338
|
+
return null;
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
function processInternalOptOutUrl() {
|
|
2342
|
+
try {
|
|
2343
|
+
const search = typeof location !== "undefined" ? location.search : "";
|
|
2344
|
+
const params = new URLSearchParams(search || "");
|
|
2345
|
+
if (!params.has("crossdeck_internal")) return;
|
|
2346
|
+
const store = localStore();
|
|
2347
|
+
if (!store) return;
|
|
2348
|
+
const v = params.get("crossdeck_internal");
|
|
2349
|
+
if (v === "1" || v === "true") {
|
|
2350
|
+
store.setItem(STORAGE_KEY, "1");
|
|
2351
|
+
} else if (v === "0" || v === "false") {
|
|
2352
|
+
store.removeItem(STORAGE_KEY);
|
|
2353
|
+
}
|
|
2354
|
+
} catch {
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
function isInternalOptOut() {
|
|
2358
|
+
try {
|
|
2359
|
+
return localStore()?.getItem(STORAGE_KEY) === "1";
|
|
2360
|
+
} catch {
|
|
2361
|
+
return false;
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2303
2365
|
// src/web-vitals.ts
|
|
2304
2366
|
var WebVitalsTracker = class {
|
|
2305
2367
|
constructor(cfg, report) {
|
|
@@ -3660,18 +3722,18 @@ function isInAppFrame(filename) {
|
|
|
3660
3722
|
if (/\/crossdeck\.umd\.min\.js$/.test(filename)) return false;
|
|
3661
3723
|
return true;
|
|
3662
3724
|
}
|
|
3663
|
-
function fingerprintError(message, frames,
|
|
3725
|
+
function fingerprintError(message, frames, location2) {
|
|
3664
3726
|
const inAppFrames = frames.filter((f) => f.in_app).slice(0, 3);
|
|
3665
3727
|
const parts = [
|
|
3666
3728
|
(message || "").slice(0, 200),
|
|
3667
3729
|
...inAppFrames.map((f) => `${f.function}@${f.filename}:${f.lineno}`)
|
|
3668
3730
|
];
|
|
3669
|
-
if (inAppFrames.length === 0 &&
|
|
3731
|
+
if (inAppFrames.length === 0 && location2) {
|
|
3670
3732
|
const loc = [
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3733
|
+
location2.errorType ?? "",
|
|
3734
|
+
location2.filename ?? "",
|
|
3735
|
+
location2.lineno ?? "",
|
|
3736
|
+
location2.colno ?? ""
|
|
3675
3737
|
].join(":");
|
|
3676
3738
|
if (loc !== ":::") parts.push(loc);
|
|
3677
3739
|
}
|
|
@@ -4517,6 +4579,7 @@ var CrossdeckClient = class {
|
|
|
4517
4579
|
persistIdentity ? effectiveStorage : new MemoryStorage(),
|
|
4518
4580
|
opts.storagePrefix
|
|
4519
4581
|
);
|
|
4582
|
+
processInternalOptOutUrl();
|
|
4520
4583
|
const consent = new ConsentManager({ respectDnt: options.respectDnt === true });
|
|
4521
4584
|
if (consent.isDntDenied) {
|
|
4522
4585
|
debug.emit(
|
|
@@ -5170,8 +5233,27 @@ var CrossdeckClient = class {
|
|
|
5170
5233
|
);
|
|
5171
5234
|
}
|
|
5172
5235
|
}
|
|
5236
|
+
const seq = s.autoTracker?.nextSeq() ?? 0;
|
|
5237
|
+
const occurrenceTimestamp = Date.now();
|
|
5173
5238
|
s.autoTracker?.markActivity();
|
|
5174
|
-
const
|
|
5239
|
+
const wireContext = {};
|
|
5240
|
+
const di = s.deviceInfo;
|
|
5241
|
+
if (di.os) wireContext.os = di.os;
|
|
5242
|
+
if (di.osVersion) wireContext.osVersion = di.osVersion;
|
|
5243
|
+
const appVer = s.options.appVersion;
|
|
5244
|
+
if (appVer) wireContext.appVersion = appVer;
|
|
5245
|
+
wireContext.sdkName = SDK_NAME;
|
|
5246
|
+
wireContext.sdkVersion = s.options.sdkVersion;
|
|
5247
|
+
if (di.locale) wireContext.locale = di.locale;
|
|
5248
|
+
if (di.timezone) wireContext.timezone = di.timezone;
|
|
5249
|
+
if (di.browser) wireContext.browser = di.browser;
|
|
5250
|
+
if (di.browserVersion) wireContext.browserVersion = di.browserVersion;
|
|
5251
|
+
const enriched = {};
|
|
5252
|
+
if (di.screenWidth !== void 0) enriched.screenWidth = di.screenWidth;
|
|
5253
|
+
if (di.screenHeight !== void 0) enriched.screenHeight = di.screenHeight;
|
|
5254
|
+
if (di.viewportWidth !== void 0) enriched.viewportWidth = di.viewportWidth;
|
|
5255
|
+
if (di.viewportHeight !== void 0) enriched.viewportHeight = di.viewportHeight;
|
|
5256
|
+
if (di.devicePixelRatio !== void 0) enriched.devicePixelRatio = di.devicePixelRatio;
|
|
5175
5257
|
const sessionId = s.autoTracker?.currentSessionId;
|
|
5176
5258
|
if (sessionId) enriched.sessionId = sessionId;
|
|
5177
5259
|
const pageviewId = s.autoTracker?.currentPageviewId;
|
|
@@ -5202,11 +5284,16 @@ var CrossdeckClient = class {
|
|
|
5202
5284
|
enriched.$groups = groupIds;
|
|
5203
5285
|
}
|
|
5204
5286
|
Object.assign(enriched, validation.properties);
|
|
5287
|
+
if (isInternalOptOut()) {
|
|
5288
|
+
enriched[INTERNAL_OPT_OUT_PROPERTY] = true;
|
|
5289
|
+
}
|
|
5205
5290
|
const finalProperties = s.scrubPii ? scrubPiiFromProperties(enriched) : enriched;
|
|
5206
5291
|
const event = {
|
|
5207
5292
|
eventId: this.mintEventId(),
|
|
5208
5293
|
name,
|
|
5209
|
-
timestamp:
|
|
5294
|
+
timestamp: occurrenceTimestamp,
|
|
5295
|
+
seq,
|
|
5296
|
+
context: wireContext,
|
|
5210
5297
|
properties: finalProperties
|
|
5211
5298
|
};
|
|
5212
5299
|
Object.assign(event, this.identityHintForEvent());
|
|
@@ -5561,8 +5648,8 @@ function installUnloadFlush(onUnload) {
|
|
|
5561
5648
|
}
|
|
5562
5649
|
|
|
5563
5650
|
// src/_contracts-bundled.ts
|
|
5564
|
-
var BUNDLED_IN = "@cross-deck/web@1.
|
|
5565
|
-
var SDK_VERSION2 = "1.
|
|
5651
|
+
var BUNDLED_IN = "@cross-deck/web@1.7.0";
|
|
5652
|
+
var SDK_VERSION2 = "1.7.0";
|
|
5566
5653
|
var BUNDLED_CONTRACTS = Object.freeze([
|
|
5567
5654
|
{
|
|
5568
5655
|
"id": "contract-failed-payload-schema-lock",
|
|
@@ -5684,7 +5771,7 @@ var BUNDLED_CONTRACTS = Object.freeze([
|
|
|
5684
5771
|
"legal/security/index.html#diagnostic",
|
|
5685
5772
|
"legal/sdk-data/index.html#b-diagnostic"
|
|
5686
5773
|
],
|
|
5687
|
-
"bundledIn": "@cross-deck/web@1.
|
|
5774
|
+
"bundledIn": "@cross-deck/web@1.7.0",
|
|
5688
5775
|
"runtimeVerified": true
|
|
5689
5776
|
},
|
|
5690
5777
|
{
|
|
@@ -5724,7 +5811,7 @@ var BUNDLED_CONTRACTS = Object.freeze([
|
|
|
5724
5811
|
],
|
|
5725
5812
|
"registeredAt": "2026-05-26",
|
|
5726
5813
|
"firstRegisteredIn": "bank-grade reconciliation v1.4.0 \u2014 phase 8 (codifies existing contract)",
|
|
5727
|
-
"bundledIn": "@cross-deck/web@1.
|
|
5814
|
+
"bundledIn": "@cross-deck/web@1.7.0",
|
|
5728
5815
|
"runtimeVerified": true
|
|
5729
5816
|
},
|
|
5730
5817
|
{
|
|
@@ -5770,7 +5857,7 @@ var BUNDLED_CONTRACTS = Object.freeze([
|
|
|
5770
5857
|
],
|
|
5771
5858
|
"registeredAt": "2026-05-26",
|
|
5772
5859
|
"firstRegisteredIn": "bank-grade reconciliation v1.4.0 \u2014 phase 3.3",
|
|
5773
|
-
"bundledIn": "@cross-deck/web@1.
|
|
5860
|
+
"bundledIn": "@cross-deck/web@1.7.0",
|
|
5774
5861
|
"runtimeVerified": true
|
|
5775
5862
|
},
|
|
5776
5863
|
{
|
|
@@ -5876,7 +5963,7 @@ var BUNDLED_CONTRACTS = Object.freeze([
|
|
|
5876
5963
|
],
|
|
5877
5964
|
"registeredAt": "2026-05-26",
|
|
5878
5965
|
"firstRegisteredIn": "bank-grade reconciliation v1.4.0 \u2014 phase 2.2.a + 2.2.b + 2.2.c",
|
|
5879
|
-
"bundledIn": "@cross-deck/web@1.
|
|
5966
|
+
"bundledIn": "@cross-deck/web@1.7.0",
|
|
5880
5967
|
"runtimeVerified": true
|
|
5881
5968
|
},
|
|
5882
5969
|
{
|
|
@@ -5904,7 +5991,7 @@ var BUNDLED_CONTRACTS = Object.freeze([
|
|
|
5904
5991
|
],
|
|
5905
5992
|
"registeredAt": "2026-05-26",
|
|
5906
5993
|
"firstRegisteredIn": "bank-grade reconciliation v1.4.0 \u2014 phase 5.5",
|
|
5907
|
-
"bundledIn": "@cross-deck/web@1.
|
|
5994
|
+
"bundledIn": "@cross-deck/web@1.7.0",
|
|
5908
5995
|
"runtimeVerified": false
|
|
5909
5996
|
},
|
|
5910
5997
|
{
|
|
@@ -5984,7 +6071,7 @@ var BUNDLED_CONTRACTS = Object.freeze([
|
|
|
5984
6071
|
],
|
|
5985
6072
|
"registeredAt": "2026-05-26",
|
|
5986
6073
|
"firstRegisteredIn": "bank-grade reconciliation v1.4.0 \u2014 phase 1.3 (web/RN) + dogfood-gap fix (swift + android)",
|
|
5987
|
-
"bundledIn": "@cross-deck/web@1.
|
|
6074
|
+
"bundledIn": "@cross-deck/web@1.7.0",
|
|
5988
6075
|
"runtimeVerified": true
|
|
5989
6076
|
},
|
|
5990
6077
|
{
|
|
@@ -6030,7 +6117,7 @@ var BUNDLED_CONTRACTS = Object.freeze([
|
|
|
6030
6117
|
],
|
|
6031
6118
|
"registeredAt": "2026-05-26",
|
|
6032
6119
|
"firstRegisteredIn": "bank-grade reconciliation v1.4.0 \u2014 phase 6.2",
|
|
6033
|
-
"bundledIn": "@cross-deck/web@1.
|
|
6120
|
+
"bundledIn": "@cross-deck/web@1.7.0",
|
|
6034
6121
|
"runtimeVerified": true
|
|
6035
6122
|
},
|
|
6036
6123
|
{
|
|
@@ -6072,7 +6159,7 @@ var BUNDLED_CONTRACTS = Object.freeze([
|
|
|
6072
6159
|
],
|
|
6073
6160
|
"registeredAt": "2026-05-26",
|
|
6074
6161
|
"firstRegisteredIn": "bank-grade reconciliation v1.4.0 \u2014 phase 3.2",
|
|
6075
|
-
"bundledIn": "@cross-deck/web@1.
|
|
6162
|
+
"bundledIn": "@cross-deck/web@1.7.0",
|
|
6076
6163
|
"runtimeVerified": true
|
|
6077
6164
|
},
|
|
6078
6165
|
{
|
|
@@ -6106,7 +6193,7 @@ var BUNDLED_CONTRACTS = Object.freeze([
|
|
|
6106
6193
|
],
|
|
6107
6194
|
"registeredAt": "2026-05-26",
|
|
6108
6195
|
"firstRegisteredIn": "bank-grade reconciliation v1.4.0 \u2014 phase 3.5",
|
|
6109
|
-
"bundledIn": "@cross-deck/web@1.
|
|
6196
|
+
"bundledIn": "@cross-deck/web@1.7.0",
|
|
6110
6197
|
"runtimeVerified": false
|
|
6111
6198
|
}
|
|
6112
6199
|
]);
|