@poolse/native 3.8.0 → 3.10.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/CHANGELOG.md +55 -0
- package/README.md +127 -9
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/dev/poolse/callcore/CallCoreRuntime.kt +8 -0
- package/android/src/main/java/dev/poolse/callcore/Ports.kt +47 -1
- package/android/src/main/java/dev/poolse/callcore/android/AndroidRingSurface.kt +3 -3
- package/android/src/main/java/dev/poolse/callcore/android/CallCore.kt +112 -10
- package/android/src/main/java/dev/poolse/callcore/android/CallHttpClient.kt +3 -0
- package/android/src/main/java/dev/poolse/callcore/android/CallMessagingService.kt +21 -1
- package/android/src/main/java/dev/poolse/callcore/android/CallVideo.kt +14 -0
- package/android/src/main/java/dev/poolse/callcore/android/EscalationNotification.kt +475 -0
- package/android/src/main/java/dev/poolse/callcore/android/IncomingCallActivity.kt +9 -4
- package/android/src/main/java/dev/poolse/callcore/android/MeetingNotification.kt +127 -0
- package/android/src/main/java/dev/poolse/callcore/android/PoolseIncomingCall.kt +9 -0
- package/android/src/main/java/dev/poolse/callcore/android/RingBundle.kt +9 -0
- package/android/src/main/java/dev/poolse/callcore/android/SnapshotJson.kt +23 -0
- package/android/src/main/java/expo/modules/poolsecalls/PoolseCallsModule.kt +17 -1
- package/android/src/main/livekit/java/dev/poolse/callcore/livekit/LiveKitMediaPort.kt +174 -11
- package/dist/index.cjs +33 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +197 -23
- package/dist/index.d.ts +197 -23
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/ios/Core/CallCoreRuntime.swift +8 -0
- package/ios/Core/CallHttpClient.swift +11 -1
- package/ios/Core/Ports.swift +47 -2
- package/ios/Core/SnapshotEncoding.swift +39 -4
- package/ios/Module/PoolseCallsModule.swift +28 -1
- package/ios/Platform/CallCore.swift +68 -2
- package/ios/Platform/CallKitController.swift +1 -1
- package/ios/Platform/EscalationNotifications.swift +195 -0
- package/ios/Platform/LiveKitMediaPort.swift +178 -15
- package/ios/Platform/MessageNotifications.swift +60 -1
- package/ios/Platform/VoipPush.swift +11 -2
- package/package.json +1 -1
- package/src/index.ts +231 -23
package/dist/index.d.ts
CHANGED
|
@@ -20,8 +20,20 @@ interface Snapshot {
|
|
|
20
20
|
kind?: 'call' | 'room';
|
|
21
21
|
media: 'audio' | 'video';
|
|
22
22
|
phase: 'ringing_in' | 'ringing_out' | 'connecting' | 'active' | 'reconnecting' | 'ended';
|
|
23
|
-
reason?: 'left' | 'finished' | 'declined_all' | 'busy_all' | 'no_answer' | 'cancelled' | 'connection_lost' | 'failed'
|
|
24
|
-
/**
|
|
23
|
+
reason?: 'left' | 'finished' | 'declined_all' | 'busy_all' | 'no_answer' | 'cancelled' | 'connection_lost' | 'failed'
|
|
24
|
+
/**
|
|
25
|
+
* You took this call on another of your devices (`moveCallHere`
|
|
26
|
+
* there): it goes on without this one. Say "Moved to your other
|
|
27
|
+
* device", not "Call ended". Absent before 3.10.
|
|
28
|
+
*/
|
|
29
|
+
| 'moved';
|
|
30
|
+
/**
|
|
31
|
+
* REMOTE people only; `userId` is the LiveKit identity. poolse's
|
|
32
|
+
* transcript assistant (`poolse:…`, kind agent) and the recorder
|
|
33
|
+
* (LiveKit Egress, `EG_…`) are never listed — nor counted when the core
|
|
34
|
+
* ends a call left alone. Phone (SIP) participants are listed. Agents
|
|
35
|
+
* invited into the call are listed with `isAgent` (last), never counted.
|
|
36
|
+
*/
|
|
25
37
|
participants: Array<{
|
|
26
38
|
userId: string;
|
|
27
39
|
externalId: string;
|
|
@@ -40,6 +52,16 @@ interface Snapshot {
|
|
|
40
52
|
* Absent before 0.11.0.
|
|
41
53
|
*/
|
|
42
54
|
connectionQuality?: ConnectionQuality;
|
|
55
|
+
/**
|
|
56
|
+
* An agent in the call (server docs/AGENTS_IN_CALLS.md): show it with
|
|
57
|
+
* the Agent badge, named `agentLabel` — never as a person, never with
|
|
58
|
+
* a camera placeholder. Absent for people and before 3.10.
|
|
59
|
+
*/
|
|
60
|
+
isAgent?: boolean;
|
|
61
|
+
/** "Scout", or "Jasir's agent" for one attending on someone's behalf. */
|
|
62
|
+
agentLabel?: string | null;
|
|
63
|
+
/** `notetaker` (silent) | `assistant` (answers when named) | `delegate`. */
|
|
64
|
+
agentMode?: 'notetaker' | 'assistant' | 'delegate' | null;
|
|
43
65
|
}>;
|
|
44
66
|
/** The kind of output playing now — the short answer to "where is the audio". */
|
|
45
67
|
audioRoute: AudioOutputKind;
|
|
@@ -91,6 +113,69 @@ interface Snapshot {
|
|
|
91
113
|
* server's `name`. Absent before 3.8.
|
|
92
114
|
*/
|
|
93
115
|
workspaceName?: string | null;
|
|
116
|
+
/**
|
|
117
|
+
* Whether the server lets you publish. `false` while recording consent
|
|
118
|
+
* is required and you have not accepted (docs/RECORDING.md §5): you
|
|
119
|
+
* still hear and see the call, but nothing of yours goes out. Your
|
|
120
|
+
* `mutedSelf` / camera choices are kept and come back as they were once
|
|
121
|
+
* it turns `true` again (the core republishes by itself; call
|
|
122
|
+
* `republish()` from ConsentPrompt's `onAccepted` too). Absent before 3.9.
|
|
123
|
+
*/
|
|
124
|
+
canPublish?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* The call's recording state as the server last told this core (on
|
|
127
|
+
* answer / join / place and each reconnect) — enough to show the
|
|
128
|
+
* indicator at once. Live changes arrive on the conversation socket
|
|
129
|
+
* (`recording:*`). null: not known (a server without recording).
|
|
130
|
+
* Absent before 3.9.
|
|
131
|
+
*/
|
|
132
|
+
recording?: CallRecordingState | null;
|
|
133
|
+
/** The live transcript's state, the same way (`transcript:*` on the socket). Absent before 3.9. */
|
|
134
|
+
transcription?: CallTranscriptionState | null;
|
|
135
|
+
/**
|
|
136
|
+
* `meeting`: a scheduled meeting rang this device as it started (the
|
|
137
|
+
* push's `ring_type`), so the ring reads "Weekly sync is starting" and
|
|
138
|
+
* the call screen should name the meeting. `call` otherwise. Absent
|
|
139
|
+
* before 3.10.
|
|
140
|
+
*/
|
|
141
|
+
ringType?: 'call' | 'meeting';
|
|
142
|
+
/** The meeting's title for a `meeting` ring; null otherwise. Absent before 3.10. */
|
|
143
|
+
meetingTitle?: string | null;
|
|
144
|
+
/** Noise suppression on the microphone (on by default; `setNoiseSuppression`). Absent before 3.10. */
|
|
145
|
+
noiseSuppression?: boolean;
|
|
146
|
+
/** Background blur on the camera (`setBackgroundBlur`). Absent before 3.10. */
|
|
147
|
+
backgroundBlur?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* This call was taken over by your other device (`moveCallHere`
|
|
150
|
+
* there); the end that follows has `reason: 'moved'`. Absent before 3.10.
|
|
151
|
+
*/
|
|
152
|
+
movedElsewhere?: boolean;
|
|
153
|
+
}
|
|
154
|
+
/** The CallSummary's `recording` object, as the server sent it (docs/CALL_CONTRACT.md §4.2). */
|
|
155
|
+
interface CallRecordingState {
|
|
156
|
+
/** This server can record (LiveKit Egress). */
|
|
157
|
+
available: boolean;
|
|
158
|
+
active: boolean;
|
|
159
|
+
id: string | null;
|
|
160
|
+
mode: 'video' | 'audio' | null;
|
|
161
|
+
started_at: string | null;
|
|
162
|
+
started_by_user_id: string | null;
|
|
163
|
+
auto: boolean;
|
|
164
|
+
/** You may not publish until you accept. */
|
|
165
|
+
consent_required: boolean;
|
|
166
|
+
/** poolse user ids. */
|
|
167
|
+
consent?: {
|
|
168
|
+
accepted: string[];
|
|
169
|
+
declined: string[];
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
/** The CallSummary's `transcription` object, as the server sent it. */
|
|
173
|
+
interface CallTranscriptionState {
|
|
174
|
+
available: boolean;
|
|
175
|
+
active: boolean;
|
|
176
|
+
id: string | null;
|
|
177
|
+
status: 'live' | 'stopped' | 'ready' | null;
|
|
178
|
+
language: string | null;
|
|
94
179
|
}
|
|
95
180
|
/** `good` covers good and excellent; `unknown` until the SFU has measured. */
|
|
96
181
|
type ConnectionQuality = 'good' | 'poor' | 'lost' | 'unknown';
|
|
@@ -106,6 +191,10 @@ interface WaitingCall {
|
|
|
106
191
|
serverId?: string | null;
|
|
107
192
|
/** That workspace's name ("Ana · Acme"). Absent before 3.8. */
|
|
108
193
|
workspaceName?: string | null;
|
|
194
|
+
/** `meeting` when a scheduled meeting is starting rather than a person calling. Absent before 3.10. */
|
|
195
|
+
ringType?: 'call' | 'meeting';
|
|
196
|
+
/** The meeting's title for a `meeting` ring. Absent before 3.10. */
|
|
197
|
+
meetingTitle?: string | null;
|
|
109
198
|
}
|
|
110
199
|
/** One place call audio can play. */
|
|
111
200
|
interface AudioOutput {
|
|
@@ -212,33 +301,46 @@ interface CallServer {
|
|
|
212
301
|
name?: string;
|
|
213
302
|
}
|
|
214
303
|
/**
|
|
215
|
-
* What the user tapped on a missed-call notification: the
|
|
216
|
-
* itself (`open` the conversation)
|
|
217
|
-
* — place a call on the conversation with `media`)
|
|
304
|
+
* What the user tapped on a missed-call or meeting notification: the
|
|
305
|
+
* notification itself (`open` the conversation), a missed call's Call
|
|
306
|
+
* back (`call_back` — place a call on the conversation with `media`), or
|
|
307
|
+
* a starting meeting's Join (`join_meeting` — join the room `callId` in
|
|
308
|
+
* the conversation, e.g. `poolse.rooms.start(conversationId, media)`,
|
|
309
|
+
* which joins what is live).
|
|
218
310
|
*/
|
|
219
311
|
interface CallAction {
|
|
220
|
-
type: 'open' | 'call_back';
|
|
312
|
+
type: 'open' | 'call_back' | 'join_meeting';
|
|
221
313
|
conversationId: string;
|
|
222
314
|
callId: string | null;
|
|
223
315
|
media: 'audio' | 'video';
|
|
224
316
|
/** The server (workspace) it belongs to — open that one. Absent before 3.8. */
|
|
225
317
|
serverId?: string | null;
|
|
318
|
+
/** A meeting notice's scheduled meeting; null for missed calls. Absent before 3.10. */
|
|
319
|
+
scheduledMeetingId?: string | null;
|
|
226
320
|
}
|
|
227
321
|
/**
|
|
228
|
-
* A Reply or Mark as read the user did from a chat notification
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
322
|
+
* A Reply or Mark as read the user did from a chat notification — or an
|
|
323
|
+
* answer to an agent's question (`escalation`: Approve / Decline / Answer
|
|
324
|
+
* on an `agent_escalation` push) — after the native core sent it (or gave
|
|
325
|
+
* up). The server has already posted the reply and marked the
|
|
326
|
+
* conversation read, or passed the answer to the agent in the call; use
|
|
327
|
+
* this to refresh what the app shows without waiting for the socket, or
|
|
328
|
+
* to tell the user it did not go out.
|
|
233
329
|
*/
|
|
234
330
|
interface NotificationActionResult {
|
|
235
|
-
action: 'reply' | 'mark_read';
|
|
331
|
+
action: 'reply' | 'mark_read' | 'escalation';
|
|
332
|
+
/** The conversation (for `escalation`: the call's; `""` when the push had none). */
|
|
236
333
|
conversationId: string;
|
|
334
|
+
/** `escalation` only: which question, and how it was answered. Absent before 3.10. */
|
|
335
|
+
escalationId?: string;
|
|
336
|
+
decision?: 'approve' | 'decline' | 'answer';
|
|
337
|
+
/** `escalation` only: the call the agent is in. */
|
|
338
|
+
callId?: string | null;
|
|
237
339
|
/** The server (workspace) the conversation is on. Absent before 3.8. */
|
|
238
340
|
serverId?: string;
|
|
239
341
|
/** Whether the server accepted it. */
|
|
240
342
|
ok: boolean;
|
|
241
|
-
/** Reply
|
|
343
|
+
/** Reply (and an escalation's `answer`): what the user typed. */
|
|
242
344
|
text?: string;
|
|
243
345
|
/** Reply only: the idempotency id sent with it — the message's id once posted. */
|
|
244
346
|
clientId?: string;
|
|
@@ -249,7 +351,8 @@ interface NotificationActionResult {
|
|
|
249
351
|
* `device_signed_out`, `user_blocked`, `forbidden`, `not_found`,
|
|
250
352
|
* `mau_cap_exceeded`, `validation_failed`, `rate_limited`), or
|
|
251
353
|
* `network`, `no_grant` (the push carried no reply grant),
|
|
252
|
-
* `not_configured` (never `configure`d), `http_<status>`.
|
|
354
|
+
* `not_configured` (never `configure`d), `http_<status>`. An
|
|
355
|
+
* escalation: `not_pending`, `expired`, `invalid_token`, `no_token`.
|
|
253
356
|
*/
|
|
254
357
|
error?: string;
|
|
255
358
|
/** The HTTP status when the server answered with an error. */
|
|
@@ -301,6 +404,25 @@ declare function onCallState(cb: (snapshot: Snapshot | null) => void): Unsubscri
|
|
|
301
404
|
declare function place(conversationId: string, options: PlaceOptions): Promise<void>;
|
|
302
405
|
/** `serverId`: the server the session token is for — leave it out for the default one. */
|
|
303
406
|
declare function join(callId: string, conversationId: string | null, sessionToken: string, serverId?: string): Promise<void>;
|
|
407
|
+
/** What {@link moveCallHere} needs besides the call id. */
|
|
408
|
+
interface MoveCallOptions {
|
|
409
|
+
conversationId: string;
|
|
410
|
+
/** The user's session token on the call's server. */
|
|
411
|
+
sessionToken: string;
|
|
412
|
+
/** The call's server (an `addServer` id); leave it out for the default one. */
|
|
413
|
+
serverId?: string;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* "Move call to this device" (CL11): take a call you are on elsewhere
|
|
417
|
+
* — your desktop, your other phone — over to this one without hanging
|
|
418
|
+
* up. This device joins the same call; the server lets one device per
|
|
419
|
+
* person carry it (CALL_CONTRACT.md §9), so the other one is let go and
|
|
420
|
+
* its snapshot ends with `reason: 'moved'`. Offer it from the Join
|
|
421
|
+
* banner when `liveCalls` says you are already in the call.
|
|
422
|
+
*
|
|
423
|
+
* The camera follows the call's media on this device; mute starts off.
|
|
424
|
+
*/
|
|
425
|
+
declare function moveCallHere(callId: string, options: MoveCallOptions): Promise<void>;
|
|
304
426
|
interface StartRoomResult {
|
|
305
427
|
/** The room's call id — what the Join banner and `call:*` events carry. */
|
|
306
428
|
callId: string;
|
|
@@ -369,6 +491,33 @@ declare const screenShareSupported: () => boolean;
|
|
|
369
491
|
*/
|
|
370
492
|
declare const startScreenShare: () => Promise<boolean>;
|
|
371
493
|
declare const stopScreenShare: () => void;
|
|
494
|
+
/**
|
|
495
|
+
* Whether noise suppression can be switched. On by default on both
|
|
496
|
+
* platforms; the snapshot's `noiseSuppression` says what is in effect.
|
|
497
|
+
*/
|
|
498
|
+
declare const noiseSuppressionSupported: () => boolean;
|
|
499
|
+
/**
|
|
500
|
+
* Noise suppression on or off, for this and later calls (until the app
|
|
501
|
+
* restarts). Android: WebRTC's noise suppression on the microphone
|
|
502
|
+
* (echo cancellation stays on; the mic track is republished, a short
|
|
503
|
+
* gap). iOS: Apple's voice processing does echo cancellation and noise
|
|
504
|
+
* suppression as one, so off bypasses both — offer "off" for
|
|
505
|
+
* headphones only. Returns false when the build can't.
|
|
506
|
+
*/
|
|
507
|
+
declare const setNoiseSuppression: (on: boolean) => boolean;
|
|
508
|
+
/**
|
|
509
|
+
* Whether this build can blur the background behind you. iOS 15+: yes
|
|
510
|
+
* (Vision person segmentation). Android: not yet — it needs an ML Kit
|
|
511
|
+
* segmentation model, planned as a later addition. Hide the toggle when
|
|
512
|
+
* false.
|
|
513
|
+
*/
|
|
514
|
+
declare const backgroundBlurSupported: () => boolean;
|
|
515
|
+
/**
|
|
516
|
+
* Blur the background on your camera, kept across camera flips and
|
|
517
|
+
* calls. A no-op returning false where unsupported. Background
|
|
518
|
+
* pictures (replacement) are not offered on native yet.
|
|
519
|
+
*/
|
|
520
|
+
declare const setBackgroundBlur: (on: boolean) => boolean;
|
|
372
521
|
/** Route call audio to the loudspeaker (`true`) or back to earpiece / headset (`false`). */
|
|
373
522
|
declare const setSpeaker: (on: boolean) => void;
|
|
374
523
|
/**
|
|
@@ -379,6 +528,20 @@ declare const setSpeaker: (on: boolean) => void;
|
|
|
379
528
|
* the earpiece for voice calls or the speaker for video.
|
|
380
529
|
*/
|
|
381
530
|
declare function setAudioOutput(id: string): void;
|
|
531
|
+
/**
|
|
532
|
+
* Recording consent accepted (ConsentPrompt's `onAccepted`): publish the
|
|
533
|
+
* mic and camera again as the user last had them. The core also does it
|
|
534
|
+
* by itself once the server lets this participant publish; calling it
|
|
535
|
+
* early, or twice, is harmless — nothing goes out while
|
|
536
|
+
* `snapshot.canPublish` is false.
|
|
537
|
+
*/
|
|
538
|
+
declare const republish: () => void;
|
|
539
|
+
/**
|
|
540
|
+
* `snapshot.canPublish` changed (and once at subscribe time with the
|
|
541
|
+
* current value, while a call is up). `true` when no call is up or the
|
|
542
|
+
* native build predates it.
|
|
543
|
+
*/
|
|
544
|
+
declare function onCanPublishChange(cb: (canPublish: boolean) => void): Unsubscribe;
|
|
382
545
|
/**
|
|
383
546
|
* Socket forwarding for an open app: a `call:ring_ended` seen on the
|
|
384
547
|
* socket. Idempotent with the push path — the core dedupes.
|
|
@@ -407,18 +570,22 @@ declare const openFullScreenIntentSettings: () => void;
|
|
|
407
570
|
*/
|
|
408
571
|
declare function setShowOnLockscreen(enabled: boolean): void;
|
|
409
572
|
/**
|
|
410
|
-
*
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
*
|
|
573
|
+
* The notification action the app was LAUNCHED with, once — read it on
|
|
574
|
+
* mount. `null` when the app opened any other way.
|
|
575
|
+
*
|
|
576
|
+
* Android: missed calls and meeting notices (`starting` with Join, and
|
|
577
|
+
* the brief; server docs/MEETINGS.md §11.3), both posted by the native
|
|
578
|
+
* core from the push so they work with the app closed.
|
|
414
579
|
*
|
|
415
|
-
* iOS
|
|
416
|
-
*
|
|
417
|
-
*
|
|
580
|
+
* iOS: meeting notices (the alert push's category `poolse_meeting`, Join
|
|
581
|
+
* `poolse_meeting_join`), whose tap and Join arrive here as `open` /
|
|
582
|
+
* `join_meeting`. Missed calls there are an ordinary alert push (to the
|
|
583
|
+
* token you register with `kind: 'alert'`); read its taps with your
|
|
584
|
+
* notification library — its `type` is `call_missed`, the category
|
|
418
585
|
* `poolse_missed_call`, the Call back action `call_back`.
|
|
419
586
|
*/
|
|
420
587
|
declare function takeCallAction(): CallAction | null;
|
|
421
|
-
/**
|
|
588
|
+
/** A missed-call (Android) or meeting notification (both) tapped while the app is running. */
|
|
422
589
|
declare function onCallAction(cb: (action: CallAction) => void): Unsubscribe;
|
|
423
590
|
/**
|
|
424
591
|
* Tell the core which conversation is on screen (`null` when none, and
|
|
@@ -453,6 +620,13 @@ declare function conversationOfNotification(data: Record<string, unknown> | unde
|
|
|
453
620
|
declare function onNotificationAction(cb: (result: NotificationActionResult) => void): Unsubscribe;
|
|
454
621
|
/** `onNotificationAction`, replies only. */
|
|
455
622
|
declare function onNotificationReply(cb: (result: NotificationActionResult) => void): Unsubscribe;
|
|
623
|
+
/**
|
|
624
|
+
* `onNotificationAction`, agent escalations only (AG16): Approve / Decline
|
|
625
|
+
* / Answer on an `agent_escalation` push, answered natively from the lock
|
|
626
|
+
* screen. Feed `ok` ones to `poolse.escalations.list()` (or let
|
|
627
|
+
* `agent:escalation` do it) so an open card updates.
|
|
628
|
+
*/
|
|
629
|
+
declare function onEscalationAction(cb: (result: NotificationActionResult) => void): Unsubscribe;
|
|
456
630
|
/**
|
|
457
631
|
* The notification actions that finished while no `onNotificationAction`
|
|
458
632
|
* listener was attached (usually: the app was not running), oldest
|
|
@@ -512,4 +686,4 @@ interface CallVideoViewProps extends ViewProps {
|
|
|
512
686
|
*/
|
|
513
687
|
declare function CallVideoView(props: CallVideoViewProps): ReactElement | null;
|
|
514
688
|
|
|
515
|
-
export { type AudioOutput, type AudioOutputKind, type CallAction, type CallServer, CallVideoView, type CallVideoViewProps, type ConfigureOptions, type ConnectionQuality, DEFAULT_SERVER_ID, type IncomingCallOptions, type NotificationActionResult, type PlaceOptions, type RingIntoCallOptions, type Snapshot, type StartRoomResult, type Unsubscribe, type VoipToken, type WaitingCall, addServer, answer, answerWaiting, canUseFullScreenIntent, configure, conversationOfNotification, decline, declineWaiting, getCallState, getVoipToken, hangUp, isInPictureInPicture, join, listServers, nativeCallsAvailable, onCallAction, onCallFinished, onCallState, onNotificationAction, onNotificationReply, onPictureInPicture, onRingEnded, onVoipToken, openFullScreenIntentSettings, pictureInPictureSupported, place, removeServer, ringIntoCall, screenShareSupported, serverOfNotification, setActiveConversation, setAudioOutput, setCamera, setMuted, setPictureInPictureEnabled, setShowOnLockscreen, setSpeaker, shouldPresentMessage, startRoom, startScreenShare, stopScreenShare, switchCamera, takeCallAction, takeNotificationActions };
|
|
689
|
+
export { type AudioOutput, type AudioOutputKind, type CallAction, type CallRecordingState, type CallServer, type CallTranscriptionState, CallVideoView, type CallVideoViewProps, type ConfigureOptions, type ConnectionQuality, DEFAULT_SERVER_ID, type IncomingCallOptions, type MoveCallOptions, type NotificationActionResult, type PlaceOptions, type RingIntoCallOptions, type Snapshot, type StartRoomResult, type Unsubscribe, type VoipToken, type WaitingCall, addServer, answer, answerWaiting, backgroundBlurSupported, canUseFullScreenIntent, configure, conversationOfNotification, decline, declineWaiting, getCallState, getVoipToken, hangUp, isInPictureInPicture, join, listServers, moveCallHere, nativeCallsAvailable, noiseSuppressionSupported, onCallAction, onCallFinished, onCallState, onCanPublishChange, onEscalationAction, onNotificationAction, onNotificationReply, onPictureInPicture, onRingEnded, onVoipToken, openFullScreenIntentSettings, pictureInPictureSupported, place, removeServer, republish, ringIntoCall, screenShareSupported, serverOfNotification, setActiveConversation, setAudioOutput, setBackgroundBlur, setCamera, setMuted, setNoiseSuppression, setPictureInPictureEnabled, setShowOnLockscreen, setSpeaker, shouldPresentMessage, startRoom, startScreenShare, stopScreenShare, switchCamera, takeCallAction, takeNotificationActions };
|
package/dist/index.js
CHANGED
|
@@ -61,6 +61,9 @@ function place(conversationId, options) {
|
|
|
61
61
|
function join(callId, conversationId, sessionToken, serverId) {
|
|
62
62
|
return native?.join(callId, conversationId, sessionToken, serverId ?? null) ?? Promise.resolve();
|
|
63
63
|
}
|
|
64
|
+
function moveCallHere(callId, options) {
|
|
65
|
+
return join(callId, options.conversationId, options.sessionToken, options.serverId);
|
|
66
|
+
}
|
|
64
67
|
async function startRoom(conversationId, options) {
|
|
65
68
|
if (!native) throw new Error("The native call core is not in this build.");
|
|
66
69
|
const origin = originOf(options.serverId);
|
|
@@ -113,11 +116,28 @@ var switchCamera = () => native?.switchCamera();
|
|
|
113
116
|
var screenShareSupported = () => native?.screenShareSupported?.() ?? false;
|
|
114
117
|
var startScreenShare = async () => await native?.startScreenShare?.() ?? false;
|
|
115
118
|
var stopScreenShare = () => native?.stopScreenShare?.();
|
|
119
|
+
var noiseSuppressionSupported = () => native?.noiseSuppressionSupported?.() ?? false;
|
|
120
|
+
var setNoiseSuppression = (on) => native?.setNoiseSuppression?.(on) ?? false;
|
|
121
|
+
var backgroundBlurSupported = () => native?.backgroundBlurSupported?.() ?? false;
|
|
122
|
+
var setBackgroundBlur = (on) => native?.setBackgroundBlur?.(on) ?? false;
|
|
116
123
|
var setSpeaker = (on) => native?.setSpeaker(on);
|
|
117
124
|
function setAudioOutput(id) {
|
|
118
125
|
if (native?.setAudioOutput) native.setAudioOutput(id);
|
|
119
126
|
else native?.setSpeaker(id === "speaker");
|
|
120
127
|
}
|
|
128
|
+
var republish = () => native?.republish?.();
|
|
129
|
+
function onCanPublishChange(cb) {
|
|
130
|
+
let last = null;
|
|
131
|
+
const check = (snapshot) => {
|
|
132
|
+
const now = snapshot?.canPublish ?? true;
|
|
133
|
+
if (now === last) return;
|
|
134
|
+
const first = last === null;
|
|
135
|
+
last = now;
|
|
136
|
+
if (!first || snapshot) cb(now);
|
|
137
|
+
};
|
|
138
|
+
check(getCallState());
|
|
139
|
+
return onCallState(check);
|
|
140
|
+
}
|
|
121
141
|
var onRingEnded = (callId, reason) => native?.onRingEnded(callId, reason);
|
|
122
142
|
var onCallFinished = (callId, reason) => native?.onCallFinished(callId, reason ?? null);
|
|
123
143
|
var canUseFullScreenIntent = () => native?.canUseFullScreenIntent() ?? true;
|
|
@@ -172,6 +192,11 @@ function onNotificationReply(cb) {
|
|
|
172
192
|
if (result.action === "reply") cb(result);
|
|
173
193
|
});
|
|
174
194
|
}
|
|
195
|
+
function onEscalationAction(cb) {
|
|
196
|
+
return onNotificationAction((result) => {
|
|
197
|
+
if (result.action === "escalation") cb(result);
|
|
198
|
+
});
|
|
199
|
+
}
|
|
175
200
|
function takeNotificationActions() {
|
|
176
201
|
return native?.takeNotificationActions?.() ?? [];
|
|
177
202
|
}
|
|
@@ -227,6 +252,6 @@ function CallVideoView(props) {
|
|
|
227
252
|
return createElement(Native, props);
|
|
228
253
|
}
|
|
229
254
|
|
|
230
|
-
export { CallVideoView, DEFAULT_SERVER_ID, addServer, answer, answerWaiting, canUseFullScreenIntent, configure, conversationOfNotification, decline, declineWaiting, getCallState, getVoipToken, hangUp, isInPictureInPicture, join, listServers, nativeCallsAvailable, onCallAction, onCallFinished, onCallState, onNotificationAction, onNotificationReply, onPictureInPicture, onRingEnded, onVoipToken, openFullScreenIntentSettings, pictureInPictureSupported, place, removeServer, ringIntoCall, screenShareSupported, serverOfNotification, setActiveConversation, setAudioOutput, setCamera, setMuted, setPictureInPictureEnabled, setShowOnLockscreen, setSpeaker, shouldPresentMessage, startRoom, startScreenShare, stopScreenShare, switchCamera, takeCallAction, takeNotificationActions };
|
|
255
|
+
export { CallVideoView, DEFAULT_SERVER_ID, addServer, answer, answerWaiting, backgroundBlurSupported, canUseFullScreenIntent, configure, conversationOfNotification, decline, declineWaiting, getCallState, getVoipToken, hangUp, isInPictureInPicture, join, listServers, moveCallHere, nativeCallsAvailable, noiseSuppressionSupported, onCallAction, onCallFinished, onCallState, onCanPublishChange, onEscalationAction, onNotificationAction, onNotificationReply, onPictureInPicture, onRingEnded, onVoipToken, openFullScreenIntentSettings, pictureInPictureSupported, place, removeServer, republish, ringIntoCall, screenShareSupported, serverOfNotification, setActiveConversation, setAudioOutput, setBackgroundBlur, setCamera, setMuted, setNoiseSuppression, setPictureInPictureEnabled, setShowOnLockscreen, setSpeaker, shouldPresentMessage, startRoom, startScreenShare, stopScreenShare, switchCamera, takeCallAction, takeNotificationActions };
|
|
231
256
|
//# sourceMappingURL=index.js.map
|
|
232
257
|
//# sourceMappingURL=index.js.map
|