@cross-deck/node 1.5.2 → 1.6.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 CHANGED
@@ -4,6 +4,37 @@ All notable changes to `@cross-deck/node` will be documented here. The
4
4
  format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.6.0] — 2026-06-10
8
+
9
+ Event Envelope v1 conformance — server-enforced contract (spec
10
+ `backend/docs/event-envelope-spec-v1.md`).
11
+
12
+ **Added:**
13
+
14
+ - **`envelopeVersion: 1`** (integer) on every batch POST body. Both the
15
+ queue-flush path (`EventQueue.flush()`) and the direct `ingest()` path
16
+ now emit this field. The server will reject payloads missing this field
17
+ once ingest enforcement lands.
18
+ - **`seq`** (number) on every wire event — per-session monotonic sequence
19
+ number. Captured synchronously with the event's `timestamp` at
20
+ `track()` / enqueue time. Counter starts at 0 when the `CrossdeckServer`
21
+ instance is constructed (session start) and increments once per event.
22
+ Matches spec §3: monotonic within a session, never reset between
23
+ background/foreground (Node has no such lifecycle; the instance lifetime
24
+ IS the session).
25
+ - **`context`** (object) on every wire event — standardized device/platform
26
+ context (spec §4), promoted out of `properties`. Common fields: `os`,
27
+ `osVersion`, `appVersion`, `sdkName`, `sdkVersion`, `locale`, `timezone`.
28
+ Node-specific: `nodeVersion`, `host`, `region` (the existing
29
+ `runtime.*` props, promoted).
30
+
31
+ **Changed:**
32
+
33
+ - `track()` no longer merges `runtime.*` keys into `properties`. Those
34
+ facts now live in the top-level `context` object on the wire event.
35
+ Super-properties registered via `server.register()` continue to appear
36
+ in `properties` unchanged (caller-supplied values are unaffected).
37
+
7
38
  ## [1.5.1] — 2026-05-27
8
39
 
9
40
  `crossdeck.contract_failed` is now single-fire to a dedicated
@@ -1,4 +1,4 @@
1
- import { p as CrossdeckServer } from '../crossdeck-server-DhnHvUhh.mjs';
1
+ import { w as CrossdeckServer } from '../crossdeck-server-C1Ue0rv4.mjs';
2
2
  import 'node:events';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { p as CrossdeckServer } from '../crossdeck-server-DhnHvUhh.js';
1
+ import { w as CrossdeckServer } from '../crossdeck-server-C1Ue0rv4.js';
2
2
  import 'node:events';
3
3
 
4
4
  /**
@@ -0,0 +1,557 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "generatedAt": "2026-06-10T12:59:27.493Z",
4
+ "sdk": "@cross-deck/node",
5
+ "sdkVersion": "1.6.0",
6
+ "bundledIn": "@cross-deck/node@1.6.0",
7
+ "count": 10,
8
+ "contracts": [
9
+ {
10
+ "id": "contract-failed-payload-schema-lock",
11
+ "pillar": "diagnostics",
12
+ "status": "enforced",
13
+ "claim": "The `crossdeck.contract_failed` event payload contains ONLY the named diagnostic fields and never any end-user personal data. The wire shape is fixed — adding a new field requires (1) a pull request that updates this contract's `allowedFields` set, (2) a Privacy Policy §6 amendment, and (3) the Customer Disclosure Template / SDK Data Collection Reference §B updates. Per-SDK assertion tests enforce the field set on every release. The `verification_phase` field is a categorical bucket — values are restricted to `boot` (the SDK self-test ran on Crossdeck.start) or `hot_path` (a verifier observed a real customer-triggered operation). The categorical nature is what preserves the diagnostic-only-not-personal classification. This is the structural guarantee that backs the independent-controller lawful basis in the Privacy Policy: the payload remains diagnostic-only, not personal, so the legitimate-interest analysis stays valid as the SDK evolves.",
14
+ "appliesTo": [
15
+ "web",
16
+ "node",
17
+ "swift",
18
+ "android",
19
+ "react-native"
20
+ ],
21
+ "allowedFields": {
22
+ "required": [
23
+ "contract_id",
24
+ "sdk_version",
25
+ "sdk_platform",
26
+ "failure_reason",
27
+ "run_context",
28
+ "run_id"
29
+ ],
30
+ "optional": [
31
+ "test_file",
32
+ "test_name",
33
+ "device_class",
34
+ "verification_phase"
35
+ ],
36
+ "forbidden": [
37
+ "anonymousId",
38
+ "developerUserId",
39
+ "crossdeckCustomerId",
40
+ "email",
41
+ "ip",
42
+ "user_agent",
43
+ "message",
44
+ "stack",
45
+ "stack_trace",
46
+ "frames",
47
+ "exception_message",
48
+ "url",
49
+ "path",
50
+ "screen",
51
+ "title",
52
+ "label",
53
+ "text",
54
+ "ariaLabel",
55
+ "accessibilityLabel",
56
+ "contentDescription",
57
+ "session_id",
58
+ "sessionId"
59
+ ]
60
+ },
61
+ "transport": "Telemetry is single-fire to the Crossdeck reliability endpoint only — NOT the customer's appId. The customer's track() pipeline never carries `crossdeck.*` events; the customer's dashboard never shows individual contract failures. Operational telemetry flows one-way to the Crossdeck operations team for SDK reliability purposes (legitimate interest, independent-controller flow per Privacy Policy §6). The reliability endpoint is hardcoded at SDK build time; the publishable key for the reliability project is embedded as a constant and rejects writes that don't match the schema.",
62
+ "codeRef": [
63
+ "sdks/web/src/crossdeck.ts",
64
+ "sdks/node/src/crossdeck-server.ts",
65
+ "sdks/swift/Sources/Crossdeck/Crossdeck.swift",
66
+ "sdks/swift/Sources/Crossdeck/_DiagnosticTelemetry.swift",
67
+ "sdks/android/crossdeck/src/main/kotlin/com/crossdeck/Crossdeck.kt",
68
+ "sdks/android/crossdeck/src/main/kotlin/com/crossdeck/_DiagnosticTelemetry.kt",
69
+ "sdks/react-native/src/crossdeck.ts",
70
+ "backend/src/api/v1-sdk-diagnostic.ts",
71
+ "sdks/web/src/_diagnostic-telemetry.ts",
72
+ "sdks/node/src/_diagnostic-telemetry.ts",
73
+ "sdks/react-native/src/_diagnostic-telemetry.ts"
74
+ ],
75
+ "testRef": [
76
+ {
77
+ "file": "sdks/web/tests/contract-failed-schema-lock.test.ts",
78
+ "name": "reportContractFailure payload conforms to schema-lock"
79
+ },
80
+ {
81
+ "file": "sdks/node/tests/contract-failed-schema-lock.test.ts",
82
+ "name": "reportContractFailure payload conforms to schema-lock"
83
+ },
84
+ {
85
+ "file": "sdks/swift/Tests/CrossdeckTests/ContractFailedSchemaLockTests.swift",
86
+ "name": "test_reportContractFailure_payloadFieldsAreInAllowList"
87
+ },
88
+ {
89
+ "file": "sdks/swift/Tests/CrossdeckTests/ContractFailedSchemaLockTests.swift",
90
+ "name": "test_reportContractFailure_doesNotEnterCustomerTrackPipeline"
91
+ },
92
+ {
93
+ "file": "sdks/android/crossdeck/src/test/kotlin/com/crossdeck/ContractFailedSchemaLockTest.kt",
94
+ "name": "reportContractFailure payload conforms to schema-lock"
95
+ },
96
+ {
97
+ "file": "sdks/android/crossdeck/src/test/kotlin/com/crossdeck/ContractFailedSchemaLockTest.kt",
98
+ "name": "reportContractFailure does not enter customer track pipeline"
99
+ },
100
+ {
101
+ "file": "sdks/react-native/tests/contract-failed-schema-lock.test.ts",
102
+ "name": "reportContractFailure payload conforms to schema-lock"
103
+ },
104
+ {
105
+ "file": "backend/tests/unit/v1-sdk-diagnostic.test.ts",
106
+ "name": "forbidden fields are enumerated in the schema-lock contract"
107
+ },
108
+ {
109
+ "file": "backend/tests/unit/v1-sdk-diagnostic.test.ts",
110
+ "name": "required fields are enumerated in the schema-lock contract"
111
+ },
112
+ {
113
+ "file": "backend/tests/unit/v1-sdk-diagnostic.test.ts",
114
+ "name": "regression guard: never returns a raw IP"
115
+ },
116
+ {
117
+ "file": "backend/tests/unit/v1-sdk-diagnostic.test.ts",
118
+ "name": "verification_phase is in the optional field set"
119
+ }
120
+ ],
121
+ "registeredAt": "2026-05-27",
122
+ "firstRegisteredIn": "Diagnostic telemetry single-fire + schema-lock — independent-controller flow",
123
+ "privacyReferences": [
124
+ "legal/privacy/index.html#sdk-diagnostic",
125
+ "legal/customer-disclosure/index.html#flow-b",
126
+ "legal/security/index.html#diagnostic",
127
+ "legal/sdk-data/index.html#b-diagnostic"
128
+ ],
129
+ "bundledIn": "@cross-deck/node@1.6.0"
130
+ },
131
+ {
132
+ "id": "documentation-honesty",
133
+ "pillar": "webhooks",
134
+ "status": "enforced",
135
+ "claim": "Customer-facing documentation honestly tags outbound webhook delivery as ROADMAP (no signer, no worker, no scheduler in backend/src yet). The Node verifier helper exists today for fixture authoring + locking the validation contract surface BEFORE delivery ships — its jsdoc carries an explicit `[ROADMAP]` disclaimer so a developer reading the source doesn't assume Crossdeck sends webhooks today. The rail-webhooks doc no longer claims state surfaces 'through the dashboard, SDKs, and outbound webhooks' — outbound is gated to the explicit roadmap section.",
136
+ "appliesTo": [
137
+ "node",
138
+ "backend"
139
+ ],
140
+ "codeRef": [
141
+ "sdks/node/src/webhooks.ts",
142
+ "docs/rail-webhooks/index.html",
143
+ "docs/webhooks-receive/index.html"
144
+ ],
145
+ "testRef": [
146
+ {
147
+ "file": "sdks/node/src/webhooks.ts",
148
+ "name": "[ROADMAP — v1.4.0 honesty note]"
149
+ },
150
+ {
151
+ "file": "docs/rail-webhooks/index.html",
152
+ "name": "Outbound push-to-your-backend webhooks are <strong>roadmap</strong>"
153
+ },
154
+ {
155
+ "file": "docs/webhooks-receive/index.html",
156
+ "name": "This feature is on the roadmap"
157
+ }
158
+ ],
159
+ "registeredAt": "2026-05-26",
160
+ "firstRegisteredIn": "bank-grade reconciliation v1.4.0 — phase 7.1",
161
+ "bundledIn": "@cross-deck/node@1.6.0"
162
+ },
163
+ {
164
+ "id": "error-envelope-shape",
165
+ "pillar": "errors",
166
+ "status": "enforced",
167
+ "claim": "Every v1 REST endpoint returns errors in a Stripe-shape envelope: `{ error: { type, code, message, request_id } }` where `type` is one of authentication_error / permission_error / invalid_request_error / rate_limit_error / internal_error (the wire vocabulary in backend/src/api/v1-errors.ts ApiErrorType). HTTP status parity: invalid_request_error → 400, authentication_error → 401, permission_error → 403, rate_limit_error → 429, internal_error → 500. SDK-side clients parse this shape via `crossdeckErrorFromResponse` (Web/Node/RN) / `crossdeckErrorFrom(response:)` (Swift) / `crossdeckErrorFromResponse` (Android) and surface the request_id verbatim so support traces are end-to-end joinable. Firebase callable endpoints (managed-keys / dashboard auth) use the Firebase HttpsError envelope instead — this contract applies to REST /v1/* only.",
168
+ "appliesTo": [
169
+ "web",
170
+ "node",
171
+ "react-native",
172
+ "swift",
173
+ "android",
174
+ "backend"
175
+ ],
176
+ "codeRef": [
177
+ "backend/src/api/v1-errors.ts",
178
+ "sdks/web/src/errors.ts",
179
+ "sdks/node/src/errors.ts",
180
+ "sdks/react-native/src/errors.ts",
181
+ "sdks/swift/Sources/Crossdeck/Errors.swift",
182
+ "sdks/android/crossdeck/src/main/kotlin/com/crossdeck/Errors.kt"
183
+ ],
184
+ "testRef": [
185
+ {
186
+ "file": "sdks/swift/Tests/CrossdeckTests/ErrorsTests.swift",
187
+ "name": "test_errorEnvelope_fallsBackOnGarbageBody"
188
+ },
189
+ {
190
+ "file": "sdks/swift/Tests/CrossdeckTests/ErrorsTests.swift",
191
+ "name": "test_errorEnvelope_reads_XRequestId_fallback"
192
+ },
193
+ {
194
+ "file": "sdks/android/crossdeck/src/test/kotlin/com/crossdeck/ErrorTypeWireVocabTest.kt",
195
+ "name": "backend 500 response parses to INTERNAL_ERROR"
196
+ }
197
+ ],
198
+ "registeredAt": "2026-05-26",
199
+ "firstRegisteredIn": "bank-grade reconciliation v1.4.0 — phase 8 (codifies existing contract)",
200
+ "bundledIn": "@cross-deck/node@1.6.0"
201
+ },
202
+ {
203
+ "id": "flush-interval-parity",
204
+ "pillar": "analytics",
205
+ "status": "enforced",
206
+ "claim": "Every Crossdeck SDK defaults its event-queue flush interval to 2000ms — the Stripe-adjacent industry norm. Pre-v1.4.0 the defaults disagreed (Web/Node 1500ms; RN/Swift/Android 5000ms), so cross-platform funnels saw events landing at different cadences. Per-instance override stays — call sites can still tune it freely.",
207
+ "appliesTo": [
208
+ "web",
209
+ "node",
210
+ "react-native",
211
+ "swift",
212
+ "android"
213
+ ],
214
+ "codeRef": [
215
+ "sdks/web/src/crossdeck.ts",
216
+ "sdks/node/src/crossdeck-server.ts",
217
+ "sdks/react-native/src/crossdeck.ts",
218
+ "sdks/swift/Sources/Crossdeck/EventQueue.swift",
219
+ "sdks/android/crossdeck/src/main/kotlin/com/crossdeck/EventQueue.kt"
220
+ ],
221
+ "testRef": [
222
+ {
223
+ "file": "sdks/swift/Sources/Crossdeck/EventQueue.swift",
224
+ "name": "flushIntervalMs: Int = 2_000"
225
+ },
226
+ {
227
+ "file": "sdks/android/crossdeck/src/main/kotlin/com/crossdeck/EventQueue.kt",
228
+ "name": "flushIntervalMs: Long = 2_000L"
229
+ },
230
+ {
231
+ "file": "sdks/web/src/crossdeck.ts",
232
+ "name": "options.eventFlushIntervalMs ?? 2000"
233
+ },
234
+ {
235
+ "file": "sdks/node/src/crossdeck-server.ts",
236
+ "name": "options.eventFlushIntervalMs ?? 2000"
237
+ },
238
+ {
239
+ "file": "sdks/react-native/src/crossdeck.ts",
240
+ "name": "options.eventFlushIntervalMs ?? 2000"
241
+ }
242
+ ],
243
+ "registeredAt": "2026-05-26",
244
+ "firstRegisteredIn": "bank-grade reconciliation v1.4.0 — phase 3.3",
245
+ "bundledIn": "@cross-deck/node@1.6.0"
246
+ },
247
+ {
248
+ "id": "idempotency-key-deterministic",
249
+ "pillar": "revenue",
250
+ "status": "enforced",
251
+ "claim": "syncPurchases() on every SDK derives a deterministic Idempotency-Key from the request body (UUID-shaped SHA-256 of `crossdeck:purchases/sync:<rail>:<jws|token>`). Same input -> same key. Backend short-circuits same-key-same-body retries by returning the cached response (status + body) with `idempotent_replay: true` flag in the body AND `Idempotent-Replayed: true` response header. Same-key-different-body returns 400 `idempotency_key_in_use`. 24-hour TTL matches Stripe. Cache only stores 2xx responses — 4xx/5xx pass through so callers can fix bugs and retry. Helper returns nil/throws on missing identifier (no silent random fallback). Cross-SDK parity is CI-pinned: deriveForPurchase('apple', 'eyJ.jws.sig') MUST equal 'a66b1640-efaf-bb4d-1261-6650033bf111' on every SDK.",
252
+ "appliesTo": [
253
+ "web",
254
+ "node",
255
+ "react-native",
256
+ "swift",
257
+ "android",
258
+ "backend"
259
+ ],
260
+ "codeRef": [
261
+ "sdks/web/src/idempotency-key.ts",
262
+ "sdks/web/src/crossdeck.ts",
263
+ "sdks/react-native/src/idempotency-key.ts",
264
+ "sdks/react-native/src/crossdeck.ts",
265
+ "sdks/node/src/idempotency-key.ts",
266
+ "sdks/node/src/crossdeck-server.ts",
267
+ "sdks/swift/Sources/Crossdeck/IdempotencyKey.swift",
268
+ "sdks/swift/Sources/Crossdeck/Crossdeck.swift",
269
+ "sdks/android/crossdeck/src/main/kotlin/com/crossdeck/IdempotencyKey.kt",
270
+ "sdks/android/crossdeck/src/main/kotlin/com/crossdeck/Crossdeck.kt",
271
+ "backend/src/lib/idempotency-response-cache.ts",
272
+ "backend/src/api/v1-purchases.ts"
273
+ ],
274
+ "testRef": [
275
+ {
276
+ "file": "sdks/web/tests/idempotency-key.test.ts",
277
+ "name": "cross-SDK oracle — apple JWS pins canonical vector"
278
+ },
279
+ {
280
+ "file": "sdks/web/tests/idempotency-key.test.ts",
281
+ "name": "is deterministic: same body twice -> identical key"
282
+ },
283
+ {
284
+ "file": "sdks/web/tests/idempotency-key.test.ts",
285
+ "name": "same identifier under different rails -> different keys"
286
+ },
287
+ {
288
+ "file": "sdks/web/tests/idempotency-key.test.ts",
289
+ "name": "never silently falls back to a random key on missing identifier"
290
+ },
291
+ {
292
+ "file": "sdks/react-native/tests/idempotency-key.test.ts",
293
+ "name": "is deterministic"
294
+ },
295
+ {
296
+ "file": "sdks/react-native/tests/idempotency-key.test.ts",
297
+ "name": "cross-SDK oracle — apple JWS pins canonical vector"
298
+ },
299
+ {
300
+ "file": "sdks/node/tests/idempotency-key.test.ts",
301
+ "name": "is deterministic"
302
+ },
303
+ {
304
+ "file": "sdks/node/tests/idempotency-key.test.ts",
305
+ "name": "rail namespacing prevents cross-rail collisions"
306
+ },
307
+ {
308
+ "file": "sdks/node/tests/idempotency-key.test.ts",
309
+ "name": "apple JWS produces the canonical pinned UUID across all 5 SDKs"
310
+ },
311
+ {
312
+ "file": "backend/tests/unit/idempotency-response-cache.test.ts",
313
+ "name": "is deterministic for the same input"
314
+ },
315
+ {
316
+ "file": "backend/tests/unit/idempotency-response-cache.test.ts",
317
+ "name": "injects idempotent_replay: true into a JSON object body"
318
+ },
319
+ {
320
+ "file": "backend/tests/unit/idempotency-response-cache.test.ts",
321
+ "name": "matches Stripe's 24-hour idempotency window"
322
+ },
323
+ {
324
+ "file": "sdks/swift/Tests/CrossdeckTests/IdempotencyKeyTests.swift",
325
+ "name": "test_crossSdkOracle_appleJWS"
326
+ },
327
+ {
328
+ "file": "sdks/swift/Tests/CrossdeckTests/IdempotencyKeyTests.swift",
329
+ "name": "test_railNamespacing_preventsCrossRailCollisions"
330
+ },
331
+ {
332
+ "file": "sdks/swift/Tests/CrossdeckTests/IdempotencyKeyTests.swift",
333
+ "name": "test_missingIdentifier_returnsNil"
334
+ },
335
+ {
336
+ "file": "sdks/android/crossdeck/src/test/kotlin/com/crossdeck/IdempotencyKeyTest.kt",
337
+ "name": "cross-SDK oracle for apple JWS"
338
+ },
339
+ {
340
+ "file": "sdks/android/crossdeck/src/test/kotlin/com/crossdeck/IdempotencyKeyTest.kt",
341
+ "name": "rail namespacing prevents cross-rail collisions"
342
+ },
343
+ {
344
+ "file": "sdks/android/crossdeck/src/test/kotlin/com/crossdeck/IdempotencyKeyTest.kt",
345
+ "name": "missing identifier returns null - never silent random fallback"
346
+ }
347
+ ],
348
+ "registeredAt": "2026-05-26",
349
+ "firstRegisteredIn": "bank-grade reconciliation v1.4.0 — phase 2.2.a + 2.2.b + 2.2.c",
350
+ "bundledIn": "@cross-deck/node@1.6.0"
351
+ },
352
+ {
353
+ "id": "node-pii-scrubber",
354
+ "pillar": "analytics",
355
+ "status": "enforced",
356
+ "claim": "Node SDK's track() applies scrubPiiFromProperties on the enqueue path — parity with Web/RN/Swift. Pre-v1.4.0 the Node SDK was the ONLY one that skipped this, shipping every track() payload UNREDACTED despite the README promising parity. CrossdeckServerOptions.scrubPii defaults to true; explicit false opts out for regulator-required audit trails with a documented blast-radius warning.",
357
+ "appliesTo": [
358
+ "node"
359
+ ],
360
+ "codeRef": [
361
+ "sdks/node/src/crossdeck-server.ts",
362
+ "sdks/node/src/types.ts",
363
+ "sdks/node/src/consent.ts"
364
+ ],
365
+ "testRef": [
366
+ {
367
+ "file": "sdks/node/tests/track-pii-scrub.test.ts",
368
+ "name": "by default redacts email-shaped values to <email>"
369
+ },
370
+ {
371
+ "file": "sdks/node/tests/track-pii-scrub.test.ts",
372
+ "name": "redacts card-number-shaped values to <card>"
373
+ },
374
+ {
375
+ "file": "sdks/node/tests/track-pii-scrub.test.ts",
376
+ "name": "walks nested maps + arrays"
377
+ },
378
+ {
379
+ "file": "sdks/node/tests/track-pii-scrub.test.ts",
380
+ "name": "scrubPii: false preserves the raw payload (opt-out)"
381
+ },
382
+ {
383
+ "file": "sdks/node/tests/track-pii-scrub.test.ts",
384
+ "name": "scrubPii: true is the default when option is omitted"
385
+ }
386
+ ],
387
+ "registeredAt": "2026-05-26",
388
+ "firstRegisteredIn": "bank-grade reconciliation v1.4.0 — phase 3.1",
389
+ "bundledIn": "@cross-deck/node@1.6.0"
390
+ },
391
+ {
392
+ "id": "node-shutdown-awaits-flush",
393
+ "pillar": "lifecycle",
394
+ "status": "enforced",
395
+ "claim": "Node SDK's async shutdown() awaits the internal flush() before tearing down the queue. A queue with pending events at sync-shutdown time (shutdownSync() or [Symbol.dispose]) logs a console.warn with the dropped-event count — silent loss is incompatible with the bank-grade contract. [Symbol.asyncDispose] is equivalent to await server.shutdown().",
396
+ "appliesTo": [
397
+ "node"
398
+ ],
399
+ "codeRef": [
400
+ "sdks/node/src/crossdeck-server.ts"
401
+ ],
402
+ "testRef": [
403
+ {
404
+ "file": "sdks/node/tests/shutdown-flush.test.ts",
405
+ "name": "async shutdown() flushes queued events before clearing"
406
+ },
407
+ {
408
+ "file": "sdks/node/tests/shutdown-flush.test.ts",
409
+ "name": "async shutdown() proceeds with teardown even if flush fails"
410
+ },
411
+ {
412
+ "file": "sdks/node/tests/shutdown-flush.test.ts",
413
+ "name": "sync shutdownSync() warns when the buffer has events at teardown"
414
+ },
415
+ {
416
+ "file": "sdks/node/tests/shutdown-flush.test.ts",
417
+ "name": "[Symbol.asyncDispose] equals await server.shutdown()"
418
+ }
419
+ ],
420
+ "registeredAt": "2026-05-26",
421
+ "firstRegisteredIn": "bank-grade reconciliation v1.4.0 — phase 5.4",
422
+ "bundledIn": "@cross-deck/node@1.6.0"
423
+ },
424
+ {
425
+ "id": "sdk-error-codes-catalogue",
426
+ "pillar": "errors",
427
+ "status": "enforced",
428
+ "claim": "Web + Node SDK error-codes catalogues include EVERY backend-emitted ApiErrorCode with a description + resolution. Pre-v1.4.0 the catalogues documented codes the SDK threw ITSELF but ZERO backend codes — a developer hitting `invalid_api_key` / `origin_not_allowed` / `bundle_id_not_allowed` / `env_mismatch` / `idempotency_key_in_use` etc. got `undefined` from getErrorCode() and had to hunt for guidance. v1.4.0 backfills the catalogue from backend/src/api/v1-errors.ts so every wire code has a canonical 'what does this mean / what should I do' answer Stripe-style.",
429
+ "appliesTo": [
430
+ "web",
431
+ "node"
432
+ ],
433
+ "codeRef": [
434
+ "sdks/web/src/error-codes.ts",
435
+ "sdks/node/src/error-codes.ts",
436
+ "sdks/web/src/_contract-verifiers.ts",
437
+ "backend/src/api/v1-errors.ts"
438
+ ],
439
+ "testRef": [
440
+ {
441
+ "file": "sdks/web/tests/contract-verifiers.test.ts",
442
+ "name": "sdk-error-codes-catalogue covers every backend wire code with remediation"
443
+ },
444
+ {
445
+ "file": "sdks/web/tests/error-codes-backfill.test.ts",
446
+ "name": "includes backend code"
447
+ },
448
+ {
449
+ "file": "sdks/web/tests/error-codes-backfill.test.ts",
450
+ "name": "invalid_api_key resolution points at the dashboard"
451
+ },
452
+ {
453
+ "file": "sdks/web/tests/error-codes-backfill.test.ts",
454
+ "name": "idempotency_key_in_use resolution mentions Stripe-grade contract"
455
+ },
456
+ {
457
+ "file": "sdks/web/tests/error-codes-backfill.test.ts",
458
+ "name": "identity-lock codes carry permission_error type"
459
+ },
460
+ {
461
+ "file": "sdks/web/tests/error-codes-backfill.test.ts",
462
+ "name": "no entry has an empty description or resolution"
463
+ }
464
+ ],
465
+ "registeredAt": "2026-05-26",
466
+ "firstRegisteredIn": "bank-grade reconciliation v1.4.0 — phase 6.2",
467
+ "bundledIn": "@cross-deck/node@1.6.0"
468
+ },
469
+ {
470
+ "id": "sync-purchases-funnel-parity",
471
+ "pillar": "analytics",
472
+ "status": "enforced",
473
+ "claim": "Manual syncPurchases() emits a `purchase.completed` analytics event on success across ALL SDKs (Web / Node / RN / Swift / Android). Pre-v1.4.0 only Swift/Android auto-track emitted it — Web/Node/RN manual calls + Swift/Android manual calls fired ZERO analytics. Schema mirrors the auto-track event name + rail/productId/subscriptionId so cross-platform funnels reconcile on every payment path. When the backend short-circuits via the v1.4.0 idempotency cache, the event also carries `idempotent_replay: true`.",
474
+ "appliesTo": [
475
+ "web",
476
+ "node",
477
+ "react-native",
478
+ "swift",
479
+ "android"
480
+ ],
481
+ "codeRef": [
482
+ "sdks/web/src/crossdeck.ts",
483
+ "sdks/node/src/crossdeck-server.ts",
484
+ "sdks/react-native/src/crossdeck.ts",
485
+ "sdks/swift/Sources/Crossdeck/Crossdeck.swift",
486
+ "sdks/android/crossdeck/src/main/kotlin/com/crossdeck/Crossdeck.kt"
487
+ ],
488
+ "testRef": [
489
+ {
490
+ "file": "sdks/web/tests/sync-purchases-funnel.test.ts",
491
+ "name": "emits purchase.completed after a successful sync"
492
+ },
493
+ {
494
+ "file": "sdks/web/tests/sync-purchases-funnel.test.ts",
495
+ "name": "carries idempotent_replay=true when backend replied from cache"
496
+ }
497
+ ],
498
+ "registeredAt": "2026-05-26",
499
+ "firstRegisteredIn": "bank-grade reconciliation v1.4.0 — phase 3.5",
500
+ "bundledIn": "@cross-deck/node@1.6.0"
501
+ },
502
+ {
503
+ "id": "verifier-timestamp-mandatory",
504
+ "pillar": "webhooks",
505
+ "status": "enforced",
506
+ "claim": "Node verifyWebhookSignature() enforces a MANDATORY timestamp window. Pre-v1.4.0 the helper silently disabled replay protection on tolerance=0 (`if (tolerance > 0)` skipped the check) and on Infinity/NaN/null (`Math.abs(...) > Infinity = false`). v1.4.0 rejects non-finite / negative / above-24h-cap tolerances at the boundary with typed `webhook_invalid_tolerance` and always runs the drift check. Verification failures are surfaced via distinguishable codes: `webhook_signature_mismatch` (wrong-secret signal), `webhook_timestamp_outside_tolerance` (replay-attack signal — alert separately), `webhook_timestamp_missing` (header absent/malformed), `webhook_payload_not_json` (tampered post-signing), `webhook_missing_secret`, `webhook_invalid_tolerance` — replaces the pre-1.4.0 single `webhook_invalid_signature` catch-all.",
507
+ "appliesTo": [
508
+ "node"
509
+ ],
510
+ "codeRef": [
511
+ "sdks/node/src/webhooks.ts",
512
+ "sdks/node/src/error-codes.ts"
513
+ ],
514
+ "testRef": [
515
+ {
516
+ "file": "sdks/node/tests/webhooks.test.ts",
517
+ "name": "tolerance of 0 still enforces the replay window (v1.4.0 — cannot disable)"
518
+ },
519
+ {
520
+ "file": "sdks/node/tests/webhooks.test.ts",
521
+ "name": "rejects Infinity tolerance (would silently disable replay protection)"
522
+ },
523
+ {
524
+ "file": "sdks/node/tests/webhooks.test.ts",
525
+ "name": "rejects NaN tolerance"
526
+ },
527
+ {
528
+ "file": "sdks/node/tests/webhooks.test.ts",
529
+ "name": "rejects negative tolerance"
530
+ },
531
+ {
532
+ "file": "sdks/node/tests/webhooks.test.ts",
533
+ "name": "rejects tolerance above the 24h cap"
534
+ },
535
+ {
536
+ "file": "sdks/node/tests/webhooks.test.ts",
537
+ "name": "rejects non-number tolerance (null / string)"
538
+ },
539
+ {
540
+ "file": "sdks/node/tests/webhooks.test.ts",
541
+ "name": "accepts tolerance exactly at the 24h cap"
542
+ },
543
+ {
544
+ "file": "sdks/node/tests/webhooks.test.ts",
545
+ "name": "malformed header (no t= or no v1=) throws webhook_timestamp_missing"
546
+ },
547
+ {
548
+ "file": "sdks/node/tests/webhooks.test.ts",
549
+ "name": "valid signature but non-JSON payload throws webhook_payload_not_json"
550
+ }
551
+ ],
552
+ "registeredAt": "2026-05-26",
553
+ "firstRegisteredIn": "bank-grade reconciliation v1.4.0 — phase 7.2",
554
+ "bundledIn": "@cross-deck/node@1.6.0"
555
+ }
556
+ ]
557
+ }