@proteos/sdk 0.44.0 → 0.45.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proteos/sdk",
3
- "version": "0.44.0",
3
+ "version": "0.45.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "TypeScript SDK for the Proteos platform",
6
6
  "repository": {
@@ -66,8 +66,8 @@
66
66
  "tsup": "^8.3.0",
67
67
  "typescript": "^5.7.0",
68
68
  "vitest": "^3.0.0",
69
- "@proteos/tsconfig": "0.0.0",
70
- "@proteos/biome-config": "0.0.0"
69
+ "@proteos/biome-config": "0.0.0",
70
+ "@proteos/tsconfig": "0.0.0"
71
71
  },
72
72
  "scripts": {
73
73
  "build": "tsup",
@@ -17,6 +17,10 @@ import type {
17
17
  CreateAgentListenerRequest,
18
18
  CreateConnectionRequest,
19
19
  CreateContactGroupRequest,
20
+ CreateContactRequest,
21
+ ContactRecordLink,
22
+ CreateContactRecordLinkRequest,
23
+ ListContactRecordLinksQuery,
20
24
  CreateConversationFilterRequest,
21
25
  CreateConversationTypeRequest,
22
26
  CreateGlossaryTermRequest,
@@ -282,9 +286,17 @@ class ConnectionServiceImpl implements ConnectionService {
282
286
  export interface ContactService {
283
287
  list(query?: ListContactsQuery): Promise<ListResponse<Contact>>
284
288
  get(id: string): Promise<Contact>
289
+ /** Manually mint a contact (sync dedup — 409 contact_address_taken on any owned address). */
290
+ create(request: CreateContactRequest): Promise<Contact>
285
291
  update(id: string, request: UpdateContactRequest): Promise<Contact>
286
292
  attachAddress(contactId: string, request: AttachContactAddressRequest): Promise<Contact>
287
293
  detachAddress(contactId: string, addressId: string): Promise<Contact>
294
+ /** Link the contact to a business record (bare edge; 409 contact_record_link_exists on duplicates). */
295
+ linkRecord(request: CreateContactRecordLinkRequest): Promise<ContactRecordLink>
296
+ /** Page contact→record edges by contact_id, or by entity_slug + record_id. */
297
+ listRecordLinks(query?: ListContactRecordLinksQuery): Promise<ListResponse<ContactRecordLink>>
298
+ getRecordLink(linkId: string): Promise<ContactRecordLink>
299
+ unlinkRecord(linkId: string): Promise<void>
288
300
  /** Fold source_contact_id into contactId (contactId wins). */
289
301
  merge(contactId: string, request: MergeContactsRequest): Promise<Contact>
290
302
  recordPermissionEvent(contactId: string, request: RecordPermissionEventRequest): Promise<Contact>
@@ -313,6 +325,10 @@ class ContactServiceImpl implements ContactService {
313
325
  )
314
326
  }
315
327
 
328
+ create(request: CreateContactRequest): Promise<Contact> {
329
+ return this.client.request('POST', `${CONVERSATION_BASE_PATH}/contacts`, request)
330
+ }
331
+
316
332
  update(id: string, request: UpdateContactRequest): Promise<Contact> {
317
333
  return this.client.request(
318
334
  'PATCH',
@@ -336,6 +352,32 @@ class ContactServiceImpl implements ContactService {
336
352
  )
337
353
  }
338
354
 
355
+ linkRecord(request: CreateContactRecordLinkRequest): Promise<ContactRecordLink> {
356
+ return this.client.request('POST', `${CONVERSATION_BASE_PATH}/contact-record-links`, request)
357
+ }
358
+
359
+ listRecordLinks(query: ListContactRecordLinksQuery = {}): Promise<ListResponse<ContactRecordLink>> {
360
+ return this.client.requestWithQuery(
361
+ 'GET',
362
+ `${CONVERSATION_BASE_PATH}/contact-record-links`,
363
+ query,
364
+ )
365
+ }
366
+
367
+ getRecordLink(linkId: string): Promise<ContactRecordLink> {
368
+ return this.client.request(
369
+ 'GET',
370
+ `${CONVERSATION_BASE_PATH}/contact-record-links/${encodeURIComponent(linkId)}`,
371
+ )
372
+ }
373
+
374
+ unlinkRecord(linkId: string): Promise<void> {
375
+ return this.client.request(
376
+ 'DELETE',
377
+ `${CONVERSATION_BASE_PATH}/contact-record-links/${encodeURIComponent(linkId)}`,
378
+ )
379
+ }
380
+
339
381
  merge(contactId: string, request: MergeContactsRequest): Promise<Contact> {
340
382
  return this.client.request(
341
383
  'POST',
@@ -1252,6 +1252,16 @@ export interface UpdateContactRequest {
1252
1252
  group_key?: string
1253
1253
  }
1254
1254
 
1255
+ /**
1256
+ * Manually mints a contact with at least one address. Addresses are
1257
+ * canonicalized server-side; any address already owned by another contact
1258
+ * rejects the create with 409 contact_address_taken.
1259
+ */
1260
+ export interface CreateContactRequest {
1261
+ name: string
1262
+ addresses: AttachContactAddressRequest[]
1263
+ }
1264
+
1255
1265
  export interface AttachContactAddressRequest {
1256
1266
  kind: ContactAddressKind
1257
1267
  scope?: string
@@ -1259,6 +1269,33 @@ export interface AttachContactAddressRequest {
1259
1269
  name?: string
1260
1270
  }
1261
1271
 
1272
+ /**
1273
+ * A directed edge from a contact to a business record (entity_slug +
1274
+ * record_id). Bare — no role; the relationship's semantics come from the
1275
+ * target entity. Immutable once created.
1276
+ */
1277
+ export interface ContactRecordLink {
1278
+ id: string
1279
+ org_id: string
1280
+ contact_id: string
1281
+ entity_slug: string
1282
+ record_id: string
1283
+ created_at: string
1284
+ created_by: UserRef
1285
+ }
1286
+
1287
+ export interface CreateContactRecordLinkRequest {
1288
+ contact_id: string
1289
+ entity_slug: string
1290
+ record_id: string
1291
+ }
1292
+
1293
+ export interface ListContactRecordLinksQuery extends PaginationQuery {
1294
+ contact_id?: string
1295
+ entity_slug?: string
1296
+ record_id?: string
1297
+ }
1298
+
1262
1299
  export interface MergeContactsRequest {
1263
1300
  source_contact_id: string
1264
1301
  }