@drakkar.software/sunglasses-core 0.2.0 → 0.3.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/dist/index.d.mts CHANGED
@@ -477,6 +477,23 @@ type EventMap = Record<string, Record<string, unknown> | undefined>;
477
477
  interface ISunglassesTypedClient<T extends EventMap> extends ISunglassesClient {
478
478
  capture<K extends keyof T & string>(eventName: K, ...args: T[K] extends undefined ? [properties?: Record<string, unknown>] : [properties: T[K]]): void;
479
479
  }
480
+ /**
481
+ * Standard properties emitted by error-capturing adapters as `$error` events.
482
+ * Shared by `@drakkar.software/sunglasses-adapter-sentry`,
483
+ * `@drakkar.software/sunglasses-adapter-posthog`, and `SunglassesErrorBoundary`.
484
+ */
485
+ interface ErrorEventProperties {
486
+ $error_message: string;
487
+ $error_type: string;
488
+ /** `true` when caught by an error boundary / try-catch; `false` for unhandled errors. */
489
+ $error_handled: boolean;
490
+ /** Sentry-compatible severity level. Usually `'error'`. */
491
+ $error_level: string;
492
+ /** Optional stringified stack trace. Disabled by default for privacy. */
493
+ $error_stack?: string;
494
+ /** Allows adapter-specific extension properties (e.g. from `beforeCapture`). */
495
+ [key: string]: unknown;
496
+ }
480
497
  interface ScreenTrackingOptions {
481
498
  /** Web: listen to history.pushState / replaceState / popstate. Default: true. */
482
499
  useHistoryApi?: boolean;
@@ -1090,4 +1107,4 @@ declare function sha256Hex(input: string): Promise<string>;
1090
1107
  */
1091
1108
  declare function nowISO(): string;
1092
1109
 
1093
- export { type CleanupConfig, type ConsentHistoryEntry, ConsentManager, type ConsentState, type ConsentStatus, type EventContext, type EventCountPeriod, EventCounter, type EventMap, EventQueue, type EventType, FrequencyMiddleware, type FrequencyMiddlewareOptions, type HttpAdapterConfig, type IAnalyticsAdapter, type IEventCounter, type IMiddleware, type IStorageAdapter, type ISunglassesClient, type ISunglassesTypedClient, IdentityManager, type IdentityState, LocalEventArchive, type Logger, type MiddlewareNext, MiddlewarePipeline, PiiSanitizer, SamplingMiddleware, type SamplingMiddlewareOptions, type ScreenTrackingOptions, SessionManager, type SessionState, type StarfishAdapterConfig, type SunglassesConfig, SunglassesCore, type SunglassesEvent, TraitManager, type UserDataExport, asTyped, createLogger, generateUUID, nowISO, sha256Hex };
1110
+ export { type CleanupConfig, type ConsentHistoryEntry, ConsentManager, type ConsentState, type ConsentStatus, type ErrorEventProperties, type EventContext, type EventCountPeriod, EventCounter, type EventMap, EventQueue, type EventType, FrequencyMiddleware, type FrequencyMiddlewareOptions, type HttpAdapterConfig, type IAnalyticsAdapter, type IEventCounter, type IMiddleware, type IStorageAdapter, type ISunglassesClient, type ISunglassesTypedClient, IdentityManager, type IdentityState, LocalEventArchive, type Logger, type MiddlewareNext, MiddlewarePipeline, PiiSanitizer, SamplingMiddleware, type SamplingMiddlewareOptions, type ScreenTrackingOptions, SessionManager, type SessionState, type StarfishAdapterConfig, type SunglassesConfig, SunglassesCore, type SunglassesEvent, TraitManager, type UserDataExport, asTyped, createLogger, generateUUID, nowISO, sha256Hex };
package/dist/index.d.ts CHANGED
@@ -477,6 +477,23 @@ type EventMap = Record<string, Record<string, unknown> | undefined>;
477
477
  interface ISunglassesTypedClient<T extends EventMap> extends ISunglassesClient {
478
478
  capture<K extends keyof T & string>(eventName: K, ...args: T[K] extends undefined ? [properties?: Record<string, unknown>] : [properties: T[K]]): void;
479
479
  }
480
+ /**
481
+ * Standard properties emitted by error-capturing adapters as `$error` events.
482
+ * Shared by `@drakkar.software/sunglasses-adapter-sentry`,
483
+ * `@drakkar.software/sunglasses-adapter-posthog`, and `SunglassesErrorBoundary`.
484
+ */
485
+ interface ErrorEventProperties {
486
+ $error_message: string;
487
+ $error_type: string;
488
+ /** `true` when caught by an error boundary / try-catch; `false` for unhandled errors. */
489
+ $error_handled: boolean;
490
+ /** Sentry-compatible severity level. Usually `'error'`. */
491
+ $error_level: string;
492
+ /** Optional stringified stack trace. Disabled by default for privacy. */
493
+ $error_stack?: string;
494
+ /** Allows adapter-specific extension properties (e.g. from `beforeCapture`). */
495
+ [key: string]: unknown;
496
+ }
480
497
  interface ScreenTrackingOptions {
481
498
  /** Web: listen to history.pushState / replaceState / popstate. Default: true. */
482
499
  useHistoryApi?: boolean;
@@ -1090,4 +1107,4 @@ declare function sha256Hex(input: string): Promise<string>;
1090
1107
  */
1091
1108
  declare function nowISO(): string;
1092
1109
 
1093
- export { type CleanupConfig, type ConsentHistoryEntry, ConsentManager, type ConsentState, type ConsentStatus, type EventContext, type EventCountPeriod, EventCounter, type EventMap, EventQueue, type EventType, FrequencyMiddleware, type FrequencyMiddlewareOptions, type HttpAdapterConfig, type IAnalyticsAdapter, type IEventCounter, type IMiddleware, type IStorageAdapter, type ISunglassesClient, type ISunglassesTypedClient, IdentityManager, type IdentityState, LocalEventArchive, type Logger, type MiddlewareNext, MiddlewarePipeline, PiiSanitizer, SamplingMiddleware, type SamplingMiddlewareOptions, type ScreenTrackingOptions, SessionManager, type SessionState, type StarfishAdapterConfig, type SunglassesConfig, SunglassesCore, type SunglassesEvent, TraitManager, type UserDataExport, asTyped, createLogger, generateUUID, nowISO, sha256Hex };
1110
+ export { type CleanupConfig, type ConsentHistoryEntry, ConsentManager, type ConsentState, type ConsentStatus, type ErrorEventProperties, type EventContext, type EventCountPeriod, EventCounter, type EventMap, EventQueue, type EventType, FrequencyMiddleware, type FrequencyMiddlewareOptions, type HttpAdapterConfig, type IAnalyticsAdapter, type IEventCounter, type IMiddleware, type IStorageAdapter, type ISunglassesClient, type ISunglassesTypedClient, IdentityManager, type IdentityState, LocalEventArchive, type Logger, type MiddlewareNext, MiddlewarePipeline, PiiSanitizer, SamplingMiddleware, type SamplingMiddlewareOptions, type ScreenTrackingOptions, SessionManager, type SessionState, type StarfishAdapterConfig, type SunglassesConfig, SunglassesCore, type SunglassesEvent, TraitManager, type UserDataExport, asTyped, createLogger, generateUUID, nowISO, sha256Hex };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drakkar.software/sunglasses-core",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Platform-agnostic event tracking engine for SunGlasses",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",