@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/dist/index.d.cts CHANGED
@@ -3219,12 +3219,45 @@ interface UpdateContactRequest {
3219
3219
  */
3220
3220
  group_key?: string;
3221
3221
  }
3222
+ /**
3223
+ * Manually mints a contact with at least one address. Addresses are
3224
+ * canonicalized server-side; any address already owned by another contact
3225
+ * rejects the create with 409 contact_address_taken.
3226
+ */
3227
+ interface CreateContactRequest {
3228
+ name: string;
3229
+ addresses: AttachContactAddressRequest[];
3230
+ }
3222
3231
  interface AttachContactAddressRequest {
3223
3232
  kind: ContactAddressKind;
3224
3233
  scope?: string;
3225
3234
  value: string;
3226
3235
  name?: string;
3227
3236
  }
3237
+ /**
3238
+ * A directed edge from a contact to a business record (entity_slug +
3239
+ * record_id). Bare — no role; the relationship's semantics come from the
3240
+ * target entity. Immutable once created.
3241
+ */
3242
+ interface ContactRecordLink {
3243
+ id: string;
3244
+ org_id: string;
3245
+ contact_id: string;
3246
+ entity_slug: string;
3247
+ record_id: string;
3248
+ created_at: string;
3249
+ created_by: UserRef;
3250
+ }
3251
+ interface CreateContactRecordLinkRequest {
3252
+ contact_id: string;
3253
+ entity_slug: string;
3254
+ record_id: string;
3255
+ }
3256
+ interface ListContactRecordLinksQuery extends PaginationQuery {
3257
+ contact_id?: string;
3258
+ entity_slug?: string;
3259
+ record_id?: string;
3260
+ }
3228
3261
  interface MergeContactsRequest {
3229
3262
  source_contact_id: string;
3230
3263
  }
@@ -3569,9 +3602,17 @@ interface ConnectionService {
3569
3602
  interface ContactService {
3570
3603
  list(query?: ListContactsQuery): Promise<ListResponse<Contact>>;
3571
3604
  get(id: string): Promise<Contact>;
3605
+ /** Manually mint a contact (sync dedup — 409 contact_address_taken on any owned address). */
3606
+ create(request: CreateContactRequest): Promise<Contact>;
3572
3607
  update(id: string, request: UpdateContactRequest): Promise<Contact>;
3573
3608
  attachAddress(contactId: string, request: AttachContactAddressRequest): Promise<Contact>;
3574
3609
  detachAddress(contactId: string, addressId: string): Promise<Contact>;
3610
+ /** Link the contact to a business record (bare edge; 409 contact_record_link_exists on duplicates). */
3611
+ linkRecord(request: CreateContactRecordLinkRequest): Promise<ContactRecordLink>;
3612
+ /** Page contact→record edges by contact_id, or by entity_slug + record_id. */
3613
+ listRecordLinks(query?: ListContactRecordLinksQuery): Promise<ListResponse<ContactRecordLink>>;
3614
+ getRecordLink(linkId: string): Promise<ContactRecordLink>;
3615
+ unlinkRecord(linkId: string): Promise<void>;
3575
3616
  /** Fold source_contact_id into contactId (contactId wins). */
3576
3617
  merge(contactId: string, request: MergeContactsRequest): Promise<Contact>;
3577
3618
  recordPermissionEvent(contactId: string, request: RecordPermissionEventRequest): Promise<Contact>;
@@ -5290,8 +5331,8 @@ declare const KnowledgeRecordLinkSchema: z.ZodObject<{
5290
5331
  };
5291
5332
  entity_slug: string;
5292
5333
  org_id: string;
5293
- node_id: string;
5294
5334
  record_id: string;
5335
+ node_id: string;
5295
5336
  }, {
5296
5337
  id: string;
5297
5338
  created_at: string;
@@ -5301,8 +5342,8 @@ declare const KnowledgeRecordLinkSchema: z.ZodObject<{
5301
5342
  };
5302
5343
  entity_slug: string;
5303
5344
  org_id: string;
5304
- node_id: string;
5305
5345
  record_id: string;
5346
+ node_id: string;
5306
5347
  }>;
5307
5348
  declare const KnowledgeLabelSchema: z.ZodObject<{
5308
5349
  id: z.ZodString;
package/dist/index.d.ts CHANGED
@@ -3219,12 +3219,45 @@ interface UpdateContactRequest {
3219
3219
  */
3220
3220
  group_key?: string;
3221
3221
  }
3222
+ /**
3223
+ * Manually mints a contact with at least one address. Addresses are
3224
+ * canonicalized server-side; any address already owned by another contact
3225
+ * rejects the create with 409 contact_address_taken.
3226
+ */
3227
+ interface CreateContactRequest {
3228
+ name: string;
3229
+ addresses: AttachContactAddressRequest[];
3230
+ }
3222
3231
  interface AttachContactAddressRequest {
3223
3232
  kind: ContactAddressKind;
3224
3233
  scope?: string;
3225
3234
  value: string;
3226
3235
  name?: string;
3227
3236
  }
3237
+ /**
3238
+ * A directed edge from a contact to a business record (entity_slug +
3239
+ * record_id). Bare — no role; the relationship's semantics come from the
3240
+ * target entity. Immutable once created.
3241
+ */
3242
+ interface ContactRecordLink {
3243
+ id: string;
3244
+ org_id: string;
3245
+ contact_id: string;
3246
+ entity_slug: string;
3247
+ record_id: string;
3248
+ created_at: string;
3249
+ created_by: UserRef;
3250
+ }
3251
+ interface CreateContactRecordLinkRequest {
3252
+ contact_id: string;
3253
+ entity_slug: string;
3254
+ record_id: string;
3255
+ }
3256
+ interface ListContactRecordLinksQuery extends PaginationQuery {
3257
+ contact_id?: string;
3258
+ entity_slug?: string;
3259
+ record_id?: string;
3260
+ }
3228
3261
  interface MergeContactsRequest {
3229
3262
  source_contact_id: string;
3230
3263
  }
@@ -3569,9 +3602,17 @@ interface ConnectionService {
3569
3602
  interface ContactService {
3570
3603
  list(query?: ListContactsQuery): Promise<ListResponse<Contact>>;
3571
3604
  get(id: string): Promise<Contact>;
3605
+ /** Manually mint a contact (sync dedup — 409 contact_address_taken on any owned address). */
3606
+ create(request: CreateContactRequest): Promise<Contact>;
3572
3607
  update(id: string, request: UpdateContactRequest): Promise<Contact>;
3573
3608
  attachAddress(contactId: string, request: AttachContactAddressRequest): Promise<Contact>;
3574
3609
  detachAddress(contactId: string, addressId: string): Promise<Contact>;
3610
+ /** Link the contact to a business record (bare edge; 409 contact_record_link_exists on duplicates). */
3611
+ linkRecord(request: CreateContactRecordLinkRequest): Promise<ContactRecordLink>;
3612
+ /** Page contact→record edges by contact_id, or by entity_slug + record_id. */
3613
+ listRecordLinks(query?: ListContactRecordLinksQuery): Promise<ListResponse<ContactRecordLink>>;
3614
+ getRecordLink(linkId: string): Promise<ContactRecordLink>;
3615
+ unlinkRecord(linkId: string): Promise<void>;
3575
3616
  /** Fold source_contact_id into contactId (contactId wins). */
3576
3617
  merge(contactId: string, request: MergeContactsRequest): Promise<Contact>;
3577
3618
  recordPermissionEvent(contactId: string, request: RecordPermissionEventRequest): Promise<Contact>;
@@ -5290,8 +5331,8 @@ declare const KnowledgeRecordLinkSchema: z.ZodObject<{
5290
5331
  };
5291
5332
  entity_slug: string;
5292
5333
  org_id: string;
5293
- node_id: string;
5294
5334
  record_id: string;
5335
+ node_id: string;
5295
5336
  }, {
5296
5337
  id: string;
5297
5338
  created_at: string;
@@ -5301,8 +5342,8 @@ declare const KnowledgeRecordLinkSchema: z.ZodObject<{
5301
5342
  };
5302
5343
  entity_slug: string;
5303
5344
  org_id: string;
5304
- node_id: string;
5305
5345
  record_id: string;
5346
+ node_id: string;
5306
5347
  }>;
5307
5348
  declare const KnowledgeLabelSchema: z.ZodObject<{
5308
5349
  id: z.ZodString;
package/dist/index.js CHANGED
@@ -1436,6 +1436,9 @@ var ContactServiceImpl = class {
1436
1436
  `${CONVERSATION_BASE_PATH}/contacts/${encodeURIComponent(id)}`
1437
1437
  );
1438
1438
  }
1439
+ create(request) {
1440
+ return this.client.request("POST", `${CONVERSATION_BASE_PATH}/contacts`, request);
1441
+ }
1439
1442
  update(id, request) {
1440
1443
  return this.client.request(
1441
1444
  "PATCH",
@@ -1456,6 +1459,28 @@ var ContactServiceImpl = class {
1456
1459
  `${CONVERSATION_BASE_PATH}/contacts/${encodeURIComponent(contactId)}/addresses/${encodeURIComponent(addressId)}`
1457
1460
  );
1458
1461
  }
1462
+ linkRecord(request) {
1463
+ return this.client.request("POST", `${CONVERSATION_BASE_PATH}/contact-record-links`, request);
1464
+ }
1465
+ listRecordLinks(query = {}) {
1466
+ return this.client.requestWithQuery(
1467
+ "GET",
1468
+ `${CONVERSATION_BASE_PATH}/contact-record-links`,
1469
+ query
1470
+ );
1471
+ }
1472
+ getRecordLink(linkId) {
1473
+ return this.client.request(
1474
+ "GET",
1475
+ `${CONVERSATION_BASE_PATH}/contact-record-links/${encodeURIComponent(linkId)}`
1476
+ );
1477
+ }
1478
+ unlinkRecord(linkId) {
1479
+ return this.client.request(
1480
+ "DELETE",
1481
+ `${CONVERSATION_BASE_PATH}/contact-record-links/${encodeURIComponent(linkId)}`
1482
+ );
1483
+ }
1459
1484
  merge(contactId, request) {
1460
1485
  return this.client.request(
1461
1486
  "POST",