@naturali/sdk 0.46.1 → 0.47.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.mjs CHANGED
@@ -1062,7 +1062,7 @@ var Channels = class {
1062
1062
  /**
1063
1063
  * List the channel's conversations
1064
1064
  *
1065
- * A cursor page of the channel's conversations, newest first. A conversation is one contact's dialogue on the channel — the continuity anchor that resumes the same runtime session instead of starting fresh per message — so this is the read path for who has talked to the channel and which actor/session their dialogue resolved to.
1065
+ * A cursor page of the channel's conversations, newest first. A conversation is one address's dialogue on the channel — the continuity anchor that resumes the same runtime session instead of starting fresh per message — so this is the read path for who has talked to the channel and which actor/session their dialogue resolved to.
1066
1066
  * Conversations are created by the inbound path (the WhatsApp webhook, the Discord gateway worker) when a real message arrives; there is no way to create one directly.
1067
1067
  *
1068
1068
  */
@@ -1094,159 +1094,6 @@ var Channels = class {
1094
1094
  });
1095
1095
  }
1096
1096
  };
1097
- var Contacts = class {
1098
- /**
1099
- * List contacts
1100
- *
1101
- * A cursor page of the project's contacts, newest first.
1102
- * `channel` + `identifier` (supplied together) is the identity lookup — "who is this phone number?" — and returns at most one contact, following the merge pointer to whoever holds the identifier today. `external_id` asks the same question from the customer's side of the mapping. Contacts merged away are omitted unless `include_merged` asks for them.
1103
- *
1104
- */
1105
- static listContacts(options) {
1106
- return (options.client ?? client).get({
1107
- url: "/v1/projects/{project_id}/contacts",
1108
- ...options
1109
- });
1110
- }
1111
- /**
1112
- * Create a contact
1113
- *
1114
- * Record a contact the customer already knows about, optionally with the identifiers it is expected to arrive at.
1115
- * Optional by design — the inbound path creates contacts on its own. This is for the embedder who has a user in their own system and wants naturali to agree about who that is before the first message, which is what makes `external_id` (and, through it, a session's `tool_context`) useful. No runtime actor is created here; the contact gets one on first need.
1116
- *
1117
- */
1118
- static createContact(options) {
1119
- return (options.client ?? client).post({
1120
- url: "/v1/projects/{project_id}/contacts",
1121
- ...options,
1122
- headers: {
1123
- "Content-Type": "application/json",
1124
- ...options.headers
1125
- }
1126
- });
1127
- }
1128
- /**
1129
- * Erase a contact
1130
- *
1131
- * **Erasure (C4/LGPD).** Not a soft delete and not reversible: the contact's sessions — with their messages and media — its runtime actor, its memory container and every identifier it was reachable at are removed, along with the merge records that reference it.
1132
- * The upstream deletes happen first, so a failure there aborts before the local pointers are dropped and a retry can still find what is left. A contact that was merged into another cannot be erased directly: its data lives with the survivor, so erase that one.
1133
- *
1134
- */
1135
- static deleteContact(options) {
1136
- return (options.client ?? client).delete({
1137
- url: "/v1/projects/{project_id}/contacts/{contact_id}",
1138
- ...options
1139
- });
1140
- }
1141
- /**
1142
- * Get a contact
1143
- */
1144
- static getContact(options) {
1145
- return (options.client ?? client).get({
1146
- url: "/v1/projects/{project_id}/contacts/{contact_id}",
1147
- ...options
1148
- });
1149
- }
1150
- /**
1151
- * Update a contact
1152
- *
1153
- * Retune the customer-owned fields. At least one is required. Identities are attached and detached through their own sub-resource, because each one is a claim about reachability rather than a property of the record.
1154
- *
1155
- */
1156
- static updateContact(options) {
1157
- return (options.client ?? client).patch({
1158
- url: "/v1/projects/{project_id}/contacts/{contact_id}",
1159
- ...options,
1160
- headers: {
1161
- "Content-Type": "application/json",
1162
- ...options.headers
1163
- }
1164
- });
1165
- }
1166
- /**
1167
- * Attach an identity
1168
- *
1169
- * Attach a `(channel, identifier)` pair — the manual half of what the inbound path does automatically, and the way a customer tells naturali that a number it has never seen belongs to a user it already knows. The identifier must be free (C3).
1170
- *
1171
- */
1172
- static createContactIdentity(options) {
1173
- return (options.client ?? client).post({
1174
- url: "/v1/projects/{project_id}/contacts/{contact_id}/identities",
1175
- ...options,
1176
- headers: {
1177
- "Content-Type": "application/json",
1178
- ...options.headers
1179
- }
1180
- });
1181
- }
1182
- /**
1183
- * Detach an identity
1184
- *
1185
- * Detach an identifier attached in error. Refused with `identity_in_use` once a dialogue hangs off it: dropping an identifier with history is erasure wearing a smaller name, and erasure has its own route that actually removes the messages instead of orphaning them.
1186
- *
1187
- */
1188
- static deleteContactIdentity(options) {
1189
- return (options.client ?? client).delete({
1190
- url: "/v1/projects/{project_id}/contacts/{contact_id}/identities/{identity_id}",
1191
- ...options
1192
- });
1193
- }
1194
- /**
1195
- * List the contact's conversations
1196
- *
1197
- * Every dialogue the contact has, across channels, newest first. The channel-scoped list answers "who has talked to this number?"; this one answers "where has this human talked to us?" — the read that makes a merge visible, since both channels' rows then appear under one contact.
1198
- *
1199
- */
1200
- static listContactConversations(options) {
1201
- return (options.client ?? client).get({
1202
- url: "/v1/projects/{project_id}/contacts/{contact_id}/conversations",
1203
- ...options
1204
- });
1205
- }
1206
- /**
1207
- * Merge another contact into this one
1208
- *
1209
- * Fold `source_contact_id` into this contact — "same human, two identifiers" (C4).
1210
- * What moves: every identity and every conversation, so the survivor's history is the union of both. What is *shared* rather than moved: agent memory — the runtime hangs it off the actor, so the source's actor is re-pointed at the survivor's memory container and both keep answering with one recollection. Existing sessions keep working, which is the point of not rewriting them.
1211
- * The source is not deleted: it stays as a tombstone pointing at the survivor, and the returned merge record lists exactly what moved, so the merge can be audited and reverted.
1212
- *
1213
- */
1214
- static mergeContact(options) {
1215
- return (options.client ?? client).post({
1216
- url: "/v1/projects/{project_id}/contacts/{contact_id}:merge",
1217
- ...options,
1218
- headers: {
1219
- "Content-Type": "application/json",
1220
- ...options.headers
1221
- }
1222
- });
1223
- }
1224
- /**
1225
- * List the contact's merges
1226
- *
1227
- * The contact's merge history, newest first, from both sides: the merges it absorbed and the one that absorbed it. The audit half of C4.
1228
- *
1229
- */
1230
- static listContactMerges(options) {
1231
- return (options.client ?? client).get({
1232
- url: "/v1/projects/{project_id}/contacts/{contact_id}/merges",
1233
- ...options
1234
- });
1235
- }
1236
- /**
1237
- * Revert a merge
1238
- *
1239
- * Undo a merge (C4). Replays the record backwards: the identities and conversations it lists go back to the source, the source's actor is re-pointed at the memory it had before, and the tombstone becomes a contact again. Anything that arrived *after* the merge stays with the survivor — it was never the source's.
1240
- * Only the merge still in force can be reverted; a source that has since been merged somewhere else has to be unwound from the top (`merge_superseded`).
1241
- *
1242
- */
1243
- static revertContactMerge(options) {
1244
- return (options.client ?? client).post({
1245
- url: "/v1/projects/{project_id}/contacts/{contact_id}/merges/{merge_id}:revert",
1246
- ...options
1247
- });
1248
- }
1249
- };
1250
1097
  var Generations = class {
1251
1098
  /**
1252
1099
  * List an agent's generations
@@ -2170,7 +2017,6 @@ var NaturaliClient = class {
2170
2017
  auth;
2171
2018
  boards;
2172
2019
  channels;
2173
- contacts;
2174
2020
  generations;
2175
2021
  knowledge;
2176
2022
  models;
@@ -2197,7 +2043,6 @@ var NaturaliClient = class {
2197
2043
  this.auth = bindResource(Auth, this.http);
2198
2044
  this.boards = bindResource(Boards, this.http);
2199
2045
  this.channels = bindResource(Channels, this.http);
2200
- this.contacts = bindResource(Contacts, this.http);
2201
2046
  this.generations = bindResource(Generations, this.http);
2202
2047
  this.knowledge = bindResource(Knowledge, this.http);
2203
2048
  this.models = bindResource(Models, this.http);
@@ -2211,4 +2056,4 @@ var NaturaliClient = class {
2211
2056
  }
2212
2057
  };
2213
2058
  //#endregion
2214
- export { Agents, ApiKeys, Assistant, Auth, Boards, Channels, Contacts, Generations, Knowledge, Models, NaturaliClient, Projects, Providers, Sessions, Tasks, Tools, Traces, Webhooks, createClient, createConfig };
2059
+ export { Agents, ApiKeys, Assistant, Auth, Boards, Channels, Generations, Knowledge, Models, NaturaliClient, Projects, Providers, Sessions, Tasks, Tools, Traces, Webhooks, createClient, createConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/sdk",
3
- "version": "0.46.1",
3
+ "version": "0.47.0",
4
4
  "description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -37,7 +37,7 @@
37
37
  "tsx": "^4.23.1",
38
38
  "typescript": "~6.0.3",
39
39
  "vitest": "^4.1.10",
40
- "@naturali/api": "0.46.1"
40
+ "@naturali/api": "0.47.0"
41
41
  },
42
42
  "scripts": {
43
43
  "generate": "tsx scripts/generate.ts",