@capgo/capacitor-twilio-voice 7.1.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.
Files changed (31) hide show
  1. package/CapgoCapacitorTwilioVoice.podspec +19 -0
  2. package/Package.swift +35 -0
  3. package/README.md +280 -0
  4. package/android/build.gradle +65 -0
  5. package/android/src/main/AndroidManifest.xml +43 -0
  6. package/android/src/main/java/ee/forgr/capacitor_twilio_voice/CapacitorTwilioVoicePlugin.java +1230 -0
  7. package/android/src/main/java/ee/forgr/capacitor_twilio_voice/NotificationActionReceiver.java +64 -0
  8. package/android/src/main/java/ee/forgr/capacitor_twilio_voice/VoiceCallService.java +503 -0
  9. package/android/src/main/java/ee/forgr/capacitor_twilio_voice/VoiceFirebaseMessagingService.java +81 -0
  10. package/android/src/main/res/.gitkeep +0 -0
  11. package/android/src/main/res/drawable/ic_notification_call.xml +11 -0
  12. package/android/src/main/res/drawable/ic_phone_accept.xml +11 -0
  13. package/android/src/main/res/drawable/ic_phone_reject.xml +11 -0
  14. package/dist/docs.json +411 -0
  15. package/dist/esm/definitions.d.ts +95 -0
  16. package/dist/esm/definitions.js +2 -0
  17. package/dist/esm/definitions.js.map +1 -0
  18. package/dist/esm/index.d.ts +4 -0
  19. package/dist/esm/index.js +7 -0
  20. package/dist/esm/index.js.map +1 -0
  21. package/dist/esm/web.d.ts +62 -0
  22. package/dist/esm/web.js +45 -0
  23. package/dist/esm/web.js.map +1 -0
  24. package/dist/plugin.cjs.js +59 -0
  25. package/dist/plugin.cjs.js.map +1 -0
  26. package/dist/plugin.js +62 -0
  27. package/dist/plugin.js.map +1 -0
  28. package/ios/Sources/CapacitorTwilioVoicePlugin/CapacitorTwilioVoice.swift +8 -0
  29. package/ios/Sources/CapacitorTwilioVoicePlugin/CapacitorTwilioVoicePlugin.swift +922 -0
  30. package/ios/Tests/CapacitorTwilioVoicePluginTests/CapacitorTwilioVoicePluginTests.swift +15 -0
  31. package/package.json +81 -0
package/dist/docs.json ADDED
@@ -0,0 +1,411 @@
1
+ {
2
+ "api": {
3
+ "name": "CapacitorTwilioVoicePlugin",
4
+ "slug": "capacitortwiliovoiceplugin",
5
+ "docs": "",
6
+ "tags": [],
7
+ "methods": [
8
+ {
9
+ "name": "login",
10
+ "signature": "(options: { accessToken: string; }) => Promise<{ success: boolean; }>",
11
+ "parameters": [
12
+ {
13
+ "name": "options",
14
+ "docs": "",
15
+ "type": "{ accessToken: string; }"
16
+ }
17
+ ],
18
+ "returns": "Promise<{ success: boolean; }>",
19
+ "tags": [],
20
+ "docs": "",
21
+ "complexTypes": [],
22
+ "slug": "login"
23
+ },
24
+ {
25
+ "name": "logout",
26
+ "signature": "() => Promise<{ success: boolean; }>",
27
+ "parameters": [],
28
+ "returns": "Promise<{ success: boolean; }>",
29
+ "tags": [],
30
+ "docs": "",
31
+ "complexTypes": [],
32
+ "slug": "logout"
33
+ },
34
+ {
35
+ "name": "isLoggedIn",
36
+ "signature": "() => Promise<{ isLoggedIn: boolean; hasValidToken: boolean; identity?: string; }>",
37
+ "parameters": [],
38
+ "returns": "Promise<{ isLoggedIn: boolean; hasValidToken: boolean; identity?: string | undefined; }>",
39
+ "tags": [],
40
+ "docs": "",
41
+ "complexTypes": [],
42
+ "slug": "isloggedin"
43
+ },
44
+ {
45
+ "name": "makeCall",
46
+ "signature": "(options: { to: string; }) => Promise<{ success: boolean; callSid?: string; }>",
47
+ "parameters": [
48
+ {
49
+ "name": "options",
50
+ "docs": "",
51
+ "type": "{ to: string; }"
52
+ }
53
+ ],
54
+ "returns": "Promise<{ success: boolean; callSid?: string | undefined; }>",
55
+ "tags": [],
56
+ "docs": "",
57
+ "complexTypes": [],
58
+ "slug": "makecall"
59
+ },
60
+ {
61
+ "name": "acceptCall",
62
+ "signature": "(options: { callSid: string; }) => Promise<{ success: boolean; }>",
63
+ "parameters": [
64
+ {
65
+ "name": "options",
66
+ "docs": "",
67
+ "type": "{ callSid: string; }"
68
+ }
69
+ ],
70
+ "returns": "Promise<{ success: boolean; }>",
71
+ "tags": [],
72
+ "docs": "",
73
+ "complexTypes": [],
74
+ "slug": "acceptcall"
75
+ },
76
+ {
77
+ "name": "rejectCall",
78
+ "signature": "(options: { callSid: string; }) => Promise<{ success: boolean; }>",
79
+ "parameters": [
80
+ {
81
+ "name": "options",
82
+ "docs": "",
83
+ "type": "{ callSid: string; }"
84
+ }
85
+ ],
86
+ "returns": "Promise<{ success: boolean; }>",
87
+ "tags": [],
88
+ "docs": "",
89
+ "complexTypes": [],
90
+ "slug": "rejectcall"
91
+ },
92
+ {
93
+ "name": "endCall",
94
+ "signature": "(options: { callSid?: string; }) => Promise<{ success: boolean; }>",
95
+ "parameters": [
96
+ {
97
+ "name": "options",
98
+ "docs": "",
99
+ "type": "{ callSid?: string | undefined; }"
100
+ }
101
+ ],
102
+ "returns": "Promise<{ success: boolean; }>",
103
+ "tags": [],
104
+ "docs": "",
105
+ "complexTypes": [],
106
+ "slug": "endcall"
107
+ },
108
+ {
109
+ "name": "muteCall",
110
+ "signature": "(options: { muted: boolean; callSid?: string; }) => Promise<{ success: boolean; }>",
111
+ "parameters": [
112
+ {
113
+ "name": "options",
114
+ "docs": "",
115
+ "type": "{ muted: boolean; callSid?: string | undefined; }"
116
+ }
117
+ ],
118
+ "returns": "Promise<{ success: boolean; }>",
119
+ "tags": [],
120
+ "docs": "",
121
+ "complexTypes": [],
122
+ "slug": "mutecall"
123
+ },
124
+ {
125
+ "name": "setSpeaker",
126
+ "signature": "(options: { enabled: boolean; }) => Promise<{ success: boolean; }>",
127
+ "parameters": [
128
+ {
129
+ "name": "options",
130
+ "docs": "",
131
+ "type": "{ enabled: boolean; }"
132
+ }
133
+ ],
134
+ "returns": "Promise<{ success: boolean; }>",
135
+ "tags": [],
136
+ "docs": "",
137
+ "complexTypes": [],
138
+ "slug": "setspeaker"
139
+ },
140
+ {
141
+ "name": "getCallStatus",
142
+ "signature": "() => Promise<{ hasActiveCall: boolean; isOnHold: boolean; isMuted: boolean; callSid?: string; callState?: string; }>",
143
+ "parameters": [],
144
+ "returns": "Promise<{ hasActiveCall: boolean; isOnHold: boolean; isMuted: boolean; callSid?: string | undefined; callState?: string | undefined; }>",
145
+ "tags": [],
146
+ "docs": "",
147
+ "complexTypes": [],
148
+ "slug": "getcallstatus"
149
+ },
150
+ {
151
+ "name": "checkMicrophonePermission",
152
+ "signature": "() => Promise<{ granted: boolean; }>",
153
+ "parameters": [],
154
+ "returns": "Promise<{ granted: boolean; }>",
155
+ "tags": [],
156
+ "docs": "",
157
+ "complexTypes": [],
158
+ "slug": "checkmicrophonepermission"
159
+ },
160
+ {
161
+ "name": "requestMicrophonePermission",
162
+ "signature": "() => Promise<{ granted: boolean; }>",
163
+ "parameters": [],
164
+ "returns": "Promise<{ granted: boolean; }>",
165
+ "tags": [],
166
+ "docs": "",
167
+ "complexTypes": [],
168
+ "slug": "requestmicrophonepermission"
169
+ },
170
+ {
171
+ "name": "addListener",
172
+ "signature": "(eventName: 'callInviteReceived', listenerFunc: (data: { callSid: string; from: string; to: string; }) => void) => Promise<PluginListenerHandle>",
173
+ "parameters": [
174
+ {
175
+ "name": "eventName",
176
+ "docs": "",
177
+ "type": "'callInviteReceived'"
178
+ },
179
+ {
180
+ "name": "listenerFunc",
181
+ "docs": "",
182
+ "type": "(data: { callSid: string; from: string; to: string; }) => void"
183
+ }
184
+ ],
185
+ "returns": "Promise<PluginListenerHandle>",
186
+ "tags": [],
187
+ "docs": "",
188
+ "complexTypes": [
189
+ "PluginListenerHandle"
190
+ ],
191
+ "slug": "addlistenercallinvitereceived-"
192
+ },
193
+ {
194
+ "name": "addListener",
195
+ "signature": "(eventName: 'callConnected', listenerFunc: (data: { callSid: string; }) => void) => Promise<PluginListenerHandle>",
196
+ "parameters": [
197
+ {
198
+ "name": "eventName",
199
+ "docs": "",
200
+ "type": "'callConnected'"
201
+ },
202
+ {
203
+ "name": "listenerFunc",
204
+ "docs": "",
205
+ "type": "(data: { callSid: string; }) => void"
206
+ }
207
+ ],
208
+ "returns": "Promise<PluginListenerHandle>",
209
+ "tags": [],
210
+ "docs": "",
211
+ "complexTypes": [
212
+ "PluginListenerHandle"
213
+ ],
214
+ "slug": "addlistenercallconnected-"
215
+ },
216
+ {
217
+ "name": "addListener",
218
+ "signature": "(eventName: 'callDisconnected', listenerFunc: (data: { callSid: string; error?: string; }) => void) => Promise<PluginListenerHandle>",
219
+ "parameters": [
220
+ {
221
+ "name": "eventName",
222
+ "docs": "",
223
+ "type": "'callDisconnected'"
224
+ },
225
+ {
226
+ "name": "listenerFunc",
227
+ "docs": "",
228
+ "type": "(data: { callSid: string; error?: string | undefined; }) => void"
229
+ }
230
+ ],
231
+ "returns": "Promise<PluginListenerHandle>",
232
+ "tags": [],
233
+ "docs": "",
234
+ "complexTypes": [
235
+ "PluginListenerHandle"
236
+ ],
237
+ "slug": "addlistenercalldisconnected-"
238
+ },
239
+ {
240
+ "name": "addListener",
241
+ "signature": "(eventName: 'callRinging', listenerFunc: (data: { callSid: string; }) => void) => Promise<PluginListenerHandle>",
242
+ "parameters": [
243
+ {
244
+ "name": "eventName",
245
+ "docs": "",
246
+ "type": "'callRinging'"
247
+ },
248
+ {
249
+ "name": "listenerFunc",
250
+ "docs": "",
251
+ "type": "(data: { callSid: string; }) => void"
252
+ }
253
+ ],
254
+ "returns": "Promise<PluginListenerHandle>",
255
+ "tags": [],
256
+ "docs": "",
257
+ "complexTypes": [
258
+ "PluginListenerHandle"
259
+ ],
260
+ "slug": "addlistenercallringing-"
261
+ },
262
+ {
263
+ "name": "addListener",
264
+ "signature": "(eventName: 'callReconnecting', listenerFunc: (data: { callSid: string; error?: string; }) => void) => Promise<PluginListenerHandle>",
265
+ "parameters": [
266
+ {
267
+ "name": "eventName",
268
+ "docs": "",
269
+ "type": "'callReconnecting'"
270
+ },
271
+ {
272
+ "name": "listenerFunc",
273
+ "docs": "",
274
+ "type": "(data: { callSid: string; error?: string | undefined; }) => void"
275
+ }
276
+ ],
277
+ "returns": "Promise<PluginListenerHandle>",
278
+ "tags": [],
279
+ "docs": "",
280
+ "complexTypes": [
281
+ "PluginListenerHandle"
282
+ ],
283
+ "slug": "addlistenercallreconnecting-"
284
+ },
285
+ {
286
+ "name": "addListener",
287
+ "signature": "(eventName: 'callReconnected', listenerFunc: (data: { callSid: string; }) => void) => Promise<PluginListenerHandle>",
288
+ "parameters": [
289
+ {
290
+ "name": "eventName",
291
+ "docs": "",
292
+ "type": "'callReconnected'"
293
+ },
294
+ {
295
+ "name": "listenerFunc",
296
+ "docs": "",
297
+ "type": "(data: { callSid: string; }) => void"
298
+ }
299
+ ],
300
+ "returns": "Promise<PluginListenerHandle>",
301
+ "tags": [],
302
+ "docs": "",
303
+ "complexTypes": [
304
+ "PluginListenerHandle"
305
+ ],
306
+ "slug": "addlistenercallreconnected-"
307
+ },
308
+ {
309
+ "name": "addListener",
310
+ "signature": "(eventName: 'callQualityWarningsChanged', listenerFunc: (data: { callSid: string; currentWarnings: string[]; previousWarnings: string[]; }) => void) => Promise<PluginListenerHandle>",
311
+ "parameters": [
312
+ {
313
+ "name": "eventName",
314
+ "docs": "",
315
+ "type": "'callQualityWarningsChanged'"
316
+ },
317
+ {
318
+ "name": "listenerFunc",
319
+ "docs": "",
320
+ "type": "(data: { callSid: string; currentWarnings: string[]; previousWarnings: string[]; }) => void"
321
+ }
322
+ ],
323
+ "returns": "Promise<PluginListenerHandle>",
324
+ "tags": [],
325
+ "docs": "",
326
+ "complexTypes": [
327
+ "PluginListenerHandle"
328
+ ],
329
+ "slug": "addlistenercallqualitywarningschanged-"
330
+ },
331
+ {
332
+ "name": "addListener",
333
+ "signature": "(eventName: 'registrationSuccess', listenerFunc: () => void) => Promise<PluginListenerHandle>",
334
+ "parameters": [
335
+ {
336
+ "name": "eventName",
337
+ "docs": "",
338
+ "type": "'registrationSuccess'"
339
+ },
340
+ {
341
+ "name": "listenerFunc",
342
+ "docs": "",
343
+ "type": "() => void"
344
+ }
345
+ ],
346
+ "returns": "Promise<PluginListenerHandle>",
347
+ "tags": [],
348
+ "docs": "",
349
+ "complexTypes": [
350
+ "PluginListenerHandle"
351
+ ],
352
+ "slug": "addlistenerregistrationsuccess-"
353
+ },
354
+ {
355
+ "name": "addListener",
356
+ "signature": "(eventName: 'registrationFailure', listenerFunc: (data: { error: string; }) => void) => Promise<PluginListenerHandle>",
357
+ "parameters": [
358
+ {
359
+ "name": "eventName",
360
+ "docs": "",
361
+ "type": "'registrationFailure'"
362
+ },
363
+ {
364
+ "name": "listenerFunc",
365
+ "docs": "",
366
+ "type": "(data: { error: string; }) => void"
367
+ }
368
+ ],
369
+ "returns": "Promise<PluginListenerHandle>",
370
+ "tags": [],
371
+ "docs": "",
372
+ "complexTypes": [
373
+ "PluginListenerHandle"
374
+ ],
375
+ "slug": "addlistenerregistrationfailure-"
376
+ },
377
+ {
378
+ "name": "removeAllListeners",
379
+ "signature": "() => Promise<void>",
380
+ "parameters": [],
381
+ "returns": "Promise<void>",
382
+ "tags": [],
383
+ "docs": "",
384
+ "complexTypes": [],
385
+ "slug": "removealllisteners"
386
+ }
387
+ ],
388
+ "properties": []
389
+ },
390
+ "interfaces": [
391
+ {
392
+ "name": "PluginListenerHandle",
393
+ "slug": "pluginlistenerhandle",
394
+ "docs": "",
395
+ "tags": [],
396
+ "methods": [],
397
+ "properties": [
398
+ {
399
+ "name": "remove",
400
+ "tags": [],
401
+ "docs": "",
402
+ "complexTypes": [],
403
+ "type": "() => Promise<void>"
404
+ }
405
+ ]
406
+ }
407
+ ],
408
+ "enums": [],
409
+ "typeAliases": [],
410
+ "pluginConfigs": []
411
+ }
@@ -0,0 +1,95 @@
1
+ export interface CapacitorTwilioVoicePlugin {
2
+ login(options: {
3
+ accessToken: string;
4
+ }): Promise<{
5
+ success: boolean;
6
+ }>;
7
+ logout(): Promise<{
8
+ success: boolean;
9
+ }>;
10
+ isLoggedIn(): Promise<{
11
+ isLoggedIn: boolean;
12
+ hasValidToken: boolean;
13
+ identity?: string;
14
+ }>;
15
+ makeCall(options: {
16
+ to: string;
17
+ }): Promise<{
18
+ success: boolean;
19
+ callSid?: string;
20
+ }>;
21
+ acceptCall(options: {
22
+ callSid: string;
23
+ }): Promise<{
24
+ success: boolean;
25
+ }>;
26
+ rejectCall(options: {
27
+ callSid: string;
28
+ }): Promise<{
29
+ success: boolean;
30
+ }>;
31
+ endCall(options: {
32
+ callSid?: string;
33
+ }): Promise<{
34
+ success: boolean;
35
+ }>;
36
+ muteCall(options: {
37
+ muted: boolean;
38
+ callSid?: string;
39
+ }): Promise<{
40
+ success: boolean;
41
+ }>;
42
+ setSpeaker(options: {
43
+ enabled: boolean;
44
+ }): Promise<{
45
+ success: boolean;
46
+ }>;
47
+ getCallStatus(): Promise<{
48
+ hasActiveCall: boolean;
49
+ isOnHold: boolean;
50
+ isMuted: boolean;
51
+ callSid?: string;
52
+ callState?: string;
53
+ }>;
54
+ checkMicrophonePermission(): Promise<{
55
+ granted: boolean;
56
+ }>;
57
+ requestMicrophonePermission(): Promise<{
58
+ granted: boolean;
59
+ }>;
60
+ addListener(eventName: 'callInviteReceived', listenerFunc: (data: {
61
+ callSid: string;
62
+ from: string;
63
+ to: string;
64
+ }) => void): Promise<PluginListenerHandle>;
65
+ addListener(eventName: 'callConnected', listenerFunc: (data: {
66
+ callSid: string;
67
+ }) => void): Promise<PluginListenerHandle>;
68
+ addListener(eventName: 'callDisconnected', listenerFunc: (data: {
69
+ callSid: string;
70
+ error?: string;
71
+ }) => void): Promise<PluginListenerHandle>;
72
+ addListener(eventName: 'callRinging', listenerFunc: (data: {
73
+ callSid: string;
74
+ }) => void): Promise<PluginListenerHandle>;
75
+ addListener(eventName: 'callReconnecting', listenerFunc: (data: {
76
+ callSid: string;
77
+ error?: string;
78
+ }) => void): Promise<PluginListenerHandle>;
79
+ addListener(eventName: 'callReconnected', listenerFunc: (data: {
80
+ callSid: string;
81
+ }) => void): Promise<PluginListenerHandle>;
82
+ addListener(eventName: 'callQualityWarningsChanged', listenerFunc: (data: {
83
+ callSid: string;
84
+ currentWarnings: string[];
85
+ previousWarnings: string[];
86
+ }) => void): Promise<PluginListenerHandle>;
87
+ addListener(eventName: 'registrationSuccess', listenerFunc: () => void): Promise<PluginListenerHandle>;
88
+ addListener(eventName: 'registrationFailure', listenerFunc: (data: {
89
+ error: string;
90
+ }) => void): Promise<PluginListenerHandle>;
91
+ removeAllListeners(): Promise<void>;
92
+ }
93
+ export interface PluginListenerHandle {
94
+ remove(): Promise<void>;
95
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface CapacitorTwilioVoicePlugin {\n // Authentication\n login(options: { accessToken: string }): Promise<{ success: boolean }>;\n logout(): Promise<{ success: boolean }>;\n isLoggedIn(): Promise<{ isLoggedIn: boolean; hasValidToken: boolean; identity?: string }>;\n\n // Call Management\n makeCall(options: { to: string }): Promise<{ success: boolean; callSid?: string }>;\n acceptCall(options: { callSid: string }): Promise<{ success: boolean }>;\n rejectCall(options: { callSid: string }): Promise<{ success: boolean }>;\n endCall(options: { callSid?: string }): Promise<{ success: boolean }>;\n\n // Call Controls\n muteCall(options: { muted: boolean; callSid?: string }): Promise<{ success: boolean }>;\n setSpeaker(options: { enabled: boolean }): Promise<{ success: boolean }>;\n\n // Call Status\n getCallStatus(): Promise<{\n hasActiveCall: boolean;\n isOnHold: boolean;\n isMuted: boolean;\n callSid?: string;\n callState?: string;\n }>;\n\n // Audio Permissions\n checkMicrophonePermission(): Promise<{ granted: boolean }>;\n requestMicrophonePermission(): Promise<{ granted: boolean }>;\n\n // Listeners for events\n addListener(\n eventName: 'callInviteReceived',\n listenerFunc: (data: { callSid: string; from: string; to: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callConnected',\n listenerFunc: (data: { callSid: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callDisconnected',\n listenerFunc: (data: { callSid: string; error?: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callRinging',\n listenerFunc: (data: { callSid: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callReconnecting',\n listenerFunc: (data: { callSid: string; error?: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callReconnected',\n listenerFunc: (data: { callSid: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'callQualityWarningsChanged',\n listenerFunc: (data: { callSid: string; currentWarnings: string[]; previousWarnings: string[] }) => void,\n ): Promise<PluginListenerHandle>;\n\n addListener(eventName: 'registrationSuccess', listenerFunc: () => void): Promise<PluginListenerHandle>;\n\n addListener(\n eventName: 'registrationFailure',\n listenerFunc: (data: { error: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n removeAllListeners(): Promise<void>;\n}\n\nexport interface PluginListenerHandle {\n remove(): Promise<void>;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { CapacitorTwilioVoicePlugin } from './definitions';
2
+ declare const CapacitorTwilioVoice: CapacitorTwilioVoicePlugin;
3
+ export * from './definitions';
4
+ export { CapacitorTwilioVoice };
@@ -0,0 +1,7 @@
1
+ import { registerPlugin } from '@capacitor/core';
2
+ const CapacitorTwilioVoice = registerPlugin('CapacitorTwilioVoice', {
3
+ web: () => import('./web').then((m) => new m.CapacitorTwilioVoiceWeb()),
4
+ });
5
+ export * from './definitions';
6
+ export { CapacitorTwilioVoice };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,oBAAoB,GAAG,cAAc,CAA6B,sBAAsB,EAAE;IAC9F,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,uBAAuB,EAAE,CAAC;CACxE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { CapacitorTwilioVoicePlugin } from './definitions';\n\nconst CapacitorTwilioVoice = registerPlugin<CapacitorTwilioVoicePlugin>('CapacitorTwilioVoice', {\n web: () => import('./web').then((m) => new m.CapacitorTwilioVoiceWeb()),\n});\n\nexport * from './definitions';\nexport { CapacitorTwilioVoice };\n"]}
@@ -0,0 +1,62 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ import type { CapacitorTwilioVoicePlugin } from './definitions';
3
+ export declare class CapacitorTwilioVoiceWeb extends WebPlugin implements CapacitorTwilioVoicePlugin {
4
+ login(_options: {
5
+ accessToken: string;
6
+ }): Promise<{
7
+ success: boolean;
8
+ }>;
9
+ logout(): Promise<{
10
+ success: boolean;
11
+ }>;
12
+ isLoggedIn(): Promise<{
13
+ isLoggedIn: boolean;
14
+ hasValidToken: boolean;
15
+ identity?: string;
16
+ }>;
17
+ makeCall(_options: {
18
+ to: string;
19
+ }): Promise<{
20
+ success: boolean;
21
+ callSid?: string;
22
+ }>;
23
+ acceptCall(_options: {
24
+ callSid: string;
25
+ }): Promise<{
26
+ success: boolean;
27
+ }>;
28
+ rejectCall(_options: {
29
+ callSid: string;
30
+ }): Promise<{
31
+ success: boolean;
32
+ }>;
33
+ endCall(_options: {
34
+ callSid?: string;
35
+ }): Promise<{
36
+ success: boolean;
37
+ }>;
38
+ muteCall(_options: {
39
+ muted: boolean;
40
+ callSid?: string;
41
+ }): Promise<{
42
+ success: boolean;
43
+ }>;
44
+ setSpeaker(_options: {
45
+ enabled: boolean;
46
+ }): Promise<{
47
+ success: boolean;
48
+ }>;
49
+ getCallStatus(): Promise<{
50
+ hasActiveCall: boolean;
51
+ isOnHold: boolean;
52
+ isMuted: boolean;
53
+ callSid?: string;
54
+ callState?: string;
55
+ }>;
56
+ checkMicrophonePermission(): Promise<{
57
+ granted: boolean;
58
+ }>;
59
+ requestMicrophonePermission(): Promise<{
60
+ granted: boolean;
61
+ }>;
62
+ }
@@ -0,0 +1,45 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ export class CapacitorTwilioVoiceWeb extends WebPlugin {
3
+ // Authentication
4
+ async login(_options) {
5
+ throw this.unimplemented('Not implemented on web.');
6
+ }
7
+ async logout() {
8
+ throw this.unimplemented('Not implemented on web.');
9
+ }
10
+ async isLoggedIn() {
11
+ throw this.unimplemented('Not implemented on web.');
12
+ }
13
+ // Call Management
14
+ async makeCall(_options) {
15
+ throw this.unimplemented('Not implemented on web.');
16
+ }
17
+ async acceptCall(_options) {
18
+ throw this.unimplemented('Not implemented on web.');
19
+ }
20
+ async rejectCall(_options) {
21
+ throw this.unimplemented('Not implemented on web.');
22
+ }
23
+ async endCall(_options) {
24
+ throw this.unimplemented('Not implemented on web.');
25
+ }
26
+ // Call Controls
27
+ async muteCall(_options) {
28
+ throw this.unimplemented('Not implemented on web.');
29
+ }
30
+ async setSpeaker(_options) {
31
+ throw this.unimplemented('Not implemented on web.');
32
+ }
33
+ // Call Status
34
+ async getCallStatus() {
35
+ throw this.unimplemented('Not implemented on web.');
36
+ }
37
+ // Audio Permissions
38
+ async checkMicrophonePermission() {
39
+ throw this.unimplemented('Not implemented on web.');
40
+ }
41
+ async requestMicrophonePermission() {
42
+ throw this.unimplemented('Not implemented on web.');
43
+ }
44
+ }
45
+ //# sourceMappingURL=web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,uBAAwB,SAAQ,SAAS;IACpD,iBAAiB;IACjB,KAAK,CAAC,KAAK,CAAC,QAAiC;QAC3C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,MAAM;QACV,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,kBAAkB;IAClB,KAAK,CAAC,QAAQ,CAAC,QAAwB;QACrC,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAA6B;QAC5C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAA6B;QAC5C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAA8B;QAC1C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,gBAAgB;IAChB,KAAK,CAAC,QAAQ,CAAC,QAA8C;QAC3D,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAA8B;QAC7C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,cAAc;IACd,KAAK,CAAC,aAAa;QAOjB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,oBAAoB;IACpB,KAAK,CAAC,yBAAyB;QAC7B,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,2BAA2B;QAC/B,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { CapacitorTwilioVoicePlugin } from './definitions';\n\nexport class CapacitorTwilioVoiceWeb extends WebPlugin implements CapacitorTwilioVoicePlugin {\n // Authentication\n async login(_options: { accessToken: string }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async logout(): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async isLoggedIn(): Promise<{ isLoggedIn: boolean; hasValidToken: boolean; identity?: string }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n // Call Management\n async makeCall(_options: { to: string }): Promise<{ success: boolean; callSid?: string }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async acceptCall(_options: { callSid: string }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async rejectCall(_options: { callSid: string }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async endCall(_options: { callSid?: string }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n // Call Controls\n async muteCall(_options: { muted: boolean; callSid?: string }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async setSpeaker(_options: { enabled: boolean }): Promise<{ success: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n // Call Status\n async getCallStatus(): Promise<{\n hasActiveCall: boolean;\n isOnHold: boolean;\n isMuted: boolean;\n callSid?: string;\n callState?: string;\n }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n // Audio Permissions\n async checkMicrophonePermission(): Promise<{ granted: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async requestMicrophonePermission(): Promise<{ granted: boolean }> {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n"]}