@naturali/sdk 0.48.1 → 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.cjs CHANGED
@@ -603,6 +603,78 @@ const createClient = (config = {}) => {
603
603
  const client = createClient(createConfig());
604
604
  //#endregion
605
605
  //#region src/generated/sdk.gen.ts
606
+ var Actors = class {
607
+ /**
608
+ * List actors
609
+ *
610
+ * Lists the project's actors. Filter by `external_id` to resolve your own key to an actor without creating one.
611
+ *
612
+ */
613
+ static listActors(options) {
614
+ return (options.client ?? client).get({
615
+ url: "/v1/projects/{project_id}/actors",
616
+ ...options
617
+ });
618
+ }
619
+ /**
620
+ * Create an actor
621
+ *
622
+ * 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.
623
+ * `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.
624
+ *
625
+ */
626
+ static createActor(options) {
627
+ return (options.client ?? client).post({
628
+ url: "/v1/projects/{project_id}/actors",
629
+ ...options,
630
+ headers: {
631
+ "Content-Type": "application/json",
632
+ ...options.headers
633
+ }
634
+ });
635
+ }
636
+ /**
637
+ * Erase an actor
638
+ *
639
+ * 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.
640
+ * 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.
641
+ *
642
+ */
643
+ static deleteActor(options) {
644
+ return (options.client ?? client).delete({
645
+ url: "/v1/projects/{project_id}/actors/{actor_id}",
646
+ ...options
647
+ });
648
+ }
649
+ /**
650
+ * Get an actor
651
+ *
652
+ * Returns one actor. An actor belonging to another project responds `404`, not `403` — the API never confirms that an id exists elsewhere.
653
+ *
654
+ */
655
+ static getActor(options) {
656
+ return (options.client ?? client).get({
657
+ url: "/v1/projects/{project_id}/actors/{actor_id}",
658
+ ...options
659
+ });
660
+ }
661
+ /**
662
+ * Update an actor
663
+ *
664
+ * 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.
665
+ *
666
+ */
667
+ static updateActor(options) {
668
+ return (options.client ?? client).patch({
669
+ url: "/v1/projects/{project_id}/actors/{actor_id}",
670
+ ...options,
671
+ headers: {
672
+ "Content-Type": "application/json",
673
+ ...options.headers
674
+ }
675
+ });
676
+ }
677
+ };
606
678
  var Channels = class {
607
679
  /**
608
680
  * List addresses
@@ -2134,6 +2206,7 @@ const API_BASE_URL = "https://api.naturali.ai";
2134
2206
  * is available as typed data.
2135
2207
  */
2136
2208
  var NaturaliClient = class {
2209
+ actors;
2137
2210
  agents;
2138
2211
  apiKeys;
2139
2212
  assistant;
@@ -2160,6 +2233,7 @@ var NaturaliClient = class {
2160
2233
  ...headers
2161
2234
  }
2162
2235
  }));
2236
+ this.actors = bindResource(Actors, this.http);
2163
2237
  this.agents = bindResource(Agents, this.http);
2164
2238
  this.apiKeys = bindResource(ApiKeys, this.http);
2165
2239
  this.assistant = bindResource(Assistant, this.http);
@@ -2179,6 +2253,7 @@ var NaturaliClient = class {
2179
2253
  }
2180
2254
  };
2181
2255
  //#endregion
2256
+ exports.Actors = Actors;
2182
2257
  exports.Agents = Agents;
2183
2258
  exports.ApiKeys = ApiKeys;
2184
2259
  exports.Assistant = Assistant;