@opencxh/domain 1.113.0 → 1.113.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/platform/communication.d.ts +34 -17
- package/package.json +1 -1
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export type SessionState = 'idle' | 'ringing' | 'connecting' | 'connected' | 'on_hold' | 'ended' | 'failed';
|
|
2
|
+
/**
|
|
3
|
+
* `"appName:ResourceName"` — how the platform addresses a federated resource.
|
|
4
|
+
* Not to be confused with the read-state `ResourceRef`, which points at a
|
|
5
|
+
* domain object rather than at a piece of UI.
|
|
6
|
+
*/
|
|
7
|
+
export type FederatedResourceRef = `${string}:${string}`;
|
|
2
8
|
export interface Session {
|
|
3
9
|
id: string;
|
|
4
10
|
accountId: string;
|
|
@@ -25,8 +31,8 @@ export interface Session {
|
|
|
25
31
|
*/
|
|
26
32
|
externalId?: string;
|
|
27
33
|
ui: {
|
|
28
|
-
canvas:
|
|
29
|
-
actionTray?:
|
|
34
|
+
canvas: FederatedResourceRef;
|
|
35
|
+
actionTray?: FederatedResourceRef;
|
|
30
36
|
};
|
|
31
37
|
}
|
|
32
38
|
export interface CommsAccount<T = any> {
|
|
@@ -278,25 +284,36 @@ export declare const InteractionParticipantRole: {
|
|
|
278
284
|
readonly PARTICIPANT: "participant";
|
|
279
285
|
};
|
|
280
286
|
export type InteractionParticipantRoleValue = typeof InteractionParticipantRole[keyof typeof InteractionParticipantRole];
|
|
281
|
-
/**
|
|
282
|
-
* Which surface the call dock shows in place of the provider's canvas.
|
|
283
|
-
*
|
|
284
|
-
* The canvas and the action tray are separate federated resources, so they
|
|
285
|
-
* cannot hold state between them. The host owns this instead: it renders the
|
|
286
|
-
* keypad and the transfer form itself — both are platform operations
|
|
287
|
-
* (`session.dtmf`, `session.transfer`), not provider UI — and hands the tray
|
|
288
|
-
* the current value plus a setter through `CallActionTrayProps`. A tray that
|
|
289
|
-
* ignores them simply never offers the panels, which is the right answer for a
|
|
290
|
-
* provider that cannot do tones or transfers.
|
|
291
|
-
*/
|
|
292
|
-
export type CallPanel = "main" | "keypad" | "transfer";
|
|
293
287
|
/** Props the host passes to a provider's `ui.actionTray` resource. */
|
|
294
288
|
export interface CallActionTrayProps {
|
|
295
289
|
session: Session;
|
|
296
290
|
account?: CommsAccount;
|
|
297
|
-
/**
|
|
298
|
-
|
|
299
|
-
|
|
291
|
+
/**
|
|
292
|
+
* Resource currently shown in place of `ui.canvas`, or null for the canvas
|
|
293
|
+
* itself. The canvas and the tray are separate federated resources and
|
|
294
|
+
* cannot hold state between them, so the host holds this one value and both
|
|
295
|
+
* sides speak the same currency they already use for `ui.canvas`: a
|
|
296
|
+
* resource reference.
|
|
297
|
+
*
|
|
298
|
+
* Deliberately a reference and not an enum of known panels. A keypad or a
|
|
299
|
+
* transfer form is not the same everywhere — a provider that transfers to a
|
|
300
|
+
* directory rather than to a dialled number points this at its own
|
|
301
|
+
* resource, and a provider that can do neither leaves the affordance out.
|
|
302
|
+
* `communication:CallKeypad` and `communication:CallTransfer` are there to
|
|
303
|
+
* be reused by any provider that wants the plain ones.
|
|
304
|
+
*
|
|
305
|
+
* Both are absent when the host does not support overriding the canvas; a
|
|
306
|
+
* tray must then not offer the affordance.
|
|
307
|
+
*/
|
|
308
|
+
canvasOverride?: FederatedResourceRef | null;
|
|
309
|
+
onCanvasOverride?: (resource: FederatedResourceRef | null) => void;
|
|
310
|
+
}
|
|
311
|
+
/** Props the host passes to a resource shown via `canvasOverride`. */
|
|
312
|
+
export interface CallCanvasOverrideProps {
|
|
313
|
+
session: Session;
|
|
314
|
+
account?: CommsAccount;
|
|
315
|
+
/** Return to the provider's own canvas. */
|
|
316
|
+
onClose: () => void;
|
|
300
317
|
}
|
|
301
318
|
export interface SessionAction {
|
|
302
319
|
id: string;
|