@cross-deck/node 1.1.1 → 1.3.1

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,6 +1,25 @@
1
- export { A as AliasIdentityInput, a as AliasResult, b as AuditDecision, c as AuditEntry, B as Breadcrumb, d as BreadcrumbCategory, e as BreadcrumbLevel, C as CROSSDECK_API_VERSION, f as CapturedError, g as CrossdeckAuthenticationError, h as CrossdeckConfigurationError, i as CrossdeckError, j as CrossdeckErrorPayload, k as CrossdeckErrorType, l as CrossdeckInternalError, m as CrossdeckNetworkError, n as CrossdeckPermissionError, o as CrossdeckRateLimitError, p as CrossdeckServer, q as CrossdeckServerOptions, r as CrossdeckValidationError, D as DEFAULT_BASE_URL, s as DEFAULT_TIMEOUT_MS, t as Diagnostics, E as EntitlementCacheOptions, u as EntitlementMutationResult, v as EntitlementsListResponse, w as EntitlementsListener, x as Environment, y as ErrorCaptureConfig, z as ErrorLevel, F as EventProperties, G as ForgetResult, H as GrantDuration, I as GrantEntitlementInput, J as GroupMembership, K as HeartbeatResponse, L as HttpRequestInfo, M as HttpResponseInfo, N as HttpRetriesConfig, O as IdentifyOptions, P as IdentityHints, Q as IngestOptions, R as IngestResponse, S as PublicEntitlement, T as PurchaseResult, U as RequestOptions, V as RevokeEntitlementInput, W as RuntimeHost, X as RuntimeInfo, Y as SDK_NAME, Z as SDK_VERSION, _ as ServerEvent, $ as StackFrame, a0 as SyncPurchaseInput, a1 as makeCrossdeckError } from './crossdeck-server-BXQaFjVx.mjs';
1
+ export { A as AliasIdentityInput, a as AliasResult, b as AuditDecision, c as AuditEntry, B as Breadcrumb, d as BreadcrumbCategory, e as BreadcrumbLevel, C as CROSSDECK_API_VERSION, f as CapturedError, g as CrossdeckAuthenticationError, h as CrossdeckConfigurationError, i as CrossdeckError, j as CrossdeckErrorPayload, k as CrossdeckErrorType, l as CrossdeckInternalError, m as CrossdeckNetworkError, n as CrossdeckPermissionError, o as CrossdeckRateLimitError, p as CrossdeckServer, q as CrossdeckServerOptions, r as CrossdeckValidationError, D as DEFAULT_BASE_URL, s as DEFAULT_TIMEOUT_MS, t as Diagnostics, E as EntitlementCacheOptions, u as EntitlementMutationResult, v as EntitlementStore, w as EntitlementsListResponse, x as EntitlementsListener, y as Environment, z as ErrorCaptureConfig, F as ErrorLevel, G as EventProperties, H as ForgetResult, I as GrantDuration, J as GrantEntitlementInput, K as GroupMembership, L as HeartbeatResponse, M as HttpRequestInfo, N as HttpResponseInfo, O as HttpRetriesConfig, P as IdentifyOptions, Q as IdentityHints, R as IngestOptions, S as IngestResponse, T as PublicEntitlement, U as PurchaseResult, V as RequestOptions, W as RevokeEntitlementInput, X as RuntimeHost, Y as RuntimeInfo, Z as ServerEvent, _ as StackFrame, $ as StoredEntitlements, a0 as SyncPurchaseInput, a1 as makeCrossdeckError } from './crossdeck-server-DhnHvUhh.mjs';
2
2
  import 'node:events';
3
3
 
4
+ /**
5
+ * SDK version constant — generated by `scripts/sync-sdk-versions.mjs`.
6
+ *
7
+ * Single source of truth: the `version` field in this package's
8
+ * package.json. The sync script writes this file so that
9
+ * `SDK_VERSION` is a plain TypeScript literal at runtime — no
10
+ * runtime JSON-import gotcha (Node ESM requires
11
+ * `with { type: "json" }` to import JSON as ESM, and the published
12
+ * dist file would otherwise fail to load).
13
+ *
14
+ * Drift protection: `node scripts/sync-sdk-versions.mjs --check` (the
15
+ * CI gate) flags this file when it falls out of sync with package.json.
16
+ * Bumping `package.json` without re-running the sync script fails CI.
17
+ *
18
+ * Do NOT edit by hand — `node scripts/sync-sdk-versions.mjs`.
19
+ */
20
+ declare const SDK_VERSION = "1.3.1";
21
+ declare const SDK_NAME = "@cross-deck/node";
22
+
4
23
  /**
5
24
  * Machine-readable index of every error code `@cross-deck/node` can
6
25
  * throw, with a short description and a hint on what action to take.
@@ -289,16 +308,24 @@ declare function signWebhookPayload(payload: string, secret: string, timestampSe
289
308
  * name: "checkout.started",
290
309
  * developerUserId: userId,
291
310
  * properties: scrubPiiFromProperties({
292
- * url: req.url, // might contain "/users/wes@…/" — gets [email]
311
+ * url: req.url, // might contain "/users/wes@…/" — gets <email>
293
312
  * lastError: e.message, // might contain card numbers
294
313
  * }),
295
314
  * });
296
315
  */
297
316
  /**
298
317
  * Scrub a single string value: replace email-shaped substrings with
299
- * `[email]` and card-number-shaped substrings with `[card]`. Returns
300
- * the original string (===) when nothing matched, so callers can do
301
- * an identity-check to skip allocating a new event copy.
318
+ * `<email>` and card-number-shaped substrings with `<card>`. Returns
319
+ * the original string (===) when nothing matched.
320
+ *
321
+ * Implementation note: we call `.replace()` unconditionally rather than
322
+ * gating on `.test()`. The /g regexes are module-level so `.test()`
323
+ * carries `lastIndex` state between calls — a prior match leaves
324
+ * `lastIndex` mid-string and the next `.test()` can falsely return
325
+ * false on a string that DOES match. `.replace(/g)` always scans the
326
+ * full string regardless of `lastIndex`, so dropping the test-guard
327
+ * removes the sharp edge at zero cost (when nothing matches, replace
328
+ * returns the same `(===)` string).
302
329
  */
303
330
  declare function scrubPii(value: string): string;
304
331
  /**
@@ -334,9 +361,12 @@ declare function scrubPiiFromProperties(properties: Record<string, unknown>): Re
334
361
  * - `sdk.webhook_verified`
335
362
  * - `sdk.runtime_detected`
336
363
  * - `sdk.entitlement_cache_warm`
364
+ * - `sdk.entitlement_cache_stale`
365
+ * - `sdk.entitlement_store_recovered`
366
+ * - `sdk.no_durable_store`
337
367
  * - `sdk.super_property_registered`
338
368
  */
339
- type DebugSignal = "sdk.configured" | "sdk.first_event_sent" | "sdk.invalid_key" | "sdk.no_identity" | "sdk.entitlement_cache_used" | "sdk.entitlement_cache_warm" | "sdk.purchase_evidence_sent" | "sdk.environment_mismatch" | "sdk.sensitive_property_warning" | "sdk.property_coerced" | "sdk.flush_retry_scheduled" | "sdk.flush_on_exit_started" | "sdk.flush_on_exit_completed" | "sdk.webhook_verified" | "sdk.runtime_detected" | "sdk.super_property_registered" | "sdk.boot_heartbeat_failed";
369
+ type DebugSignal = "sdk.configured" | "sdk.first_event_sent" | "sdk.invalid_key" | "sdk.no_identity" | "sdk.entitlement_cache_used" | "sdk.entitlement_cache_warm" | "sdk.entitlement_cache_stale" | "sdk.entitlement_store_recovered" | "sdk.no_durable_store" | "sdk.purchase_evidence_sent" | "sdk.environment_mismatch" | "sdk.sensitive_property_warning" | "sdk.property_coerced" | "sdk.flush_retry_scheduled" | "sdk.flush_permanent_failure" | "sdk.flush_on_exit_started" | "sdk.flush_on_exit_completed" | "sdk.webhook_verified" | "sdk.runtime_detected" | "sdk.super_property_registered" | "sdk.boot_heartbeat_failed";
340
370
  interface DebugContext {
341
371
  [key: string]: unknown;
342
372
  }
@@ -345,4 +375,4 @@ interface DebugLogger {
345
375
  emit(signal: DebugSignal, message: string, context?: DebugContext): void;
346
376
  }
347
377
 
348
- export { CROSSDECK_ERROR_CODES, type CrossdeckErrorCode, type DebugContext, type DebugLogger, type DebugSignal, type ErrorCodeEntry, type VerifyWebhookOptions, getErrorCode, isCrossdeckErrorCode, scrubPii, scrubPiiFromProperties, signWebhookPayload, verifyWebhookSignature };
378
+ export { CROSSDECK_ERROR_CODES, type CrossdeckErrorCode, type DebugContext, type DebugLogger, type DebugSignal, type ErrorCodeEntry, SDK_NAME, SDK_VERSION, type VerifyWebhookOptions, getErrorCode, isCrossdeckErrorCode, scrubPii, scrubPiiFromProperties, signWebhookPayload, verifyWebhookSignature };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,25 @@
1
- export { A as AliasIdentityInput, a as AliasResult, b as AuditDecision, c as AuditEntry, B as Breadcrumb, d as BreadcrumbCategory, e as BreadcrumbLevel, C as CROSSDECK_API_VERSION, f as CapturedError, g as CrossdeckAuthenticationError, h as CrossdeckConfigurationError, i as CrossdeckError, j as CrossdeckErrorPayload, k as CrossdeckErrorType, l as CrossdeckInternalError, m as CrossdeckNetworkError, n as CrossdeckPermissionError, o as CrossdeckRateLimitError, p as CrossdeckServer, q as CrossdeckServerOptions, r as CrossdeckValidationError, D as DEFAULT_BASE_URL, s as DEFAULT_TIMEOUT_MS, t as Diagnostics, E as EntitlementCacheOptions, u as EntitlementMutationResult, v as EntitlementsListResponse, w as EntitlementsListener, x as Environment, y as ErrorCaptureConfig, z as ErrorLevel, F as EventProperties, G as ForgetResult, H as GrantDuration, I as GrantEntitlementInput, J as GroupMembership, K as HeartbeatResponse, L as HttpRequestInfo, M as HttpResponseInfo, N as HttpRetriesConfig, O as IdentifyOptions, P as IdentityHints, Q as IngestOptions, R as IngestResponse, S as PublicEntitlement, T as PurchaseResult, U as RequestOptions, V as RevokeEntitlementInput, W as RuntimeHost, X as RuntimeInfo, Y as SDK_NAME, Z as SDK_VERSION, _ as ServerEvent, $ as StackFrame, a0 as SyncPurchaseInput, a1 as makeCrossdeckError } from './crossdeck-server-BXQaFjVx.js';
1
+ export { A as AliasIdentityInput, a as AliasResult, b as AuditDecision, c as AuditEntry, B as Breadcrumb, d as BreadcrumbCategory, e as BreadcrumbLevel, C as CROSSDECK_API_VERSION, f as CapturedError, g as CrossdeckAuthenticationError, h as CrossdeckConfigurationError, i as CrossdeckError, j as CrossdeckErrorPayload, k as CrossdeckErrorType, l as CrossdeckInternalError, m as CrossdeckNetworkError, n as CrossdeckPermissionError, o as CrossdeckRateLimitError, p as CrossdeckServer, q as CrossdeckServerOptions, r as CrossdeckValidationError, D as DEFAULT_BASE_URL, s as DEFAULT_TIMEOUT_MS, t as Diagnostics, E as EntitlementCacheOptions, u as EntitlementMutationResult, v as EntitlementStore, w as EntitlementsListResponse, x as EntitlementsListener, y as Environment, z as ErrorCaptureConfig, F as ErrorLevel, G as EventProperties, H as ForgetResult, I as GrantDuration, J as GrantEntitlementInput, K as GroupMembership, L as HeartbeatResponse, M as HttpRequestInfo, N as HttpResponseInfo, O as HttpRetriesConfig, P as IdentifyOptions, Q as IdentityHints, R as IngestOptions, S as IngestResponse, T as PublicEntitlement, U as PurchaseResult, V as RequestOptions, W as RevokeEntitlementInput, X as RuntimeHost, Y as RuntimeInfo, Z as ServerEvent, _ as StackFrame, $ as StoredEntitlements, a0 as SyncPurchaseInput, a1 as makeCrossdeckError } from './crossdeck-server-DhnHvUhh.js';
2
2
  import 'node:events';
3
3
 
4
+ /**
5
+ * SDK version constant — generated by `scripts/sync-sdk-versions.mjs`.
6
+ *
7
+ * Single source of truth: the `version` field in this package's
8
+ * package.json. The sync script writes this file so that
9
+ * `SDK_VERSION` is a plain TypeScript literal at runtime — no
10
+ * runtime JSON-import gotcha (Node ESM requires
11
+ * `with { type: "json" }` to import JSON as ESM, and the published
12
+ * dist file would otherwise fail to load).
13
+ *
14
+ * Drift protection: `node scripts/sync-sdk-versions.mjs --check` (the
15
+ * CI gate) flags this file when it falls out of sync with package.json.
16
+ * Bumping `package.json` without re-running the sync script fails CI.
17
+ *
18
+ * Do NOT edit by hand — `node scripts/sync-sdk-versions.mjs`.
19
+ */
20
+ declare const SDK_VERSION = "1.3.1";
21
+ declare const SDK_NAME = "@cross-deck/node";
22
+
4
23
  /**
5
24
  * Machine-readable index of every error code `@cross-deck/node` can
6
25
  * throw, with a short description and a hint on what action to take.
@@ -289,16 +308,24 @@ declare function signWebhookPayload(payload: string, secret: string, timestampSe
289
308
  * name: "checkout.started",
290
309
  * developerUserId: userId,
291
310
  * properties: scrubPiiFromProperties({
292
- * url: req.url, // might contain "/users/wes@…/" — gets [email]
311
+ * url: req.url, // might contain "/users/wes@…/" — gets <email>
293
312
  * lastError: e.message, // might contain card numbers
294
313
  * }),
295
314
  * });
296
315
  */
297
316
  /**
298
317
  * Scrub a single string value: replace email-shaped substrings with
299
- * `[email]` and card-number-shaped substrings with `[card]`. Returns
300
- * the original string (===) when nothing matched, so callers can do
301
- * an identity-check to skip allocating a new event copy.
318
+ * `<email>` and card-number-shaped substrings with `<card>`. Returns
319
+ * the original string (===) when nothing matched.
320
+ *
321
+ * Implementation note: we call `.replace()` unconditionally rather than
322
+ * gating on `.test()`. The /g regexes are module-level so `.test()`
323
+ * carries `lastIndex` state between calls — a prior match leaves
324
+ * `lastIndex` mid-string and the next `.test()` can falsely return
325
+ * false on a string that DOES match. `.replace(/g)` always scans the
326
+ * full string regardless of `lastIndex`, so dropping the test-guard
327
+ * removes the sharp edge at zero cost (when nothing matches, replace
328
+ * returns the same `(===)` string).
302
329
  */
303
330
  declare function scrubPii(value: string): string;
304
331
  /**
@@ -334,9 +361,12 @@ declare function scrubPiiFromProperties(properties: Record<string, unknown>): Re
334
361
  * - `sdk.webhook_verified`
335
362
  * - `sdk.runtime_detected`
336
363
  * - `sdk.entitlement_cache_warm`
364
+ * - `sdk.entitlement_cache_stale`
365
+ * - `sdk.entitlement_store_recovered`
366
+ * - `sdk.no_durable_store`
337
367
  * - `sdk.super_property_registered`
338
368
  */
339
- type DebugSignal = "sdk.configured" | "sdk.first_event_sent" | "sdk.invalid_key" | "sdk.no_identity" | "sdk.entitlement_cache_used" | "sdk.entitlement_cache_warm" | "sdk.purchase_evidence_sent" | "sdk.environment_mismatch" | "sdk.sensitive_property_warning" | "sdk.property_coerced" | "sdk.flush_retry_scheduled" | "sdk.flush_on_exit_started" | "sdk.flush_on_exit_completed" | "sdk.webhook_verified" | "sdk.runtime_detected" | "sdk.super_property_registered" | "sdk.boot_heartbeat_failed";
369
+ type DebugSignal = "sdk.configured" | "sdk.first_event_sent" | "sdk.invalid_key" | "sdk.no_identity" | "sdk.entitlement_cache_used" | "sdk.entitlement_cache_warm" | "sdk.entitlement_cache_stale" | "sdk.entitlement_store_recovered" | "sdk.no_durable_store" | "sdk.purchase_evidence_sent" | "sdk.environment_mismatch" | "sdk.sensitive_property_warning" | "sdk.property_coerced" | "sdk.flush_retry_scheduled" | "sdk.flush_permanent_failure" | "sdk.flush_on_exit_started" | "sdk.flush_on_exit_completed" | "sdk.webhook_verified" | "sdk.runtime_detected" | "sdk.super_property_registered" | "sdk.boot_heartbeat_failed";
340
370
  interface DebugContext {
341
371
  [key: string]: unknown;
342
372
  }
@@ -345,4 +375,4 @@ interface DebugLogger {
345
375
  emit(signal: DebugSignal, message: string, context?: DebugContext): void;
346
376
  }
347
377
 
348
- export { CROSSDECK_ERROR_CODES, type CrossdeckErrorCode, type DebugContext, type DebugLogger, type DebugSignal, type ErrorCodeEntry, type VerifyWebhookOptions, getErrorCode, isCrossdeckErrorCode, scrubPii, scrubPiiFromProperties, signWebhookPayload, verifyWebhookSignature };
378
+ export { CROSSDECK_ERROR_CODES, type CrossdeckErrorCode, type DebugContext, type DebugLogger, type DebugSignal, type ErrorCodeEntry, SDK_NAME, SDK_VERSION, type VerifyWebhookOptions, getErrorCode, isCrossdeckErrorCode, scrubPii, scrubPiiFromProperties, signWebhookPayload, verifyWebhookSignature };