@convirza/dialer-sdk 1.0.0 → 1.0.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.
@@ -1,17 +1,15 @@
1
1
  import { CallRecord, CallDirection, CallDisposition } from '../types/call-history.js';
2
2
  /**
3
- * Service layer orchestrating IndexedDB cache and backend API
4
- * Handles sync, fallback, and persistence strategy
3
+ * Service layer for IndexedDB-only call history
4
+ * No backend sync reads from IndexedDB only
5
5
  */
6
6
  export declare class CallHistoryService {
7
7
  private store;
8
- private api;
9
8
  private userId;
10
9
  private sipDomain;
11
10
  private initialized;
12
11
  constructor();
13
- init(userId: string, sipDomain: string, apiUrl?: string, authToken?: string): Promise<void>;
14
- setAuthToken(token: string): void;
12
+ init(userId: string, sipDomain: string): Promise<void>;
15
13
  private ensureInitialized;
16
14
  addCall(params: {
17
15
  callId: string;
@@ -26,16 +24,10 @@ export declare class CallHistoryService {
26
24
  recordingUrl?: string;
27
25
  }): Promise<void>;
28
26
  getHistory(limit?: number): Promise<CallRecord[]>;
29
- sync(): Promise<void>;
30
27
  updateCall(callId: string, updates: {
31
28
  endedAt?: number;
32
29
  durationSeconds?: number;
33
30
  }): Promise<void>;
34
31
  clear(): Promise<void>;
35
- /**
36
- * Force clear IndexedDB cache and re-sync from backend
37
- * Useful for debugging stale data issues
38
- */
39
- clearCache(): Promise<void>;
40
32
  destroy(): void;
41
33
  }
@@ -105,7 +105,7 @@ export declare class ConvirzaDialerElement extends HTMLElement {
105
105
  brandLogo?: string;
106
106
  }): void;
107
107
  /**
108
- * Clear call history cache and reload from backend
108
+ * Clear call history from IndexedDB
109
109
  */
110
110
  clearCallHistoryCache(): Promise<void>;
111
111
  mute(enable?: boolean): boolean;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Dynamically loads SIP.js library if not already present
3
+ * Eliminates need for manual <script> tag in consumer apps
4
+ */
5
+ /**
6
+ * Check if SIP.js is already loaded
7
+ */
8
+ export declare function isSipLoaded(): boolean;
9
+ /**
10
+ * Load SIP.js dynamically via script injection
11
+ * Returns immediately if already loaded
12
+ * Idempotent — multiple calls return same promise
13
+ */
14
+ export declare function loadSipJs(): Promise<void>;
15
+ /**
16
+ * Preload SIP.js early (call on app init for faster dialer startup)
17
+ * Non-blocking — fires and forgets
18
+ */
19
+ export declare function preloadSipJs(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@convirza/dialer-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "description": "Production-ready embeddable dialer widget with SIP integration hooks",
6
6
  "main": "dist/index.cjs.js",
@@ -1,16 +0,0 @@
1
- import { CallRecord, CallHistoryResponse, CallHistoryQueryParams } from '../types/call-history.js';
2
- /**
3
- * Backend API client for call history
4
- * Handles REST communication with server
5
- */
6
- export declare class CallHistoryAPI {
7
- private baseUrl;
8
- private authToken;
9
- constructor(baseUrl: string, authToken?: string);
10
- setAuthToken(token: string): void;
11
- private getHeaders;
12
- fetchHistory(params: CallHistoryQueryParams): Promise<CallHistoryResponse>;
13
- saveCall(call: Omit<CallRecord, 'id' | 'createdAt'>): Promise<CallRecord>;
14
- updateCall(callId: string, updates: Partial<CallRecord>): Promise<CallRecord>;
15
- private normalizeTimestamps;
16
- }