obi-sdk 0.6.2 → 0.6.4

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/sentry.d.ts CHANGED
@@ -1 +1,39 @@
1
- export declare function captureException(error: any): void;
1
+ interface SentryContext {
2
+ sessionId?: string;
3
+ apiKey?: string;
4
+ widgetState?: string;
5
+ componentName?: string;
6
+ userId?: string;
7
+ userEmail?: string;
8
+ userMetadata?: any;
9
+ handlerName?: string;
10
+ lifecycle?: string;
11
+ changedProperties?: string[];
12
+ eventType?: string;
13
+ eventData?: Record<string, any>;
14
+ userJourney?: string[];
15
+ [key: string]: any;
16
+ }
17
+ export declare function captureException(error: any, context?: SentryContext): void;
18
+ export declare function captureMessage(message: string, level?: 'info' | 'warning' | 'error', context?: SentryContext): void;
19
+ export declare function trackEvent(eventType: string, eventData?: Record<string, any>, componentName?: string): void;
20
+ export declare function setGlobalContext(context: Partial<SentryContext>): void;
21
+ /**
22
+ * Wraps an async function to automatically capture any exceptions
23
+ */
24
+ export declare function withSentryAsyncHandler<T extends (...args: any[]) => Promise<any>>(fn: T, handlerName: string, componentName?: string): T;
25
+ /**
26
+ * Wraps a synchronous function to automatically capture any exceptions
27
+ */
28
+ export declare function withSentryHandler<T extends (...args: any[]) => any>(fn: T, handlerName: string, componentName?: string): T;
29
+ /**
30
+ * Simple wrapper to add Sentry error tracking to component lifecycle methods
31
+ * Use this in your component's connectedCallback, disconnectedCallback, etc.
32
+ */
33
+ export declare function withComponentErrorTracking(componentName: string): {
34
+ trackLifecycle: (lifecycleMethod: string, fn: () => void) => void;
35
+ trackRender: (renderFn: () => any) => any;
36
+ setContext: () => void;
37
+ };
38
+ export { captureException as default };
39
+ export type { SentryContext };
@@ -12,6 +12,7 @@ export declare class Course extends LitElement {
12
12
  description: string;
13
13
  duration: number;
14
14
  selected: boolean;
15
+ constructor();
15
16
  private handleClick;
16
17
  render(): import("lit").TemplateResult<1>;
17
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obi-sdk",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "JavaScript SDK for Obi",
5
5
  "type": "module",
6
6
  "main": "dist/obi-sdk.umd.js",
@@ -43,8 +43,8 @@
43
43
  "ts-pattern": "^5.7.0",
44
44
  "zod": "^3.22.0",
45
45
  "@obi/obi-client": "0.2.0",
46
- "@obi/utils": "0.2.0",
47
- "@obi/obi-session": "0.3.0"
46
+ "@obi/obi-session": "0.3.1",
47
+ "@obi/utils": "0.2.0"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
@@ -1,6 +0,0 @@
1
- import { O } from "./obi-widget-27b273fd.js";
2
- import "./types-e0297e7b.js";
3
- export {
4
- O as ObiWidget
5
- };
6
- //# sourceMappingURL=index-f4e9f79f.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-f4e9f79f.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}