@naturali/sdk 0.124.0 → 0.126.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
@@ -739,6 +739,9 @@ var Actors = class {
739
739
  var Channels = class {
740
740
  /**
741
741
  * List addresses
742
+ *
743
+ * Every identifier this project has seen. An address appears the first time a message arrives from it, so this is what naturali has observed rather than a roster you maintain — most rows carry no `action` of their own and defer to the route table.
744
+ *
742
745
  */
743
746
  static listAddresses(options) {
744
747
  return (options.client ?? client).get({
@@ -760,6 +763,9 @@ var Channels = class {
760
763
  }
761
764
  /**
762
765
  * Get an address
766
+ *
767
+ * Reads one identifier's own action, if it has one. An identifier naturali has never seen is a `404`; to set an action without knowing whether it exists, use [`PUT /v1/projects/{project_id}/addresses/{identifier}`](/docs/api/addresses/set-address-action), which upserts.
768
+ *
763
769
  */
764
770
  static getAddress(options) {
765
771
  return (options.client ?? client).get({
@@ -809,6 +815,9 @@ var Channels = class {
809
815
  }
810
816
  /**
811
817
  * List a channel's routes
818
+ *
819
+ * One channel's routes, newest first, `disabled` ones included — only `active` routes take part in resolution. For every route in the project in one read, use [`GET /v1/projects/{project_id}/channel-routes`](/docs/api/channel-routes/list-project-channel-routes).
820
+ *
812
821
  */
813
822
  static listChannelRoutes(options) {
814
823
  return (options.client ?? client).get({
@@ -834,6 +843,9 @@ var Channels = class {
834
843
  }
835
844
  /**
836
845
  * Delete a route
846
+ *
847
+ * Conversations opened under this route keep its id and stay where they are; the next inbound resolves to the next most specific route, or the channel default, and opens a new conversation there. To stop a route from matching while keeping it readable, `PATCH` it to `status: disabled` instead.
848
+ *
837
849
  */
838
850
  static deleteChannelRoute(options) {
839
851
  return (options.client ?? client).delete({
@@ -843,6 +855,9 @@ var Channels = class {
843
855
  }
844
856
  /**
845
857
  * Get a route
858
+ *
859
+ * A route id is only meaningful inside its own channel: the same id under another `channel_id` is a `404`. A conversation's `route_id` may instead be one of the two sentinels for the address's own action and the channel default — those name no route and are not readable here.
860
+ *
846
861
  */
847
862
  static getChannelRoute(options) {
848
863
  return (options.client ?? client).get({
@@ -931,6 +946,9 @@ var Channels = class {
931
946
  }
932
947
  /**
933
948
  * Get a channel
949
+ *
950
+ * The channel's state, its transport modes and its default action. The access token is never returned — `has_credential` is all a read says about it.
951
+ *
934
952
  */
935
953
  static getChannel(options) {
936
954
  return (options.client ?? client).get({
@@ -985,6 +1003,9 @@ var Channels = class {
985
1003
  }
986
1004
  /**
987
1005
  * Get a conversation
1006
+ *
1007
+ * Where the conversation points: the address it belongs to, the route (or sentinel) whose action opened it, and the runtime session it maps 1:1 to. The messages are not here — read them with [`GET /v1/projects/{project_id}/channels/{channel_id}/conversations/{conversation_id}/messages`](/docs/api/channels/list-channel-conversation-messages).
1008
+ *
988
1009
  */
989
1010
  static getChannelConversation(options) {
990
1011
  return (options.client ?? client).get({
@@ -3217,6 +3238,9 @@ var Models = class {
3217
3238
  }
3218
3239
  /**
3219
3240
  * Get a model
3241
+ *
3242
+ * `{model}` is naturali's own name for the model, the same value [`GET /v1/models`](/docs/api/models/list-models) returns — a vendor's invocation string is a `404`. A `deprecated` model still reads here, so a project already generating on one can see what happened to it.
3243
+ *
3220
3244
  */
3221
3245
  static getModel(options) {
3222
3246
  return (options.client ?? client).get({
@@ -3624,6 +3648,34 @@ var Projects = class {
3624
3648
  ...options
3625
3649
  });
3626
3650
  }
3651
+ /**
3652
+ * List project usage events
3653
+ *
3654
+ * The rows a rollup summed — one per metered occurrence, most recent first. Takes the same narrowings [the meter](/docs/api/projects/get-project-usage) does, so a query that produced a bucket answers here unchanged and reads back what went into it. This is the audit and reconciliation view: what was measured, when, against which agent, session, actor and provider, and what each component was priced at.
3655
+ *
3656
+ * An id naming nothing in this project yields an empty page rather than dropping the filter, so a mistyped narrowing can never widen the list past what was asked for.
3657
+ *
3658
+ */
3659
+ static listProjectUsageEvents(options) {
3660
+ return (options.client ?? client).get({
3661
+ url: "/v1/projects/{project_id}/usage/events",
3662
+ ...options
3663
+ });
3664
+ }
3665
+ /**
3666
+ * Get a generation or orchestration-run billing receipt
3667
+ *
3668
+ * What one occurrence was billed, line by line: per-event line items with their measured components and unit prices, a per-meter-type split, and the totals. Pass generation_id for one generation, or orchestration_run_id for a receipt summed across every event the run metered. Exactly one of the two is required.
3669
+ *
3670
+ * This is the itemisation behind a single number — where [the meter](/docs/api/projects/get-project-usage) says a window cost $12.40, a receipt says which components of which call made up one occurrence of it. On an orchestration-run receipt every line carries node_id, so grouping by it gives the per-node cost the total hides; a retried node contributes one line per attempt, which is the intended reading for spend.
3671
+ *
3672
+ */
3673
+ static getProjectUsageReceipt(options) {
3674
+ return (options.client ?? client).get({
3675
+ url: "/v1/projects/{project_id}/usage/receipt",
3676
+ ...options
3677
+ });
3678
+ }
3627
3679
  };
3628
3680
  var Quotas = class {
3629
3681
  /**
@@ -4358,9 +4410,11 @@ var Users = class {
4358
4410
  /**
4359
4411
  * Get the current account's billing standing
4360
4412
  *
4361
- * The plan the account is on, how long its projects may keep content, and the credit it has left — the figures the platform already enforces against, readable by the account they are enforced against.
4413
+ * The plan the account is on, how long its projects may keep content, how much indexed storage it is holding, and the credit it has left — the figures the platform already enforces against, readable by the account they are enforced against.
4414
+ *
4415
+ * A managed-model generation is refused with `402 insufficient_credit` while `credit_balance_usd` is negative, and a feature or a resource count outside the plan is refused with `403`, as is a retention window wider than `retention_days` or an ingest past `storage_limit_gb`. Every refusal names what is missing; this is where the numbers behind them are read.
4362
4416
  *
4363
- * A managed-model generation is refused with `402 insufficient_credit` while `credit_balance_usd` is negative, and a feature or a resource count outside the plan is refused with `403`, as is a retention window wider than `retention_days`. Every refusal names what is missing; this is where the numbers behind them are read.
4417
+ * Every figure here is a local read, which is what keeps this route cheap enough to poll unlike `GET /v1/users/me/usage`, which asks the meter once per project.
4364
4418
  *
4365
4419
  * Answers for the caller's own account only, and always the account the credential resolves to — an API key answers for the user that minted it. The plan gating a *project* is that project's billing owner's, so a member of someone else's project reads their own rung here, not that project's.
4366
4420
  *
@@ -4438,6 +4492,9 @@ var Webhooks = class {
4438
4492
  }
4439
4493
  /**
4440
4494
  * Get a webhook
4495
+ *
4496
+ * The endpoint, the events it is subscribed to and whether deliveries are attempted. The signing secret is not returned: it is shown once by [`POST /v1/projects/{project_id}/webhooks`](/docs/api/webhooks/create-webhook) and again by [`POST /v1/projects/{project_id}/webhooks/{webhook_id}:rotate-secret`](/docs/api/webhooks/rotate-webhook-secret).
4497
+ *
4441
4498
  */
4442
4499
  static getWebhook(options) {
4443
4500
  return (options.client ?? client).get({