@opencxh/domain 1.171.0 → 1.172.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/activity/blocks.d.ts +30 -30
- package/dist/entities/activity/catalog.d.ts +63 -86
- package/dist/entities/activity/descriptor.d.ts +31 -32
- package/dist/entities/activity/index.d.ts +2 -2
- package/dist/entities/activity/preview.d.ts +7 -7
- package/dist/entities/activity/resolve.d.ts +37 -38
- package/dist/entities/activity/types.d.ts +34 -34
- package/dist/entities/ai-account/types.d.ts +3 -3
- package/dist/entities/ai-account/vendors.d.ts +25 -32
- package/dist/entities/ai-budget/types.d.ts +12 -8
- package/dist/entities/ai-conversation/types.d.ts +12 -12
- package/dist/entities/ai-profile/types.d.ts +21 -26
- package/dist/entities/ai-settings/types.d.ts +12 -13
- package/dist/entities/analytics/dashboard.d.ts +1 -1
- package/dist/entities/analytics/index.d.ts +4 -4
- package/dist/entities/analytics/source.d.ts +1 -1
- package/dist/entities/analytics/usage.d.ts +23 -28
- package/dist/entities/artifact/blocks.d.ts +54 -69
- package/dist/entities/artifact/markdown.d.ts +2 -3
- package/dist/entities/artifact/types.d.ts +47 -55
- package/dist/entities/assignment/types.d.ts +74 -88
- package/dist/entities/calendar-event/types.d.ts +1 -1
- package/dist/entities/channel/index.d.ts +1 -1
- package/dist/entities/channel/signature.d.ts +8 -9
- package/dist/entities/communication/index.d.ts +1 -1
- package/dist/entities/communication/message-template.d.ts +1 -1
- package/dist/entities/company/types.d.ts +1 -1
- package/dist/entities/contact/index.d.ts +1 -1
- package/dist/entities/contact/provider.d.ts +2 -1
- package/dist/entities/contact/types.d.ts +1 -10
- package/dist/entities/custom-field-def/types.d.ts +14 -14
- package/dist/entities/external-identity/types.d.ts +45 -50
- package/dist/entities/interaction/index.d.ts +1 -1
- package/dist/entities/interaction/types.d.ts +44 -47
- package/dist/entities/live-lens/types.d.ts +39 -44
- package/dist/entities/mcp/types.d.ts +53 -57
- package/dist/entities/memory/alias.d.ts +7 -7
- package/dist/entities/memory/browse.d.ts +21 -21
- package/dist/entities/memory/ingest.d.ts +26 -17
- package/dist/entities/memory/item.d.ts +53 -58
- package/dist/entities/memory/kind.d.ts +26 -26
- package/dist/entities/memory/query.d.ts +49 -51
- package/dist/entities/playbook/actor.d.ts +20 -19
- package/dist/entities/playbook/assignment.d.ts +54 -63
- package/dist/entities/playbook/index.d.ts +2 -2
- package/dist/entities/playbook/labels.d.ts +4 -4
- package/dist/entities/playbook/trigger-vars.d.ts +14 -15
- package/dist/entities/playbook/types.d.ts +173 -303
- package/dist/entities/resource-reminder/types.d.ts +8 -9
- package/dist/entities/scope/actor.d.ts +16 -0
- package/dist/entities/{note → scope}/index.d.ts +1 -0
- package/dist/entities/scope/scope.test.d.ts +1 -0
- package/dist/entities/scope/types.d.ts +53 -0
- package/dist/entities/task/types.d.ts +1 -1
- package/dist/entities/time-entry/duration.d.ts +11 -11
- package/dist/entities/time-entry/types.d.ts +60 -60
- package/dist/entities/time-entry/work-type.d.ts +21 -24
- package/dist/entities/topic/examples.d.ts +26 -27
- package/dist/entities/topic/scope.d.ts +11 -12
- package/dist/entities/topic/types.d.ts +28 -28
- package/dist/entities/user/types.d.ts +24 -28
- package/dist/entities/webhook/types.d.ts +6 -6
- package/dist/entities/work/keys.d.ts +25 -26
- package/dist/entities/work/ladder.d.ts +48 -52
- package/dist/entities/work/types.d.ts +109 -115
- package/dist/index.cjs +6 -6
- package/dist/index.d.ts +29 -33
- package/dist/index.js +1391 -1254
- package/dist/platform/account.d.ts +34 -38
- package/dist/platform/ai-tools.d.ts +48 -52
- package/dist/platform/api.d.ts +9 -8
- package/dist/platform/author.d.ts +7 -9
- package/dist/platform/capabilities.d.ts +3 -3
- package/dist/platform/communication.d.ts +163 -204
- package/dist/platform/context.d.ts +8 -8
- package/dist/platform/identity.d.ts +16 -19
- package/dist/platform/kernel.d.ts +1 -1
- package/dist/platform/manifest.d.ts +2 -2
- package/dist/platform/media.d.ts +13 -15
- package/dist/platform/permission.d.ts +39 -0
- package/dist/platform/permission.test.d.ts +1 -0
- package/dist/platform/presence.d.ts +30 -30
- package/dist/platform/provider.d.ts +14 -76
- package/dist/platform/resource-source.d.ts +43 -45
- package/dist/platform/resource.d.ts +17 -23
- package/dist/platform/scope.d.ts +36 -62
- package/dist/platform/services.d.ts +4 -4
- package/dist/platform/settings.d.ts +0 -14
- package/dist/platform/storage.d.ts +2 -2
- package/dist/platform/sync-source.d.ts +196 -216
- package/dist/platform/transcript-cadence.d.ts +37 -41
- package/dist/platform/ui.d.ts +6 -6
- package/dist/text/endpoint.d.ts +11 -27
- package/package.json +3 -5
- package/dist/entities/note/types.d.ts +0 -14
- package/dist/entities/shopify/index.d.ts +0 -1
- package/dist/entities/shopify/types.d.ts +0 -79
- package/dist/platform/lifecycle.d.ts +0 -13
- package/dist/platform/reactive.d.ts +0 -13
- package/dist/platform/sdk.d.ts +0 -182
- package/dist/platform/service-registry.d.ts +0 -13
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
export type SessionState =
|
|
1
|
+
export type SessionState = "idle" | "ringing" | "connecting" | "connected" | "on_hold" | "ended" | "failed";
|
|
2
2
|
/**
|
|
3
3
|
* `"appName:ResourceName"` — how the platform addresses a federated resource.
|
|
4
|
-
* Not
|
|
5
|
-
* domain object rather than at a piece of UI.
|
|
4
|
+
* Not the read-state `ResourceRef`, which points at a domain object, not UI.
|
|
6
5
|
*/
|
|
7
6
|
export type FederatedResourceRef = `${string}:${string}`;
|
|
8
7
|
export interface Session {
|
|
9
8
|
id: string;
|
|
10
9
|
accountId: string;
|
|
11
10
|
providerId: string;
|
|
12
|
-
direction:
|
|
11
|
+
direction: "inbound" | "outbound";
|
|
13
12
|
remoteIdentity: string;
|
|
14
13
|
/**
|
|
15
|
-
* Number of remote participants, when the provider can report it.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* the label falls back to a generic one. Absent/1 = single remote party.
|
|
14
|
+
* Number of remote participants, when the provider can report it. With more
|
|
15
|
+
* than one remote party the audio is a single mixed stream, so transcript
|
|
16
|
+
* labeling falls back to a generic speaker label. Absent/1 = single remote party.
|
|
19
17
|
*/
|
|
20
18
|
remoteParticipantCount?: number;
|
|
21
19
|
state: SessionState;
|
|
@@ -25,9 +23,8 @@ export interface Session {
|
|
|
25
23
|
actions: SessionAction[];
|
|
26
24
|
/**
|
|
27
25
|
* Provider-supplied externalId the transcript persistence should bind to.
|
|
28
|
-
* Server resolves
|
|
29
|
-
*
|
|
30
|
-
* server needing to know their id shape.
|
|
26
|
+
* Server resolves it against `interaction.externalIds` (activity fallback),
|
|
27
|
+
* so providers need not know the server's id shape.
|
|
31
28
|
*/
|
|
32
29
|
externalId?: string;
|
|
33
30
|
ui: {
|
|
@@ -43,28 +40,23 @@ export interface CommsAccount<T = any> {
|
|
|
43
40
|
organizationId: string;
|
|
44
41
|
userId: string;
|
|
45
42
|
config: T;
|
|
46
|
-
status:
|
|
43
|
+
status: "registered" | "unregistered" | "error";
|
|
47
44
|
/**
|
|
48
|
-
* The channel this registration serves
|
|
49
|
-
* its registration config
|
|
50
|
-
*
|
|
45
|
+
* The channel this registration serves; set by the transport provider from
|
|
46
|
+
* its registration config. Binds an outgoing intent on a channel to the
|
|
47
|
+
* right account when several are registered at once.
|
|
51
48
|
*/
|
|
52
49
|
channelId?: string;
|
|
53
50
|
}
|
|
54
51
|
export interface ITransportProvider {
|
|
55
52
|
readonly id: string;
|
|
56
53
|
/**
|
|
57
|
-
* The ops this provider actually carries out
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* without hold would park a call that stays live.
|
|
64
|
-
*
|
|
65
|
-
* Undeclared means unknown, and unknown is tried anyway — that is the
|
|
66
|
-
* behaviour every provider had before this field existed. Declare it to be
|
|
67
|
-
* skipped rather than silently no-op'd.
|
|
54
|
+
* The ops this provider actually carries out. `dispatch` is a switch, so an
|
|
55
|
+
* op without a case returns quietly — the caller cannot tell "done" from
|
|
56
|
+
* "ignored". Harmless for a button the provider's tray never draws, but not
|
|
57
|
+
* for platform-initiated ops: auto-holding at a provider without hold would
|
|
58
|
+
* park a call that stays live. Undeclared means unknown, and unknown is
|
|
59
|
+
* tried anyway (pre-existing behaviour); declare to be skipped, not no-op'd.
|
|
68
60
|
*/
|
|
69
61
|
readonly supportedOps?: readonly TransportOpKind[];
|
|
70
62
|
subscribeSessions(callback: (sessions: Session[]) => void): () => void;
|
|
@@ -73,8 +65,8 @@ export interface ITransportProvider {
|
|
|
73
65
|
registerAccount(orgId: string, userId: string, config: any): Promise<CommsAccount>;
|
|
74
66
|
unregisterAccount(accountId: string): Promise<void>;
|
|
75
67
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
68
|
+
* Uniform entry for all session ops (invite/answer/hangup/hold/transfer/
|
|
69
|
+
* dtmf/set-stream).
|
|
78
70
|
*/
|
|
79
71
|
dispatch(op: TransportOp): Promise<void>;
|
|
80
72
|
}
|
|
@@ -99,29 +91,25 @@ export declare enum CommunicationScheme {
|
|
|
99
91
|
CALENDAR = "calendar"
|
|
100
92
|
}
|
|
101
93
|
/**
|
|
102
|
-
* The colour-coded channel kinds the design system defines tokens for.
|
|
103
|
-
*
|
|
104
|
-
*
|
|
94
|
+
* The colour-coded channel kinds the design system defines tokens for. About
|
|
95
|
+
* *how you reach someone*, not which product delivers it: Teams and Telegram
|
|
96
|
+
* are both `chat`, SIP and a phone number are both `tel`.
|
|
105
97
|
*/
|
|
106
98
|
export type ChannelKind = "mail" | "wa" | "chat" | "tel" | "note";
|
|
107
99
|
/** Channel kind for a scheme; anything unrecognised is neutral. */
|
|
108
100
|
export declare function channelKindForScheme(scheme?: string | null): ChannelKind;
|
|
109
101
|
/**
|
|
110
|
-
* How a provider wants its channel drawn.
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* with no frontend at all and on any surface where no bundle is loaded yet.
|
|
115
|
-
* `resource` is the escape hatch: a federated component (`"app:Component"`)
|
|
116
|
-
* that renders the provider's own mark and wins once it loads.
|
|
102
|
+
* How a provider wants its channel drawn. Two routes: `icon`/`tone`/`label`
|
|
103
|
+
* are declarative and travel in `/provider/describe`, so they work without a
|
|
104
|
+
* frontend or loaded bundle. `resource` is the escape hatch — a federated
|
|
105
|
+
* component (`"app:Component"`) that renders the provider's own mark and wins once loaded.
|
|
117
106
|
*/
|
|
118
107
|
export interface ChannelPresentation {
|
|
119
108
|
/** Lucide icon name, resolved by the host's icon renderer. */
|
|
120
109
|
icon?: string;
|
|
121
110
|
/**
|
|
122
|
-
* A {@link ChannelKind} to borrow that channel's colour, or any other
|
|
123
|
-
*
|
|
124
|
-
* from it rather than collapsing onto the neutral tone.
|
|
111
|
+
* A {@link ChannelKind} to borrow that channel's colour, or any other stable
|
|
112
|
+
* string — a provider-owned channel gets a derived colour instead of the neutral tone.
|
|
125
113
|
*/
|
|
126
114
|
tone?: ChannelKind | string;
|
|
127
115
|
/** What to call this channel in the UI, e.g. "WhatsApp". */
|
|
@@ -130,38 +118,33 @@ export interface ChannelPresentation {
|
|
|
130
118
|
resource?: string;
|
|
131
119
|
}
|
|
132
120
|
/**
|
|
133
|
-
* Account selector for `transport: session` intents
|
|
134
|
-
* `CommsAccount`s
|
|
135
|
-
*
|
|
136
|
-
* `
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
* binding on the account itself (`CommsAccount.channelId`) — `accountId` is
|
|
141
|
-
* only a static pin for providers that have no per-channel binding.
|
|
121
|
+
* Account selector for `transport: session` intents — narrows registered
|
|
122
|
+
* `CommsAccount`s to the one servicing this intent. `protocol` is the filter
|
|
123
|
+
* axis rather than a provider id because the id spaces differ:
|
|
124
|
+
* `channel.providerId` is the *server* provider (e.g. eylo-voip),
|
|
125
|
+
* `account.providerId` the *transport* provider (e.g. sip-provider). The final
|
|
126
|
+
* pick comes from `CommsAccount.channelId`; `accountId` is only a static pin
|
|
127
|
+
* for providers without per-channel binding.
|
|
142
128
|
*/
|
|
143
129
|
export interface AccountSelector {
|
|
144
130
|
protocol: string;
|
|
145
131
|
accountId?: string;
|
|
146
132
|
}
|
|
147
133
|
/**
|
|
148
|
-
* Routing
|
|
149
|
-
* uitgevoerd?
|
|
150
|
-
*
|
|
134
|
+
* Routing hint for frontend and comm-server: how an intent executes.
|
|
151
135
|
* - `dispatch` — server-side via comm-server `provider/dispatch/` →
|
|
152
|
-
* `IProvider.dispatch(op)`
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* de browser-UA (SIP/WebRTC). Geen server-roundtrip.
|
|
136
|
+
* `IProvider.dispatch(op)` (message.*, attachment.*, calendar.*, contact.* ServerOps).
|
|
137
|
+
* - `session` — client-side via `ITransportProvider.dispatch(op)` in the
|
|
138
|
+
* browser UA (SIP/WebRTC); no server round-trip.
|
|
156
139
|
*/
|
|
157
140
|
export type TransportConfig = {
|
|
158
141
|
kind: "dispatch";
|
|
159
142
|
/** Optional federated composer resource as "<app>:<resource>". */
|
|
160
143
|
composer?: string;
|
|
161
144
|
/**
|
|
162
|
-
* When true, comms-app `interaction/compose` skips its auto-create
|
|
163
|
-
*
|
|
164
|
-
*
|
|
145
|
+
* When true, comms-app `interaction/compose` skips its auto-create and
|
|
146
|
+
* the provider owns interaction lifecycle (e.g. Teams chat upserts on a
|
|
147
|
+
* chatId externalId).
|
|
165
148
|
*/
|
|
166
149
|
ownsInteraction?: boolean;
|
|
167
150
|
} | {
|
|
@@ -175,24 +158,23 @@ export type TransportConfig = {
|
|
|
175
158
|
/**
|
|
176
159
|
* One user-facing intent a provider/channel can perform on a target.
|
|
177
160
|
* `intent` is an open string — known values (call/mail/message/video) get
|
|
178
|
-
* default UI/labels; new ones
|
|
179
|
-
*
|
|
161
|
+
* default UI/labels; new ones render as generic actions until a provider
|
|
162
|
+
* declares specialised UI.
|
|
180
163
|
*/
|
|
181
164
|
export interface IntentCapability {
|
|
182
165
|
intent: string;
|
|
183
166
|
targetSchemes: CommunicationScheme[];
|
|
184
167
|
transport: TransportConfig;
|
|
185
|
-
/** User
|
|
168
|
+
/** User may toggle this intent per account. Default false (provider-locked). */
|
|
186
169
|
togglable?: boolean;
|
|
187
|
-
/** Default
|
|
170
|
+
/** Default state when togglable=true and the user has not chosen. Default true. */
|
|
188
171
|
defaultEnabled?: boolean;
|
|
189
|
-
/**
|
|
172
|
+
/** Optional i18n key for the toggle label; UI falls back to `cap_${intent}`. */
|
|
190
173
|
labelKey?: string;
|
|
191
174
|
}
|
|
192
175
|
/**
|
|
193
|
-
* Provider-level feature flag (no routing relevance)
|
|
194
|
-
*
|
|
195
|
-
* advertise to feature-detect, but which are not user-pickable intents.
|
|
176
|
+
* Provider-level feature flag (no routing relevance) — e.g. `call_hold`,
|
|
177
|
+
* `message_reactions` — advertised for feature detection, not user-pickable intents.
|
|
196
178
|
*/
|
|
197
179
|
export interface ProviderFeature {
|
|
198
180
|
name: string;
|
|
@@ -208,46 +190,42 @@ export interface ProviderDescription {
|
|
|
208
190
|
features: ProviderFeature[];
|
|
209
191
|
/**
|
|
210
192
|
* How this provider's channel is drawn. Optional: without it the UI falls
|
|
211
|
-
* back to the scheme's channel kind
|
|
212
|
-
* providers could say anything about themselves.
|
|
193
|
+
* back to the scheme's channel kind.
|
|
213
194
|
*/
|
|
214
195
|
presentation?: ChannelPresentation;
|
|
215
196
|
}
|
|
216
197
|
/**
|
|
217
|
-
* Provider-feature names
|
|
218
|
-
* hardcoding
|
|
219
|
-
*
|
|
220
|
-
* er pre-approved templates beschikbaar zijn buiten dat venster.
|
|
198
|
+
* Provider-feature names the composer interprets generically (no per-provider
|
|
199
|
+
* hardcoding). `message_window` = time-bound messaging window;
|
|
200
|
+
* `message_templates` = pre-approved templates available outside that window.
|
|
221
201
|
*/
|
|
222
202
|
export declare const PROVIDER_FEATURE_MESSAGE_WINDOW = "message_window";
|
|
223
203
|
export declare const PROVIDER_FEATURE_MESSAGE_TEMPLATES = "message_templates";
|
|
224
|
-
/**
|
|
225
|
-
* Eén variabele in een provider-template (bv. WhatsApp HSM body-param `{{1}}`).
|
|
226
|
-
*/
|
|
204
|
+
/** One variable in a provider template (e.g. WhatsApp HSM body param `{{1}}`). */
|
|
227
205
|
export interface ProviderMessageTemplateVariable {
|
|
228
|
-
/**
|
|
206
|
+
/** Stable key — for WhatsApp the 1-based index as string ("1", "2", …). */
|
|
229
207
|
key: string;
|
|
230
|
-
/**
|
|
208
|
+
/** Optional example/placeholder from the provider. */
|
|
231
209
|
example?: string;
|
|
232
210
|
label?: string;
|
|
233
211
|
}
|
|
234
212
|
/**
|
|
235
|
-
* Pre-approved provider
|
|
236
|
-
*
|
|
237
|
-
*
|
|
213
|
+
* Pre-approved provider template (WhatsApp HSM). The composer renders an input
|
|
214
|
+
* per variable; submit sends `templateId` + filled values. Distinct from the
|
|
215
|
+
* user-made canned-reply {@link MessageTemplate}.
|
|
238
216
|
*/
|
|
239
217
|
export interface ProviderMessageTemplate {
|
|
240
218
|
id: string;
|
|
241
219
|
name: string;
|
|
242
220
|
language?: string;
|
|
243
|
-
/**
|
|
221
|
+
/** Preview of the composed body (variables as placeholders). */
|
|
244
222
|
bodyPreview?: string;
|
|
245
223
|
category?: string;
|
|
246
224
|
variables: ProviderMessageTemplateVariable[];
|
|
247
225
|
}
|
|
248
226
|
/**
|
|
249
|
-
*
|
|
250
|
-
*
|
|
227
|
+
* Tag that permits a free-text message outside the standard window
|
|
228
|
+
* (Messenger/Instagram message tags, human-agent tag).
|
|
251
229
|
*/
|
|
252
230
|
export interface MessageTag {
|
|
253
231
|
id: string;
|
|
@@ -255,18 +233,18 @@ export interface MessageTag {
|
|
|
255
233
|
description?: string;
|
|
256
234
|
}
|
|
257
235
|
/**
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
236
|
+
* Response of `provider/message-context` (read route on a dispatch provider
|
|
237
|
+
* with `message_window`/`message_templates`). Tells the composer, per
|
|
238
|
+
* interaction, whether free text is allowed and otherwise which templates/tags exist.
|
|
261
239
|
*/
|
|
262
240
|
export interface MessageContext {
|
|
263
|
-
/**
|
|
241
|
+
/** Free text allowed? false ⇒ composer forces a template or tag. */
|
|
264
242
|
windowOpen: boolean;
|
|
265
|
-
/** Epoch
|
|
243
|
+
/** Epoch ms when the window closes (if open and known). */
|
|
266
244
|
windowExpiresAt?: number;
|
|
267
|
-
/**
|
|
245
|
+
/** Available pre-approved templates (WhatsApp). */
|
|
268
246
|
templates?: ProviderMessageTemplate[];
|
|
269
|
-
/**
|
|
247
|
+
/** Valid message tags (Messenger/Instagram). */
|
|
270
248
|
tags?: MessageTag[];
|
|
271
249
|
}
|
|
272
250
|
export interface PersonalAuthOption {
|
|
@@ -282,10 +260,10 @@ export interface PersonalAuthField {
|
|
|
282
260
|
placeholder?: string;
|
|
283
261
|
}
|
|
284
262
|
/**
|
|
285
|
-
*
|
|
286
|
-
* -
|
|
287
|
-
* -
|
|
288
|
-
* -
|
|
263
|
+
* How to connect a personal account for a provider.
|
|
264
|
+
* - "redirect": user picks an option → OAuth redirect flow
|
|
265
|
+
* - "form": user fills in fields → credentials submitted server-side
|
|
266
|
+
* - "unavailable": no personal connections (or no options configured)
|
|
289
267
|
*/
|
|
290
268
|
export interface PersonalAuthDescription {
|
|
291
269
|
mode: "redirect" | "form" | "unavailable";
|
|
@@ -304,27 +282,22 @@ export interface Uri {
|
|
|
304
282
|
displayName?: string;
|
|
305
283
|
}
|
|
306
284
|
/**
|
|
307
|
-
*
|
|
308
|
-
* (
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
* - `role`: rol van deze deelnemer in deze interactie. Open string; zie
|
|
315
|
-
* `InteractionParticipantRole` voor well-known waardes per kanaal.
|
|
316
|
-
*
|
|
317
|
-
* Niet te verwarren met `Participant` uit `entities/communication` — dat is
|
|
318
|
-
* een live call-session-participant (muted/speaking/etc.).
|
|
285
|
+
* A Uri extended with an identity cache, used for remote counterparties
|
|
286
|
+
* (sender, recipients, meeting attendees); channels (own addresses) stay plain `Uri`.
|
|
287
|
+
* `contactId` is a resolved hint set by the server during ingest — UI may
|
|
288
|
+
* navigate without a lookup, but the Contact entity stays the authority for
|
|
289
|
+
* live displayName/avatar. `role` is an open string; see
|
|
290
|
+
* `InteractionParticipantRole` for well-known values. Not the live
|
|
291
|
+
* call-session `Participant` from `entities/communication`.
|
|
319
292
|
*/
|
|
320
293
|
export interface InteractionParticipant extends Uri {
|
|
321
294
|
contactId?: string;
|
|
322
295
|
role?: string;
|
|
323
296
|
}
|
|
324
297
|
/**
|
|
325
|
-
* Well-known
|
|
326
|
-
*
|
|
327
|
-
*
|
|
298
|
+
* Well-known roles for `InteractionParticipant.role`. The type stays an open
|
|
299
|
+
* string so provider-specific roles need no domain PR; use these constants
|
|
300
|
+
* when the channel has a standard role.
|
|
328
301
|
*/
|
|
329
302
|
export declare const InteractionParticipantRole: {
|
|
330
303
|
readonly FROM: "from";
|
|
@@ -340,27 +313,20 @@ export declare const InteractionParticipantRole: {
|
|
|
340
313
|
readonly HOST: "host";
|
|
341
314
|
readonly PARTICIPANT: "participant";
|
|
342
315
|
};
|
|
343
|
-
export type InteractionParticipantRoleValue = typeof InteractionParticipantRole[keyof typeof InteractionParticipantRole];
|
|
316
|
+
export type InteractionParticipantRoleValue = (typeof InteractionParticipantRole)[keyof typeof InteractionParticipantRole];
|
|
344
317
|
/** Props the host passes to a provider's `ui.actionTray` resource. */
|
|
345
318
|
export interface CallActionTrayProps {
|
|
346
319
|
session: Session;
|
|
347
320
|
account?: CommsAccount;
|
|
348
321
|
/**
|
|
349
322
|
* Resource currently shown in place of `ui.canvas`, or null for the canvas
|
|
350
|
-
* itself.
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
* directory rather than to a dialled number points this at its own
|
|
358
|
-
* resource, and a provider that can do neither leaves the affordance out.
|
|
359
|
-
* `communication:CallKeypad` and `communication:CallTransfer` are there to
|
|
360
|
-
* be reused by any provider that wants the plain ones.
|
|
361
|
-
*
|
|
362
|
-
* Both are absent when the host does not support overriding the canvas; a
|
|
363
|
-
* tray must then not offer the affordance.
|
|
323
|
+
* itself. Canvas and tray are separate federated resources with no shared
|
|
324
|
+
* state, so the host holds this one value as a resource reference.
|
|
325
|
+
* Deliberately a reference, not an enum of known panels: a keypad or
|
|
326
|
+
* transfer form differs per provider — one may transfer via a directory and
|
|
327
|
+
* point at its own resource; one that can't leaves the affordance out.
|
|
328
|
+
* `communication:CallKeypad`/`communication:CallTransfer` are reusable plain ones.
|
|
329
|
+
* Both props absent = host does not support overriding; tray must not offer it.
|
|
364
330
|
*/
|
|
365
331
|
canvasOverride?: FederatedResourceRef | null;
|
|
366
332
|
onCanvasOverride?: (resource: FederatedResourceRef | null) => void;
|
|
@@ -385,18 +351,16 @@ export interface RemoteStreamEvent {
|
|
|
385
351
|
sessionId: string;
|
|
386
352
|
streamId: string;
|
|
387
353
|
stream: MediaStream | null;
|
|
388
|
-
speaker?:
|
|
354
|
+
speaker?: "local" | "remote";
|
|
389
355
|
label?: string;
|
|
390
356
|
}
|
|
391
357
|
/**
|
|
392
|
-
* Peer-to-peer WebRTC signaling envelope
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
* `Bridge.sse.push`). Transient: never persisted.
|
|
396
|
-
*
|
|
358
|
+
* Peer-to-peer WebRTC signaling envelope between two users in the same tenant.
|
|
359
|
+
* Media flows P2P; only these small SDP/ICE messages transit the server
|
|
360
|
+
* (relayed 1:1 via `Bridge.sse.push`). Transient: never persisted.
|
|
397
361
|
* - `offer`/`answer` → `data` is an `RTCSessionDescriptionInit`.
|
|
398
|
-
* - `ice`
|
|
399
|
-
* - `bye`
|
|
362
|
+
* - `ice` → `data` is an `RTCIceCandidateInit` (or `null` = end-of-candidates).
|
|
363
|
+
* - `bye` → `data` omitted; the sender tore the call down.
|
|
400
364
|
*/
|
|
401
365
|
export type WebRtcSignalKind = "offer" | "answer" | "ice" | "bye" | "request";
|
|
402
366
|
/** Request body the initiator/answerer POSTs to the signaling relay. */
|
|
@@ -410,17 +374,16 @@ export interface WebRtcSignalRequest {
|
|
|
410
374
|
/** Sender display name, so the peer can label the call UI without a lookup. */
|
|
411
375
|
fromName?: string;
|
|
412
376
|
/**
|
|
413
|
-
* Which peer connection this signal belongs to
|
|
414
|
-
* session
|
|
415
|
-
*
|
|
416
|
-
*
|
|
417
|
-
* one relay serve all three without the connection types colliding.
|
|
377
|
+
* Which peer connection this signal belongs to: `call` (default) = audio
|
|
378
|
+
* session via the transport provider; `file` = RTCDataChannel transfer via
|
|
379
|
+
* the file-beam service; `monitor` = one-way "listen along" via the
|
|
380
|
+
* call-monitor service. One relay serves all three without collisions.
|
|
418
381
|
*/
|
|
419
382
|
channel?: "call" | "file" | "monitor";
|
|
420
383
|
}
|
|
421
384
|
/**
|
|
422
|
-
* Broadcast (event `webrtc:callstate`) telling the tenant whether a user is
|
|
423
|
-
*
|
|
385
|
+
* Broadcast (event `webrtc:callstate`) telling the tenant whether a user is on
|
|
386
|
+
* a call, so a supervisor can see who is available to listen in.
|
|
424
387
|
*/
|
|
425
388
|
export interface CallStateChange {
|
|
426
389
|
userId: string;
|
|
@@ -428,8 +391,8 @@ export interface CallStateChange {
|
|
|
428
391
|
}
|
|
429
392
|
/**
|
|
430
393
|
* One ICE server entry. Structurally a subset of the browser's `RTCIceServer`,
|
|
431
|
-
* but kept DOM-free so the comm server can build it too
|
|
432
|
-
*
|
|
394
|
+
* but kept DOM-free so the comm server (no DOM lib) can build it too. The
|
|
395
|
+
* client passes these straight to `new RTCPeerConnection`.
|
|
433
396
|
*/
|
|
434
397
|
export interface IceServerConfig {
|
|
435
398
|
urls: string | string[];
|
|
@@ -437,8 +400,8 @@ export interface IceServerConfig {
|
|
|
437
400
|
credential?: string;
|
|
438
401
|
}
|
|
439
402
|
/**
|
|
440
|
-
* Response of `GET /webrtc/ice`:
|
|
441
|
-
*
|
|
403
|
+
* Response of `GET /webrtc/ice`: STUN list plus TURN servers with short-lived
|
|
404
|
+
* per-user credentials.
|
|
442
405
|
*/
|
|
443
406
|
export interface IceConfigResponse {
|
|
444
407
|
iceServers: IceServerConfig[];
|
|
@@ -451,8 +414,8 @@ export interface WebRtcSignalEvent extends WebRtcSignalRequest {
|
|
|
451
414
|
from: string;
|
|
452
415
|
}
|
|
453
416
|
/**
|
|
454
|
-
* Helper
|
|
455
|
-
*
|
|
417
|
+
* Helper for compact intent declarations in `/provider/describe`:
|
|
418
|
+
* `defineIntent("mail", { targetSchemes: [MAILTO], transport: { kind: "dispatch" } })`
|
|
456
419
|
*/
|
|
457
420
|
export declare const defineIntent: (intent: string, opts: Omit<IntentCapability, "intent">) => IntentCapability;
|
|
458
421
|
export interface ExternalId {
|
|
@@ -476,27 +439,26 @@ export interface MessageBody {
|
|
|
476
439
|
}>;
|
|
477
440
|
}
|
|
478
441
|
/**
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
* niet ondersteunen.
|
|
442
|
+
* Addressing envelope for message ops. Mail honours cc/bcc; chat/SMS uses only
|
|
443
|
+
* `to[0]`. Providers drop fields they don't support.
|
|
482
444
|
*/
|
|
483
445
|
export interface RecipientList {
|
|
484
|
-
/** 1+ primary recipients (
|
|
446
|
+
/** 1+ primary recipients (required). */
|
|
485
447
|
to: Uri[];
|
|
486
|
-
/** Carbon
|
|
448
|
+
/** Carbon copy. Mail flow only. */
|
|
487
449
|
cc?: Uri[];
|
|
488
|
-
/** Blind carbon
|
|
450
|
+
/** Blind carbon copy. Mail flow only. */
|
|
489
451
|
bcc?: Uri[];
|
|
490
452
|
}
|
|
491
453
|
/**
|
|
492
|
-
*
|
|
493
|
-
*
|
|
494
|
-
*
|
|
454
|
+
* Outgoing attachment as the client supplies it. `content` is bare base64 (no
|
|
455
|
+
* `data:` prefix); providers embed the string directly (Graph `contentBytes`,
|
|
456
|
+
* Gmail MIME part) without re-encoding.
|
|
495
457
|
*/
|
|
496
458
|
export interface OutgoingAttachment {
|
|
497
459
|
filename: string;
|
|
498
460
|
mimeType: string;
|
|
499
|
-
/**
|
|
461
|
+
/** Bare base64, without `data:<mime>;base64,` prefix. */
|
|
500
462
|
content: string;
|
|
501
463
|
}
|
|
502
464
|
export interface NoteBody {
|
|
@@ -525,9 +487,9 @@ export interface CalendarEventInput {
|
|
|
525
487
|
};
|
|
526
488
|
}
|
|
527
489
|
/**
|
|
528
|
-
* Server-side ops
|
|
529
|
-
*
|
|
530
|
-
*
|
|
490
|
+
* Server-side ops executed by the provider app's server, triggered by
|
|
491
|
+
* comm-server `provider/dispatch/`. Payloads carry IDs, not full entities —
|
|
492
|
+
* the provider resolves them itself via platform-api.
|
|
531
493
|
*/
|
|
532
494
|
export type ServerOp = {
|
|
533
495
|
kind: "message.new";
|
|
@@ -541,7 +503,7 @@ export type ServerOp = {
|
|
|
541
503
|
interactionId: string;
|
|
542
504
|
activityId?: string;
|
|
543
505
|
body: MessageBody;
|
|
544
|
-
/**
|
|
506
|
+
/** Overrides the default reply targets (e.g. reply-all). */
|
|
545
507
|
recipients?: RecipientList;
|
|
546
508
|
} | {
|
|
547
509
|
kind: "message.comment";
|
|
@@ -624,11 +586,11 @@ export type ServerOp = {
|
|
|
624
586
|
folderName?: string;
|
|
625
587
|
};
|
|
626
588
|
/**
|
|
627
|
-
* Folder
|
|
628
|
-
*
|
|
629
|
-
*
|
|
630
|
-
* Providers
|
|
631
|
-
*
|
|
589
|
+
* Folder DTOs — transport shapes for the generic folder capability.
|
|
590
|
+
* Deliberately NOT persisted entities: the folder tree and previews are
|
|
591
|
+
* fetched live from the provider (TTL-cached client-side), never bulk-stored.
|
|
592
|
+
* Providers map their own model onto this (Outlook `mailFolders`, Gmail
|
|
593
|
+
* `labels`, IMAP `folders`).
|
|
632
594
|
*/
|
|
633
595
|
export interface FolderNode {
|
|
634
596
|
id: string;
|
|
@@ -652,14 +614,14 @@ export interface FolderMessagePreview {
|
|
|
652
614
|
}
|
|
653
615
|
export interface FolderMessagePage {
|
|
654
616
|
items: FolderMessagePreview[];
|
|
655
|
-
/** Opaque provider
|
|
617
|
+
/** Opaque provider cursor (e.g. Graph `@odata.nextLink`). Absent = last page. */
|
|
656
618
|
nextCursor?: string;
|
|
657
619
|
}
|
|
658
620
|
/**
|
|
659
|
-
*
|
|
660
|
-
* `GET /search/sources`:
|
|
661
|
-
*
|
|
662
|
-
*
|
|
621
|
+
* A searchable external source (channel) for the client fan-out. Returned by
|
|
622
|
+
* `GET /search/sources`: every user-accessible enabled channel whose provider
|
|
623
|
+
* declares `FEATURE_REMOTE_SEARCH`. The client fires a parallel
|
|
624
|
+
* `POST /search/mailbox` per source (non-blocking).
|
|
663
625
|
*/
|
|
664
626
|
export interface MailboxSearchSource {
|
|
665
627
|
channelId: string;
|
|
@@ -667,23 +629,22 @@ export interface MailboxSearchSource {
|
|
|
667
629
|
displayName: string;
|
|
668
630
|
}
|
|
669
631
|
/**
|
|
670
|
-
* Well-known `ProviderFeature.name`
|
|
671
|
-
* folder.list/messages/import/move
|
|
672
|
-
*
|
|
632
|
+
* Well-known `ProviderFeature.name` for the folder capability. A provider
|
|
633
|
+
* supporting folder.list/messages/import/move sets it true in
|
|
634
|
+
* `describe().features`; the client then shows the Folders nav for that channel.
|
|
673
635
|
*/
|
|
674
636
|
export declare const FEATURE_FOLDER_MANAGEMENT = "folder_management";
|
|
675
637
|
/**
|
|
676
|
-
* Well-known `ProviderFeature.name`
|
|
677
|
-
*
|
|
678
|
-
*
|
|
679
|
-
* in `describe().features`. De comm-server neemt de channels van zo'n provider mee
|
|
680
|
-
* in `GET /search/sources`; de client fan-out er parallel op via `POST /search/mailbox`.
|
|
638
|
+
* Well-known `ProviderFeature.name` for remote search (`mailbox.search`, e.g.
|
|
639
|
+
* Outlook Graph `$search` or IMAP SEARCH). The comm-server includes such
|
|
640
|
+
* channels in `GET /search/sources`; the client fans out via `POST /search/mailbox`.
|
|
681
641
|
*/
|
|
682
642
|
export declare const FEATURE_REMOTE_SEARCH = "remote_search";
|
|
683
643
|
/**
|
|
684
|
-
* Result
|
|
685
|
-
* helper
|
|
686
|
-
* narrowing
|
|
644
|
+
* Result shape for `IProvider.dispatch` and the comm-server
|
|
645
|
+
* `dispatchToProvider` helper, discriminated on `ok`. Deliberately not
|
|
646
|
+
* strict-null-discriminated so narrowing also works without strictNullChecks
|
|
647
|
+
* (root tsconfig is non-strict).
|
|
687
648
|
*/
|
|
688
649
|
export interface ServerResult<T = unknown> {
|
|
689
650
|
ok: boolean;
|
|
@@ -694,13 +655,13 @@ export interface ServerResult<T = unknown> {
|
|
|
694
655
|
message?: string;
|
|
695
656
|
}
|
|
696
657
|
export declare const UNSUPPORTED: ServerResult;
|
|
697
|
-
/**
|
|
698
|
-
* Transport-ops uitgevoerd in de browser-UA (SIP/WebRTC), getriggerd
|
|
699
|
-
* door de frontend via `ITransportProvider.dispatch`. Geen server-
|
|
700
|
-
* roundtrip — directe controle over de lokale stack.
|
|
701
|
-
*/
|
|
702
658
|
/** The `kind` of a {@link TransportOp} — what a provider declares support for. */
|
|
703
659
|
export type TransportOpKind = TransportOp["kind"];
|
|
660
|
+
/**
|
|
661
|
+
* Transport ops executed in the browser UA (SIP/WebRTC), triggered by the
|
|
662
|
+
* frontend via `ITransportProvider.dispatch`. No server round-trip — direct
|
|
663
|
+
* control over the local stack.
|
|
664
|
+
*/
|
|
704
665
|
export type TransportOp = {
|
|
705
666
|
kind: "session.invite";
|
|
706
667
|
accountId: string;
|
|
@@ -757,10 +718,10 @@ export interface OAuthConfig {
|
|
|
757
718
|
authorizeEndpoint: string;
|
|
758
719
|
tokenEndpoint: string;
|
|
759
720
|
clientId: string;
|
|
760
|
-
/** Server-side only —
|
|
721
|
+
/** Server-side only — from the provider's secret store. May stay empty for PKCE. */
|
|
761
722
|
clientSecret?: string;
|
|
762
723
|
scopes: string[];
|
|
763
|
-
/** Extra params
|
|
724
|
+
/** Extra params for the authorize URL (prompt, access_type, etc.). */
|
|
764
725
|
authorizeParams?: Record<string, string>;
|
|
765
726
|
refresh?: {
|
|
766
727
|
bufferMs?: number;
|
|
@@ -791,35 +752,33 @@ export interface FormAuthCtx {
|
|
|
791
752
|
organizationId: string;
|
|
792
753
|
}
|
|
793
754
|
/**
|
|
794
|
-
* Server-side contract per communication
|
|
795
|
-
*
|
|
796
|
-
*
|
|
797
|
-
*
|
|
798
|
-
*
|
|
799
|
-
* Niet bedoeld voor frontend-consumptie — frontend praat alleen met
|
|
800
|
-
* comm-server's `provider/*` en `account/*` endpoints.
|
|
755
|
+
* Server-side contract per communication provider. Provider apps register via
|
|
756
|
+
* `Bridge.providers.role({ type: "provider", group: "communication" })` and
|
|
757
|
+
* expose routes matching these methods (comm-server calls them via Bridge.rpc).
|
|
758
|
+
* Not for frontend consumption — the frontend talks only to comm-server's
|
|
759
|
+
* `provider/*` and `account/*` endpoints.
|
|
801
760
|
*/
|
|
802
761
|
export interface IProvider {
|
|
803
762
|
readonly id: string;
|
|
804
763
|
describe(): Promise<ProviderDescription>;
|
|
805
764
|
listChannels(orgId: string, userId?: string): Promise<unknown[]>;
|
|
806
765
|
/**
|
|
807
|
-
* Comm-server
|
|
808
|
-
* IProvider
|
|
809
|
-
*
|
|
766
|
+
* Comm-server asks the provider for its current auth config. Kept on
|
|
767
|
+
* IProvider (rather than static registration) because clientId/secret/scopes
|
|
768
|
+
* often come from a secret store or tenant config, not code.
|
|
810
769
|
*/
|
|
811
770
|
personalAuth(ctx: PersonalAuthCtx): Promise<PersonalAuthConfig>;
|
|
812
771
|
/**
|
|
813
|
-
*
|
|
814
|
-
* Account
|
|
815
|
-
* exchange
|
|
772
|
+
* For `mode: "form"` — the provider validates credentials and builds the
|
|
773
|
+
* Account itself. OAuth mode doesn't need this; comm-server handles token
|
|
774
|
+
* exchange fully.
|
|
816
775
|
*/
|
|
817
776
|
completeFormAuth?(fields: Record<string, string>, ctx: FormAuthCtx): Promise<{
|
|
818
777
|
accountId: string;
|
|
819
778
|
}>;
|
|
820
779
|
/**
|
|
821
|
-
* Post-connect hook — provider
|
|
822
|
-
* user-connection channel
|
|
780
|
+
* Post-connect hook — provider may do follow-up work (e.g. MS
|
|
781
|
+
* user-connection channel binding) AFTER the Account is saved.
|
|
823
782
|
*/
|
|
824
783
|
onAccountConnected?(account: {
|
|
825
784
|
id: string;
|