@telnyx/react-voice-commons-sdk 0.1.0 → 0.1.2

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.
Files changed (47) hide show
  1. package/README.md +483 -0
  2. package/TelnyxVoiceCommons.podspec +31 -31
  3. package/ios/CallKitBridge.m +43 -43
  4. package/ios/CallKitBridge.swift +879 -879
  5. package/ios/VoicePnBridge.m +30 -30
  6. package/ios/VoicePnBridge.swift +86 -86
  7. package/lib/callkit/callkit-coordinator.d.ts +117 -113
  8. package/lib/callkit/callkit-coordinator.js +727 -681
  9. package/lib/callkit/callkit.d.ts +41 -41
  10. package/lib/callkit/callkit.js +242 -252
  11. package/lib/callkit/index.js +47 -15
  12. package/lib/callkit/use-callkit.d.ts +19 -19
  13. package/lib/callkit/use-callkit.js +310 -270
  14. package/lib/context/TelnyxVoiceContext.d.ts +9 -9
  15. package/lib/context/TelnyxVoiceContext.js +13 -10
  16. package/lib/hooks/use-callkit-coordinator.d.ts +17 -9
  17. package/lib/hooks/use-callkit-coordinator.js +50 -45
  18. package/lib/hooks/useAppReadyNotifier.js +15 -13
  19. package/lib/hooks/useAppStateHandler.d.ts +11 -6
  20. package/lib/hooks/useAppStateHandler.js +110 -95
  21. package/lib/index.d.ts +21 -3
  22. package/lib/index.js +201 -50
  23. package/lib/internal/CallKitHandler.d.ts +6 -6
  24. package/lib/internal/CallKitHandler.js +104 -96
  25. package/lib/internal/callkit-manager.d.ts +57 -57
  26. package/lib/internal/callkit-manager.js +316 -299
  27. package/lib/internal/calls/call-state-controller.d.ts +86 -81
  28. package/lib/internal/calls/call-state-controller.js +307 -269
  29. package/lib/internal/session/session-manager.d.ts +75 -75
  30. package/lib/internal/session/session-manager.js +424 -350
  31. package/lib/internal/user-defaults-helpers.js +39 -49
  32. package/lib/internal/voice-pn-bridge.d.ts +11 -11
  33. package/lib/internal/voice-pn-bridge.js +3 -3
  34. package/lib/models/call-state.d.ts +44 -44
  35. package/lib/models/call-state.js +68 -66
  36. package/lib/models/call.d.ts +133 -133
  37. package/lib/models/call.js +382 -354
  38. package/lib/models/config.d.ts +18 -11
  39. package/lib/models/config.js +35 -37
  40. package/lib/models/connection-state.d.ts +10 -10
  41. package/lib/models/connection-state.js +16 -16
  42. package/lib/telnyx-voice-app.d.ts +28 -28
  43. package/lib/telnyx-voice-app.js +482 -424
  44. package/lib/telnyx-voip-client.d.ts +167 -155
  45. package/lib/telnyx-voip-client.js +392 -331
  46. package/package.json +1 -1
  47. package/src/telnyx-voip-client.ts +64 -0
@@ -9,79 +9,79 @@ import { Config, CredentialConfig, TokenConfig } from '../../models/config';
9
9
  * and automatic reconnection logic.
10
10
  */
11
11
  export declare class SessionManager {
12
- private readonly _connectionState;
13
- private _telnyxClient?;
14
- private _currentConfig?;
15
- private _sessionId;
16
- private _disposed;
17
- private _onClientReady?;
18
- constructor();
19
- /**
20
- * Observable stream of connection state changes
21
- */
22
- get connectionState$(): Observable<TelnyxConnectionState>;
23
- /**
24
- * Set callback to be called when the Telnyx client is ready
25
- */
26
- setOnClientReady(callback: () => void): void;
27
- /**
28
- * Current connection state (synchronous access)
29
- */
30
- get currentState(): TelnyxConnectionState;
31
- /**
32
- * Current session ID
33
- */
34
- get sessionId(): string;
35
- /**
36
- * Get the underlying Telnyx client instance
37
- */
38
- get telnyxClient(): TelnyxSDK.TelnyxRTC | undefined;
39
- /**
40
- * Connect using credential authentication
41
- */
42
- connectWithCredential(config: CredentialConfig): Promise<void>;
43
- /**
44
- * Connect using token authentication
45
- */
46
- connectWithToken(config: TokenConfig): Promise<void>;
47
- /**
48
- * Disconnect from the Telnyx platform
49
- */
50
- disconnect(): Promise<void>;
51
- /**
52
- * Disable push notifications for the current session
53
- */
54
- disablePushNotifications(): void;
55
- /**
56
- * Handle push notification with stored config
57
- */
58
- handlePushNotificationWithConfig(pushMetaData: any, config: Config): void;
59
- /**
60
- * Handle push notification (async version)
61
- */
62
- handlePushNotification(payload: Record<string, any>): Promise<void>;
63
- /**
64
- * Dispose of the session manager and clean up resources
65
- */
66
- dispose(): void;
67
- /**
68
- * Internal method to establish connection
69
- */
70
- private _connect;
71
- /**
72
- * Set up event listeners for the Telnyx client
73
- */
74
- private _setupClientListeners;
75
- /**
76
- * Attempt to reconnect after connection loss
77
- */
78
- private _attemptReconnection;
79
- /**
80
- * Extract the actual payload metadata from wrapped push notification payload
81
- */
82
- private _extractPushPayload;
83
- /**
84
- * Generate a unique session ID
85
- */
86
- private _generateSessionId;
12
+ private readonly _connectionState;
13
+ private _telnyxClient?;
14
+ private _currentConfig?;
15
+ private _sessionId;
16
+ private _disposed;
17
+ private _onClientReady?;
18
+ constructor();
19
+ /**
20
+ * Observable stream of connection state changes
21
+ */
22
+ get connectionState$(): Observable<TelnyxConnectionState>;
23
+ /**
24
+ * Set callback to be called when the Telnyx client is ready
25
+ */
26
+ setOnClientReady(callback: () => void): void;
27
+ /**
28
+ * Current connection state (synchronous access)
29
+ */
30
+ get currentState(): TelnyxConnectionState;
31
+ /**
32
+ * Current session ID
33
+ */
34
+ get sessionId(): string;
35
+ /**
36
+ * Get the underlying Telnyx client instance
37
+ */
38
+ get telnyxClient(): TelnyxSDK.TelnyxRTC | undefined;
39
+ /**
40
+ * Connect using credential authentication
41
+ */
42
+ connectWithCredential(config: CredentialConfig): Promise<void>;
43
+ /**
44
+ * Connect using token authentication
45
+ */
46
+ connectWithToken(config: TokenConfig): Promise<void>;
47
+ /**
48
+ * Disconnect from the Telnyx platform
49
+ */
50
+ disconnect(): Promise<void>;
51
+ /**
52
+ * Disable push notifications for the current session
53
+ */
54
+ disablePushNotifications(): void;
55
+ /**
56
+ * Handle push notification with stored config
57
+ */
58
+ handlePushNotificationWithConfig(pushMetaData: any, config: Config): void;
59
+ /**
60
+ * Handle push notification (async version)
61
+ */
62
+ handlePushNotification(payload: Record<string, any>): Promise<void>;
63
+ /**
64
+ * Dispose of the session manager and clean up resources
65
+ */
66
+ dispose(): void;
67
+ /**
68
+ * Internal method to establish connection
69
+ */
70
+ private _connect;
71
+ /**
72
+ * Set up event listeners for the Telnyx client
73
+ */
74
+ private _setupClientListeners;
75
+ /**
76
+ * Attempt to reconnect after connection loss
77
+ */
78
+ private _attemptReconnection;
79
+ /**
80
+ * Extract the actual payload metadata from wrapped push notification payload
81
+ */
82
+ private _extractPushPayload;
83
+ /**
84
+ * Generate a unique session ID
85
+ */
86
+ private _generateSessionId;
87
87
  }