@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.mjs CHANGED
@@ -738,6 +738,9 @@ var Actors = class {
738
738
  var Channels = class {
739
739
  /**
740
740
  * List addresses
741
+ *
742
+ * 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.
743
+ *
741
744
  */
742
745
  static listAddresses(options) {
743
746
  return (options.client ?? client).get({
@@ -759,6 +762,9 @@ var Channels = class {
759
762
  }
760
763
  /**
761
764
  * Get an address
765
+ *
766
+ * 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.
767
+ *
762
768
  */
763
769
  static getAddress(options) {
764
770
  return (options.client ?? client).get({
@@ -808,6 +814,9 @@ var Channels = class {
808
814
  }
809
815
  /**
810
816
  * List a channel's routes
817
+ *
818
+ * 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).
819
+ *
811
820
  */
812
821
  static listChannelRoutes(options) {
813
822
  return (options.client ?? client).get({
@@ -833,6 +842,9 @@ var Channels = class {
833
842
  }
834
843
  /**
835
844
  * Delete a route
845
+ *
846
+ * 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.
847
+ *
836
848
  */
837
849
  static deleteChannelRoute(options) {
838
850
  return (options.client ?? client).delete({
@@ -842,6 +854,9 @@ var Channels = class {
842
854
  }
843
855
  /**
844
856
  * Get a route
857
+ *
858
+ * 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.
859
+ *
845
860
  */
846
861
  static getChannelRoute(options) {
847
862
  return (options.client ?? client).get({
@@ -930,6 +945,9 @@ var Channels = class {
930
945
  }
931
946
  /**
932
947
  * Get a channel
948
+ *
949
+ * 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.
950
+ *
933
951
  */
934
952
  static getChannel(options) {
935
953
  return (options.client ?? client).get({
@@ -984,6 +1002,9 @@ var Channels = class {
984
1002
  }
985
1003
  /**
986
1004
  * Get a conversation
1005
+ *
1006
+ * 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).
1007
+ *
987
1008
  */
988
1009
  static getChannelConversation(options) {
989
1010
  return (options.client ?? client).get({
@@ -3216,6 +3237,9 @@ var Models = class {
3216
3237
  }
3217
3238
  /**
3218
3239
  * Get a model
3240
+ *
3241
+ * `{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.
3242
+ *
3219
3243
  */
3220
3244
  static getModel(options) {
3221
3245
  return (options.client ?? client).get({
@@ -3623,6 +3647,34 @@ var Projects = class {
3623
3647
  ...options
3624
3648
  });
3625
3649
  }
3650
+ /**
3651
+ * List project usage events
3652
+ *
3653
+ * 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.
3654
+ *
3655
+ * 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.
3656
+ *
3657
+ */
3658
+ static listProjectUsageEvents(options) {
3659
+ return (options.client ?? client).get({
3660
+ url: "/v1/projects/{project_id}/usage/events",
3661
+ ...options
3662
+ });
3663
+ }
3664
+ /**
3665
+ * Get a generation or orchestration-run billing receipt
3666
+ *
3667
+ * 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.
3668
+ *
3669
+ * 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.
3670
+ *
3671
+ */
3672
+ static getProjectUsageReceipt(options) {
3673
+ return (options.client ?? client).get({
3674
+ url: "/v1/projects/{project_id}/usage/receipt",
3675
+ ...options
3676
+ });
3677
+ }
3626
3678
  };
3627
3679
  var Quotas = class {
3628
3680
  /**
@@ -4357,9 +4409,11 @@ var Users = class {
4357
4409
  /**
4358
4410
  * Get the current account's billing standing
4359
4411
  *
4360
- * 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.
4412
+ * 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.
4413
+ *
4414
+ * 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.
4361
4415
  *
4362
- * 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.
4416
+ * 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.
4363
4417
  *
4364
4418
  * 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.
4365
4419
  *
@@ -4437,6 +4491,9 @@ var Webhooks = class {
4437
4491
  }
4438
4492
  /**
4439
4493
  * Get a webhook
4494
+ *
4495
+ * 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).
4496
+ *
4440
4497
  */
4441
4498
  static getWebhook(options) {
4442
4499
  return (options.client ?? client).get({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/sdk",
3
- "version": "0.124.0",
3
+ "version": "0.126.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.124.0"
40
+ "@naturali/api": "0.126.0"
41
41
  },
42
42
  "scripts": {
43
43
  "generate": "tsx scripts/generate.ts",