@naturali/sdk 0.48.0 → 0.49.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
@@ -602,6 +602,78 @@ const createClient = (config = {}) => {
602
602
  const client = createClient(createConfig());
603
603
  //#endregion
604
604
  //#region src/generated/sdk.gen.ts
605
+ var Actors = class {
606
+ /**
607
+ * List actors
608
+ *
609
+ * Lists the project's actors. Filter by `external_id` to resolve your own key to an actor without creating one.
610
+ *
611
+ */
612
+ static listActors(options) {
613
+ return (options.client ?? client).get({
614
+ url: "/v1/projects/{project_id}/actors",
615
+ ...options
616
+ });
617
+ }
618
+ /**
619
+ * Create an actor
620
+ *
621
+ * Creates the actor, or returns the one that already carries this `external_id`. Idempotent on that key: a retry returns the existing actor with `200` rather than creating a second one, so this is safe as the first call your backend makes when it sees a new user.
622
+ * `external_id` may not start with a channel prefix (`whatsapp:`, `discord:`, …) or `address:` — those name actors that belong to an [address](/docs/api/addresses/get-address), which owns its own.
623
+ *
624
+ */
625
+ static createActor(options) {
626
+ return (options.client ?? client).post({
627
+ url: "/v1/projects/{project_id}/actors",
628
+ ...options,
629
+ headers: {
630
+ "Content-Type": "application/json",
631
+ ...options.headers
632
+ }
633
+ });
634
+ }
635
+ /**
636
+ * Erase an actor
637
+ *
638
+ * Removes the actor and the sessions it holds. Erasure of one identity as this API knows it — narrower than "erase this human everywhere", since naturali does not know that two identities are the same person and does not claim to.
639
+ * An actor that belongs to an [address](/docs/api/addresses/get-address) responds `409`: erase it through `DELETE /v1/projects/{project_id}/addresses/{identifier}`, which also removes the address and its conversations. Deleting it here would leave those behind, pointing at an identity that no longer exists.
640
+ *
641
+ */
642
+ static deleteActor(options) {
643
+ return (options.client ?? client).delete({
644
+ url: "/v1/projects/{project_id}/actors/{actor_id}",
645
+ ...options
646
+ });
647
+ }
648
+ /**
649
+ * Get an actor
650
+ *
651
+ * Returns one actor. An actor belonging to another project responds `404`, not `403` — the API never confirms that an id exists elsewhere.
652
+ *
653
+ */
654
+ static getActor(options) {
655
+ return (options.client ?? client).get({
656
+ url: "/v1/projects/{project_id}/actors/{actor_id}",
657
+ ...options
658
+ });
659
+ }
660
+ /**
661
+ * Update an actor
662
+ *
663
+ * Updates the fields present in the body and leaves the rest alone. `external_id` is not updatable: it is the key callers converge on, and moving it would silently orphan every reference they hold.
664
+ *
665
+ */
666
+ static updateActor(options) {
667
+ return (options.client ?? client).patch({
668
+ url: "/v1/projects/{project_id}/actors/{actor_id}",
669
+ ...options,
670
+ headers: {
671
+ "Content-Type": "application/json",
672
+ ...options.headers
673
+ }
674
+ });
675
+ }
676
+ };
605
677
  var Channels = class {
606
678
  /**
607
679
  * List addresses
@@ -2133,6 +2205,7 @@ const API_BASE_URL = "https://api.naturali.ai";
2133
2205
  * is available as typed data.
2134
2206
  */
2135
2207
  var NaturaliClient = class {
2208
+ actors;
2136
2209
  agents;
2137
2210
  apiKeys;
2138
2211
  assistant;
@@ -2159,6 +2232,7 @@ var NaturaliClient = class {
2159
2232
  ...headers
2160
2233
  }
2161
2234
  }));
2235
+ this.actors = bindResource(Actors, this.http);
2162
2236
  this.agents = bindResource(Agents, this.http);
2163
2237
  this.apiKeys = bindResource(ApiKeys, this.http);
2164
2238
  this.assistant = bindResource(Assistant, this.http);
@@ -2178,4 +2252,4 @@ var NaturaliClient = class {
2178
2252
  }
2179
2253
  };
2180
2254
  //#endregion
2181
- export { Agents, ApiKeys, Assistant, Auth, Boards, Channels, Generations, Knowledge, Models, NaturaliClient, Projects, Providers, Sessions, Tasks, Tools, Traces, Webhooks, createClient, createConfig };
2255
+ export { Actors, 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.48.0",
3
+ "version": "0.49.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.48.0"
40
+ "@naturali/api": "0.49.0"
41
41
  },
42
42
  "scripts": {
43
43
  "generate": "tsx scripts/generate.ts",