@poolse/native 3.9.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 +40 -0
- package/README.md +94 -9
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/dev/poolse/callcore/Ports.kt +21 -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 +91 -10
- 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/expo/modules/poolsecalls/PoolseCallsModule.kt +15 -1
- package/android/src/main/livekit/java/dev/poolse/callcore/livekit/LiveKitMediaPort.kt +82 -6
- package/dist/index.cjs +18 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +133 -23
- package/dist/index.d.ts +133 -23
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/ios/Core/Ports.swift +22 -1
- package/ios/Core/SnapshotEncoding.swift +22 -3
- package/ios/Module/PoolseCallsModule.swift +26 -1
- package/ios/Platform/CallCore.swift +52 -1
- package/ios/Platform/CallKitController.swift +1 -1
- package/ios/Platform/EscalationNotifications.swift +195 -0
- package/ios/Platform/LiveKitMediaPort.swift +77 -3
- package/ios/Platform/MessageNotifications.swift +60 -1
- package/ios/Platform/VoipPush.swift +11 -2
- package/package.json +1 -1
- package/src/index.ts +154 -23
package/dist/index.d.cts
CHANGED
|
@@ -20,12 +20,19 @@ 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'
|
|
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';
|
|
24
30
|
/**
|
|
25
31
|
* REMOTE people only; `userId` is the LiveKit identity. poolse's
|
|
26
32
|
* transcript assistant (`poolse:…`, kind agent) and the recorder
|
|
27
33
|
* (LiveKit Egress, `EG_…`) are never listed — nor counted when the core
|
|
28
|
-
* ends a call left alone. Phone (SIP) participants are listed.
|
|
34
|
+
* ends a call left alone. Phone (SIP) participants are listed. Agents
|
|
35
|
+
* invited into the call are listed with `isAgent` (last), never counted.
|
|
29
36
|
*/
|
|
30
37
|
participants: Array<{
|
|
31
38
|
userId: string;
|
|
@@ -45,6 +52,16 @@ interface Snapshot {
|
|
|
45
52
|
* Absent before 0.11.0.
|
|
46
53
|
*/
|
|
47
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;
|
|
48
65
|
}>;
|
|
49
66
|
/** The kind of output playing now — the short answer to "where is the audio". */
|
|
50
67
|
audioRoute: AudioOutputKind;
|
|
@@ -115,6 +132,24 @@ interface Snapshot {
|
|
|
115
132
|
recording?: CallRecordingState | null;
|
|
116
133
|
/** The live transcript's state, the same way (`transcript:*` on the socket). Absent before 3.9. */
|
|
117
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;
|
|
118
153
|
}
|
|
119
154
|
/** The CallSummary's `recording` object, as the server sent it (docs/CALL_CONTRACT.md §4.2). */
|
|
120
155
|
interface CallRecordingState {
|
|
@@ -156,6 +191,10 @@ interface WaitingCall {
|
|
|
156
191
|
serverId?: string | null;
|
|
157
192
|
/** That workspace's name ("Ana · Acme"). Absent before 3.8. */
|
|
158
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;
|
|
159
198
|
}
|
|
160
199
|
/** One place call audio can play. */
|
|
161
200
|
interface AudioOutput {
|
|
@@ -262,33 +301,46 @@ interface CallServer {
|
|
|
262
301
|
name?: string;
|
|
263
302
|
}
|
|
264
303
|
/**
|
|
265
|
-
* What the user tapped on a missed-call notification: the
|
|
266
|
-
* itself (`open` the conversation)
|
|
267
|
-
* — 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).
|
|
268
310
|
*/
|
|
269
311
|
interface CallAction {
|
|
270
|
-
type: 'open' | 'call_back';
|
|
312
|
+
type: 'open' | 'call_back' | 'join_meeting';
|
|
271
313
|
conversationId: string;
|
|
272
314
|
callId: string | null;
|
|
273
315
|
media: 'audio' | 'video';
|
|
274
316
|
/** The server (workspace) it belongs to — open that one. Absent before 3.8. */
|
|
275
317
|
serverId?: string | null;
|
|
318
|
+
/** A meeting notice's scheduled meeting; null for missed calls. Absent before 3.10. */
|
|
319
|
+
scheduledMeetingId?: string | null;
|
|
276
320
|
}
|
|
277
321
|
/**
|
|
278
|
-
* A Reply or Mark as read the user did from a chat notification
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
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.
|
|
283
329
|
*/
|
|
284
330
|
interface NotificationActionResult {
|
|
285
|
-
action: 'reply' | 'mark_read';
|
|
331
|
+
action: 'reply' | 'mark_read' | 'escalation';
|
|
332
|
+
/** The conversation (for `escalation`: the call's; `""` when the push had none). */
|
|
286
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;
|
|
287
339
|
/** The server (workspace) the conversation is on. Absent before 3.8. */
|
|
288
340
|
serverId?: string;
|
|
289
341
|
/** Whether the server accepted it. */
|
|
290
342
|
ok: boolean;
|
|
291
|
-
/** Reply
|
|
343
|
+
/** Reply (and an escalation's `answer`): what the user typed. */
|
|
292
344
|
text?: string;
|
|
293
345
|
/** Reply only: the idempotency id sent with it — the message's id once posted. */
|
|
294
346
|
clientId?: string;
|
|
@@ -299,7 +351,8 @@ interface NotificationActionResult {
|
|
|
299
351
|
* `device_signed_out`, `user_blocked`, `forbidden`, `not_found`,
|
|
300
352
|
* `mau_cap_exceeded`, `validation_failed`, `rate_limited`), or
|
|
301
353
|
* `network`, `no_grant` (the push carried no reply grant),
|
|
302
|
-
* `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`.
|
|
303
356
|
*/
|
|
304
357
|
error?: string;
|
|
305
358
|
/** The HTTP status when the server answered with an error. */
|
|
@@ -351,6 +404,25 @@ declare function onCallState(cb: (snapshot: Snapshot | null) => void): Unsubscri
|
|
|
351
404
|
declare function place(conversationId: string, options: PlaceOptions): Promise<void>;
|
|
352
405
|
/** `serverId`: the server the session token is for — leave it out for the default one. */
|
|
353
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>;
|
|
354
426
|
interface StartRoomResult {
|
|
355
427
|
/** The room's call id — what the Join banner and `call:*` events carry. */
|
|
356
428
|
callId: string;
|
|
@@ -419,6 +491,33 @@ declare const screenShareSupported: () => boolean;
|
|
|
419
491
|
*/
|
|
420
492
|
declare const startScreenShare: () => Promise<boolean>;
|
|
421
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;
|
|
422
521
|
/** Route call audio to the loudspeaker (`true`) or back to earpiece / headset (`false`). */
|
|
423
522
|
declare const setSpeaker: (on: boolean) => void;
|
|
424
523
|
/**
|
|
@@ -471,18 +570,22 @@ declare const openFullScreenIntentSettings: () => void;
|
|
|
471
570
|
*/
|
|
472
571
|
declare function setShowOnLockscreen(enabled: boolean): void;
|
|
473
572
|
/**
|
|
474
|
-
*
|
|
475
|
-
*
|
|
476
|
-
* way. The native core posts that notification itself from the push,
|
|
477
|
-
* so it works with the app closed.
|
|
573
|
+
* The notification action the app was LAUNCHED with, once — read it on
|
|
574
|
+
* mount. `null` when the app opened any other way.
|
|
478
575
|
*
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
*
|
|
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.
|
|
579
|
+
*
|
|
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
|
|
482
585
|
* `poolse_missed_call`, the Call back action `call_back`.
|
|
483
586
|
*/
|
|
484
587
|
declare function takeCallAction(): CallAction | null;
|
|
485
|
-
/**
|
|
588
|
+
/** A missed-call (Android) or meeting notification (both) tapped while the app is running. */
|
|
486
589
|
declare function onCallAction(cb: (action: CallAction) => void): Unsubscribe;
|
|
487
590
|
/**
|
|
488
591
|
* Tell the core which conversation is on screen (`null` when none, and
|
|
@@ -517,6 +620,13 @@ declare function conversationOfNotification(data: Record<string, unknown> | unde
|
|
|
517
620
|
declare function onNotificationAction(cb: (result: NotificationActionResult) => void): Unsubscribe;
|
|
518
621
|
/** `onNotificationAction`, replies only. */
|
|
519
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;
|
|
520
630
|
/**
|
|
521
631
|
* The notification actions that finished while no `onNotificationAction`
|
|
522
632
|
* listener was attached (usually: the app was not running), oldest
|
|
@@ -576,4 +686,4 @@ interface CallVideoViewProps extends ViewProps {
|
|
|
576
686
|
*/
|
|
577
687
|
declare function CallVideoView(props: CallVideoViewProps): ReactElement | null;
|
|
578
688
|
|
|
579
|
-
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 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, onCanPublishChange, onNotificationAction, onNotificationReply, onPictureInPicture, onRingEnded, onVoipToken, openFullScreenIntentSettings, pictureInPictureSupported, place, removeServer, republish, 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.d.ts
CHANGED
|
@@ -20,12 +20,19 @@ 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'
|
|
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';
|
|
24
30
|
/**
|
|
25
31
|
* REMOTE people only; `userId` is the LiveKit identity. poolse's
|
|
26
32
|
* transcript assistant (`poolse:…`, kind agent) and the recorder
|
|
27
33
|
* (LiveKit Egress, `EG_…`) are never listed — nor counted when the core
|
|
28
|
-
* ends a call left alone. Phone (SIP) participants are listed.
|
|
34
|
+
* ends a call left alone. Phone (SIP) participants are listed. Agents
|
|
35
|
+
* invited into the call are listed with `isAgent` (last), never counted.
|
|
29
36
|
*/
|
|
30
37
|
participants: Array<{
|
|
31
38
|
userId: string;
|
|
@@ -45,6 +52,16 @@ interface Snapshot {
|
|
|
45
52
|
* Absent before 0.11.0.
|
|
46
53
|
*/
|
|
47
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;
|
|
48
65
|
}>;
|
|
49
66
|
/** The kind of output playing now — the short answer to "where is the audio". */
|
|
50
67
|
audioRoute: AudioOutputKind;
|
|
@@ -115,6 +132,24 @@ interface Snapshot {
|
|
|
115
132
|
recording?: CallRecordingState | null;
|
|
116
133
|
/** The live transcript's state, the same way (`transcript:*` on the socket). Absent before 3.9. */
|
|
117
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;
|
|
118
153
|
}
|
|
119
154
|
/** The CallSummary's `recording` object, as the server sent it (docs/CALL_CONTRACT.md §4.2). */
|
|
120
155
|
interface CallRecordingState {
|
|
@@ -156,6 +191,10 @@ interface WaitingCall {
|
|
|
156
191
|
serverId?: string | null;
|
|
157
192
|
/** That workspace's name ("Ana · Acme"). Absent before 3.8. */
|
|
158
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;
|
|
159
198
|
}
|
|
160
199
|
/** One place call audio can play. */
|
|
161
200
|
interface AudioOutput {
|
|
@@ -262,33 +301,46 @@ interface CallServer {
|
|
|
262
301
|
name?: string;
|
|
263
302
|
}
|
|
264
303
|
/**
|
|
265
|
-
* What the user tapped on a missed-call notification: the
|
|
266
|
-
* itself (`open` the conversation)
|
|
267
|
-
* — 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).
|
|
268
310
|
*/
|
|
269
311
|
interface CallAction {
|
|
270
|
-
type: 'open' | 'call_back';
|
|
312
|
+
type: 'open' | 'call_back' | 'join_meeting';
|
|
271
313
|
conversationId: string;
|
|
272
314
|
callId: string | null;
|
|
273
315
|
media: 'audio' | 'video';
|
|
274
316
|
/** The server (workspace) it belongs to — open that one. Absent before 3.8. */
|
|
275
317
|
serverId?: string | null;
|
|
318
|
+
/** A meeting notice's scheduled meeting; null for missed calls. Absent before 3.10. */
|
|
319
|
+
scheduledMeetingId?: string | null;
|
|
276
320
|
}
|
|
277
321
|
/**
|
|
278
|
-
* A Reply or Mark as read the user did from a chat notification
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
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.
|
|
283
329
|
*/
|
|
284
330
|
interface NotificationActionResult {
|
|
285
|
-
action: 'reply' | 'mark_read';
|
|
331
|
+
action: 'reply' | 'mark_read' | 'escalation';
|
|
332
|
+
/** The conversation (for `escalation`: the call's; `""` when the push had none). */
|
|
286
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;
|
|
287
339
|
/** The server (workspace) the conversation is on. Absent before 3.8. */
|
|
288
340
|
serverId?: string;
|
|
289
341
|
/** Whether the server accepted it. */
|
|
290
342
|
ok: boolean;
|
|
291
|
-
/** Reply
|
|
343
|
+
/** Reply (and an escalation's `answer`): what the user typed. */
|
|
292
344
|
text?: string;
|
|
293
345
|
/** Reply only: the idempotency id sent with it — the message's id once posted. */
|
|
294
346
|
clientId?: string;
|
|
@@ -299,7 +351,8 @@ interface NotificationActionResult {
|
|
|
299
351
|
* `device_signed_out`, `user_blocked`, `forbidden`, `not_found`,
|
|
300
352
|
* `mau_cap_exceeded`, `validation_failed`, `rate_limited`), or
|
|
301
353
|
* `network`, `no_grant` (the push carried no reply grant),
|
|
302
|
-
* `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`.
|
|
303
356
|
*/
|
|
304
357
|
error?: string;
|
|
305
358
|
/** The HTTP status when the server answered with an error. */
|
|
@@ -351,6 +404,25 @@ declare function onCallState(cb: (snapshot: Snapshot | null) => void): Unsubscri
|
|
|
351
404
|
declare function place(conversationId: string, options: PlaceOptions): Promise<void>;
|
|
352
405
|
/** `serverId`: the server the session token is for — leave it out for the default one. */
|
|
353
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>;
|
|
354
426
|
interface StartRoomResult {
|
|
355
427
|
/** The room's call id — what the Join banner and `call:*` events carry. */
|
|
356
428
|
callId: string;
|
|
@@ -419,6 +491,33 @@ declare const screenShareSupported: () => boolean;
|
|
|
419
491
|
*/
|
|
420
492
|
declare const startScreenShare: () => Promise<boolean>;
|
|
421
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;
|
|
422
521
|
/** Route call audio to the loudspeaker (`true`) or back to earpiece / headset (`false`). */
|
|
423
522
|
declare const setSpeaker: (on: boolean) => void;
|
|
424
523
|
/**
|
|
@@ -471,18 +570,22 @@ declare const openFullScreenIntentSettings: () => void;
|
|
|
471
570
|
*/
|
|
472
571
|
declare function setShowOnLockscreen(enabled: boolean): void;
|
|
473
572
|
/**
|
|
474
|
-
*
|
|
475
|
-
*
|
|
476
|
-
* way. The native core posts that notification itself from the push,
|
|
477
|
-
* so it works with the app closed.
|
|
573
|
+
* The notification action the app was LAUNCHED with, once — read it on
|
|
574
|
+
* mount. `null` when the app opened any other way.
|
|
478
575
|
*
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
*
|
|
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.
|
|
579
|
+
*
|
|
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
|
|
482
585
|
* `poolse_missed_call`, the Call back action `call_back`.
|
|
483
586
|
*/
|
|
484
587
|
declare function takeCallAction(): CallAction | null;
|
|
485
|
-
/**
|
|
588
|
+
/** A missed-call (Android) or meeting notification (both) tapped while the app is running. */
|
|
486
589
|
declare function onCallAction(cb: (action: CallAction) => void): Unsubscribe;
|
|
487
590
|
/**
|
|
488
591
|
* Tell the core which conversation is on screen (`null` when none, and
|
|
@@ -517,6 +620,13 @@ declare function conversationOfNotification(data: Record<string, unknown> | unde
|
|
|
517
620
|
declare function onNotificationAction(cb: (result: NotificationActionResult) => void): Unsubscribe;
|
|
518
621
|
/** `onNotificationAction`, replies only. */
|
|
519
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;
|
|
520
630
|
/**
|
|
521
631
|
* The notification actions that finished while no `onNotificationAction`
|
|
522
632
|
* listener was attached (usually: the app was not running), oldest
|
|
@@ -576,4 +686,4 @@ interface CallVideoViewProps extends ViewProps {
|
|
|
576
686
|
*/
|
|
577
687
|
declare function CallVideoView(props: CallVideoViewProps): ReactElement | null;
|
|
578
688
|
|
|
579
|
-
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 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, onCanPublishChange, onNotificationAction, onNotificationReply, onPictureInPicture, onRingEnded, onVoipToken, openFullScreenIntentSettings, pictureInPictureSupported, place, removeServer, republish, 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,6 +116,10 @@ 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);
|
|
@@ -185,6 +192,11 @@ function onNotificationReply(cb) {
|
|
|
185
192
|
if (result.action === "reply") cb(result);
|
|
186
193
|
});
|
|
187
194
|
}
|
|
195
|
+
function onEscalationAction(cb) {
|
|
196
|
+
return onNotificationAction((result) => {
|
|
197
|
+
if (result.action === "escalation") cb(result);
|
|
198
|
+
});
|
|
199
|
+
}
|
|
188
200
|
function takeNotificationActions() {
|
|
189
201
|
return native?.takeNotificationActions?.() ?? [];
|
|
190
202
|
}
|
|
@@ -240,6 +252,6 @@ function CallVideoView(props) {
|
|
|
240
252
|
return createElement(Native, props);
|
|
241
253
|
}
|
|
242
254
|
|
|
243
|
-
export { CallVideoView, DEFAULT_SERVER_ID, addServer, answer, answerWaiting, canUseFullScreenIntent, configure, conversationOfNotification, decline, declineWaiting, getCallState, getVoipToken, hangUp, isInPictureInPicture, join, listServers, nativeCallsAvailable, onCallAction, onCallFinished, onCallState, onCanPublishChange, onNotificationAction, onNotificationReply, onPictureInPicture, onRingEnded, onVoipToken, openFullScreenIntentSettings, pictureInPictureSupported, place, removeServer, republish, 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 };
|
|
244
256
|
//# sourceMappingURL=index.js.map
|
|
245
257
|
//# sourceMappingURL=index.js.map
|