@proteos/sdk 0.50.1 → 0.51.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.
@@ -4,10 +4,13 @@ import type {
4
4
  AgentListener,
5
5
  ApplySendingLimitPresetRequest,
6
6
  AttachContactAddressRequest,
7
+ AttachConversationBriefRequest,
7
8
  BlockContactRequest,
8
9
  CallTokenResponse,
9
10
  ChannelAction,
11
+ ChannelEvent,
10
12
  Connection,
13
+ ConnectorCatalogEntry,
11
14
  Contact,
12
15
  ContactAddress,
13
16
  ContactErasureRequest,
@@ -15,6 +18,7 @@ import type {
15
18
  ContactMergeProposal,
16
19
  ContactRecordLink,
17
20
  Conversation,
21
+ ConversationBrief,
18
22
  ConversationFilter,
19
23
  ConversationFilterEvent,
20
24
  ConversationType,
@@ -23,6 +27,7 @@ import type {
23
27
  CreateContactGroupRequest,
24
28
  CreateContactRecordLinkRequest,
25
29
  CreateContactRequest,
30
+ CreateConversationBriefRequest,
26
31
  CreateConversationFilterRequest,
27
32
  CreateConversationTypeRequest,
28
33
  CreateGlossaryTermRequest,
@@ -31,17 +36,25 @@ import type {
31
36
  CreateTranscriptionRequest,
32
37
  DeleteConnectionQuery,
33
38
  DispatchMeetingBotRequest,
39
+ EmailDomainStatus,
40
+ EmailHealth,
41
+ EmailSender,
42
+ EmailSuppression,
43
+ EmailSuppressionKind,
44
+ GetConnectionHealthQuery,
34
45
  GlossaryTerm,
35
46
  InstallConnectionRequest,
36
47
  InstallConnectionResponse,
37
48
  ListAgentListenersQuery,
38
49
  ListChannelActionsQuery,
50
+ ListChannelEventsQuery,
39
51
  ListConnectionsQuery,
40
52
  ListContactAddressesQuery,
41
53
  ListContactGroupsQuery,
42
54
  ListContactMergeProposalsQuery,
43
55
  ListContactRecordLinksQuery,
44
56
  ListContactsQuery,
57
+ ListConversationBriefsQuery,
45
58
  ListConversationFilterEventsQuery,
46
59
  ListConversationFiltersQuery,
47
60
  ListConversationsQuery,
@@ -74,6 +87,7 @@ import type {
74
87
  SendingLimitPreset,
75
88
  SendingRule,
76
89
  SendMessageRequest,
90
+ SetDefaultSenderRequest,
77
91
  SyncConnectionRequest,
78
92
  ToneProfile,
79
93
  ToneProfileSetup,
@@ -83,6 +97,7 @@ import type {
83
97
  UpdateConnectionRequest,
84
98
  UpdateContactGroupRequest,
85
99
  UpdateContactRequest,
100
+ UpdateConversationBriefRequest,
86
101
  UpdateConversationFilterRequest,
87
102
  UpdateConversationRequest,
88
103
  UpdateConversationTypeRequest,
@@ -122,6 +137,7 @@ export class ConversationClient {
122
137
  * message nor a reaction — LinkedIn invitations, profile visits, InMail.
123
138
  */
124
139
  readonly channelActions: ChannelActionService
140
+ readonly channelEvents: ChannelEventService
125
141
  /** Per-org glossary: custom vocabulary that boosts transcription accuracy. */
126
142
  readonly glossaryTerms: GlossaryTermService
127
143
  /** Conversation taxonomy: the types the pre-summary classifier assigns. */
@@ -138,6 +154,8 @@ export class ConversationClient {
138
154
  /** Realtime speech-to-text (dictation) — moved here from agent-service. */
139
155
  readonly voice: VoiceService
140
156
  readonly calls: CallService
157
+ /** Conversation briefs: guidance prepared ahead of a conversation (call, meeting) with a contact. */
158
+ readonly conversationBriefs: ConversationBriefService
141
159
 
142
160
  constructor(client: ProteosClient) {
143
161
  this.connections = new ConnectionServiceImpl(client)
@@ -148,6 +166,7 @@ export class ConversationClient {
148
166
  this.conversationFilters = new ConversationFilterServiceImpl(client)
149
167
  this.sendingRules = new SendingRuleServiceImpl(client)
150
168
  this.channelActions = new ChannelActionServiceImpl(client)
169
+ this.channelEvents = new ChannelEventServiceImpl(client)
151
170
  this.glossaryTerms = new GlossaryTermServiceImpl(client)
152
171
  this.conversationTypes = new ConversationTypeServiceImpl(client)
153
172
  this.contactGroups = new ContactGroupServiceImpl(client)
@@ -157,6 +176,7 @@ export class ConversationClient {
157
176
  this.meetings = new MeetingServiceImpl(client)
158
177
  this.voice = new VoiceServiceImpl(client)
159
178
  this.calls = new CallServiceImpl(client)
179
+ this.conversationBriefs = new ConversationBriefServiceImpl(client)
160
180
  }
161
181
  }
162
182
 
@@ -245,6 +265,33 @@ export interface ConnectionService {
245
265
  ): Promise<ListResponse<ContactAddress>>
246
266
  /** Search a connection's addressable VENUES (Slack channels) for the compose picker. */
247
267
  listRooms(connectionId: string, query?: ListRoomsQuery): Promise<ListResponse<Room>>
268
+ /**
269
+ * Deliverability of a sending-platform connection (SendGrid): rates from
270
+ * the channel_event ledger + the provider's snapshot (engagement quality,
271
+ * counters, suppression counts, domain/sender state, dedicated IPs).
272
+ * `email_provider_not_supported` on mailbox connectors.
273
+ */
274
+ getHealth(connectionId: string, query?: GetConnectionHealthQuery): Promise<EmailHealth>
275
+ /** Ask the provider to re-check the sending domain's DNS. */
276
+ validateDomain(connectionId: string): Promise<EmailDomainStatus>
277
+ /** Re-send the single-sender verification mail (no-op on an authenticated domain). */
278
+ resendSenderVerification(connectionId: string): Promise<void>
279
+ /** Read one provider suppression list live. */
280
+ listSuppressions(connectionId: string, kind: EmailSuppressionKind): Promise<EmailSuppression[]>
281
+ /** Take an address off one provider suppression list (a false positive). */
282
+ removeSuppression(connectionId: string, kind: EmailSuppressionKind, email: string): Promise<void>
283
+ /** Start / stop the provider's automated warmup on a dedicated IP. */
284
+ setIpWarmup(connectionId: string, ip: string, isEnabled: boolean): Promise<void>
285
+ /** The runtime connector catalog: what is wired in this environment + install modes. */
286
+ listConnectors(): Promise<ConnectorCatalogEntry[]>
287
+ /**
288
+ * The sender directory of a domain-authenticated email connection: every
289
+ * email contact address on its domain (colleagues + shared mailboxes), the
290
+ * default flagged. Empty on connections without a sender domain.
291
+ */
292
+ listSenders(connectionId: string): Promise<EmailSender[]>
293
+ /** Pin the connection's fallback sender; returns the refreshed directory. */
294
+ setDefaultSender(connectionId: string, request: SetDefaultSenderRequest): Promise<EmailSender[]>
248
295
  }
249
296
 
250
297
  class ConnectionServiceImpl implements ConnectionService {
@@ -315,13 +362,97 @@ class ConnectionServiceImpl implements ConnectionService {
315
362
  query,
316
363
  )
317
364
  }
365
+
366
+ getHealth(connectionId: string, query: GetConnectionHealthQuery = {}): Promise<EmailHealth> {
367
+ return this.client.requestWithQuery(
368
+ 'GET',
369
+ `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(connectionId)}/health`,
370
+ query,
371
+ )
372
+ }
373
+
374
+ validateDomain(connectionId: string): Promise<EmailDomainStatus> {
375
+ return this.client.request(
376
+ 'POST',
377
+ `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(connectionId)}/domain/validate`,
378
+ )
379
+ }
380
+
381
+ resendSenderVerification(connectionId: string): Promise<void> {
382
+ return this.client.request(
383
+ 'POST',
384
+ `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(connectionId)}/sender/verify`,
385
+ )
386
+ }
387
+
388
+ async listSuppressions(
389
+ connectionId: string,
390
+ kind: EmailSuppressionKind,
391
+ ): Promise<EmailSuppression[]> {
392
+ const response: { data: EmailSuppression[] } = await this.client.requestWithQuery(
393
+ 'GET',
394
+ `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(connectionId)}/suppressions`,
395
+ { kind },
396
+ )
397
+ return response.data
398
+ }
399
+
400
+ removeSuppression(
401
+ connectionId: string,
402
+ kind: EmailSuppressionKind,
403
+ email: string,
404
+ ): Promise<void> {
405
+ return this.client.request(
406
+ 'DELETE',
407
+ `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(connectionId)}/suppressions/${encodeURIComponent(kind)}/${encodeURIComponent(email)}`,
408
+ )
409
+ }
410
+
411
+ setIpWarmup(connectionId: string, ip: string, isEnabled: boolean): Promise<void> {
412
+ return this.client.request(
413
+ isEnabled ? 'POST' : 'DELETE',
414
+ `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(connectionId)}/ip-warmup/${encodeURIComponent(ip)}`,
415
+ )
416
+ }
417
+
418
+ async listConnectors(): Promise<ConnectorCatalogEntry[]> {
419
+ const response: { data: ConnectorCatalogEntry[] } = await this.client.request(
420
+ 'GET',
421
+ `${CONVERSATION_BASE_PATH}/connectors`,
422
+ )
423
+ return response.data
424
+ }
425
+
426
+ async listSenders(connectionId: string): Promise<EmailSender[]> {
427
+ const response: { data: EmailSender[] } = await this.client.request(
428
+ 'GET',
429
+ `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(connectionId)}/senders`,
430
+ )
431
+ return response.data
432
+ }
433
+
434
+ async setDefaultSender(
435
+ connectionId: string,
436
+ request: SetDefaultSenderRequest,
437
+ ): Promise<EmailSender[]> {
438
+ const response: { data: EmailSender[] } = await this.client.request(
439
+ 'PUT',
440
+ `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(connectionId)}/senders/default`,
441
+ request,
442
+ )
443
+ return response.data
444
+ }
318
445
  }
319
446
 
320
447
  /** The person-level identity layer: contacts, addresses, merges, permissions, erasure. */
321
448
  export interface ContactService {
322
449
  list(query?: ListContactsQuery): Promise<ListResponse<Contact>>
323
450
  get(id: string): Promise<Contact>
324
- /** Manually mint a contact (sync dedup — 409 contact_address_taken on any owned address). */
451
+ /**
452
+ * Manually mint a contact (sync dedup — 409 contact_address_taken on any
453
+ * owned address), or with `platform_user_id` ensure a colleague's bound
454
+ * contact and attach the addresses to it.
455
+ */
325
456
  create(request: CreateContactRequest): Promise<Contact>
326
457
  update(id: string, request: UpdateContactRequest): Promise<Contact>
327
458
  attachAddress(contactId: string, request: AttachContactAddressRequest): Promise<Contact>
@@ -1241,6 +1372,80 @@ export type {
1241
1372
  VoiceTranscriptionStream,
1242
1373
  } from './voice.js'
1243
1374
 
1375
+ /**
1376
+ * Conversation briefs — guidance prepared ahead of a conversation ("talk to
1377
+ * these people about this"; the conversation sibling of message drafts).
1378
+ * Binding is explicit: the softphone carries the brief id into the call, or
1379
+ * `attach` names the conversation. Any number of briefs may be open for the
1380
+ * same people. Edits/attach on a non-open brief fail 409
1381
+ * `conversation_brief_not_editable`; a conversation already carrying a brief
1382
+ * refuses another (409 `conversation_brief_already_attached`).
1383
+ */
1384
+ export interface ConversationBriefService {
1385
+ list(query?: ListConversationBriefsQuery): Promise<ListResponse<ConversationBrief>>
1386
+ get(id: string): Promise<ConversationBrief>
1387
+ create(request: CreateConversationBriefRequest): Promise<ConversationBrief>
1388
+ update(id: string, request: UpdateConversationBriefRequest): Promise<ConversationBrief>
1389
+ /** Decline an open brief (prepared → discarded, terminal). */
1390
+ discard(id: string): Promise<ConversationBrief>
1391
+ /** Bind an open brief to a conversation explicitly (prepared → used). */
1392
+ attach(id: string, request: AttachConversationBriefRequest): Promise<ConversationBrief>
1393
+ delete(id: string): Promise<void>
1394
+ }
1395
+
1396
+ class ConversationBriefServiceImpl implements ConversationBriefService {
1397
+ constructor(private readonly client: ProteosClient) {}
1398
+
1399
+ list(query: ListConversationBriefsQuery = {}): Promise<ListResponse<ConversationBrief>> {
1400
+ return this.client.requestWithQuery(
1401
+ 'GET',
1402
+ `${CONVERSATION_BASE_PATH}/conversation-briefs`,
1403
+ query,
1404
+ )
1405
+ }
1406
+
1407
+ get(id: string): Promise<ConversationBrief> {
1408
+ return this.client.request(
1409
+ 'GET',
1410
+ `${CONVERSATION_BASE_PATH}/conversation-briefs/${encodeURIComponent(id)}`,
1411
+ )
1412
+ }
1413
+
1414
+ create(request: CreateConversationBriefRequest): Promise<ConversationBrief> {
1415
+ return this.client.request('POST', `${CONVERSATION_BASE_PATH}/conversation-briefs`, request)
1416
+ }
1417
+
1418
+ update(id: string, request: UpdateConversationBriefRequest): Promise<ConversationBrief> {
1419
+ return this.client.request(
1420
+ 'PATCH',
1421
+ `${CONVERSATION_BASE_PATH}/conversation-briefs/${encodeURIComponent(id)}`,
1422
+ request,
1423
+ )
1424
+ }
1425
+
1426
+ discard(id: string): Promise<ConversationBrief> {
1427
+ return this.client.request(
1428
+ 'POST',
1429
+ `${CONVERSATION_BASE_PATH}/conversation-briefs/${encodeURIComponent(id)}/discard`,
1430
+ )
1431
+ }
1432
+
1433
+ attach(id: string, request: AttachConversationBriefRequest): Promise<ConversationBrief> {
1434
+ return this.client.request(
1435
+ 'POST',
1436
+ `${CONVERSATION_BASE_PATH}/conversation-briefs/${encodeURIComponent(id)}/attach`,
1437
+ request,
1438
+ )
1439
+ }
1440
+
1441
+ async delete(id: string): Promise<void> {
1442
+ await this.client.request(
1443
+ 'DELETE',
1444
+ `${CONVERSATION_BASE_PATH}/conversation-briefs/${encodeURIComponent(id)}`,
1445
+ )
1446
+ }
1447
+ }
1448
+
1244
1449
  /**
1245
1450
  * Sending rules — outbound send constraints (windows, connection limits,
1246
1451
  * frequency caps), the static limit-preset catalog and its apply expansion.
@@ -1367,3 +1572,37 @@ class ChannelActionServiceImpl implements ChannelActionService {
1367
1572
  )
1368
1573
  }
1369
1574
  }
1575
+
1576
+ /**
1577
+ * The channel_event ledger — provider-observed delivery / engagement events
1578
+ * about outbound messages (delivered, bounced, opened, clicked,
1579
+ * spam_reported, unsubscribed, …). Read-only: rows are appended by webhook
1580
+ * ingest. `listByMessage` is the per-message history, oldest first.
1581
+ */
1582
+ export interface ChannelEventService {
1583
+ list(query?: ListChannelEventsQuery): Promise<ListResponse<ChannelEvent>>
1584
+ get(id: string): Promise<ChannelEvent>
1585
+ listByMessage(messageId: string): Promise<ListResponse<ChannelEvent>>
1586
+ }
1587
+
1588
+ class ChannelEventServiceImpl implements ChannelEventService {
1589
+ constructor(private readonly client: ProteosClient) {}
1590
+
1591
+ list(query: ListChannelEventsQuery = {}): Promise<ListResponse<ChannelEvent>> {
1592
+ return this.client.requestWithQuery('GET', `${CONVERSATION_BASE_PATH}/channel-events`, query)
1593
+ }
1594
+
1595
+ get(id: string): Promise<ChannelEvent> {
1596
+ return this.client.request(
1597
+ 'GET',
1598
+ `${CONVERSATION_BASE_PATH}/channel-events/${encodeURIComponent(id)}`,
1599
+ )
1600
+ }
1601
+
1602
+ listByMessage(messageId: string): Promise<ListResponse<ChannelEvent>> {
1603
+ return this.client.request(
1604
+ 'GET',
1605
+ `${CONVERSATION_BASE_PATH}/messages/${encodeURIComponent(messageId)}/events`,
1606
+ )
1607
+ }
1608
+ }