@naturali/sdk 0.123.1 → 0.125.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 +34 -3
- package/dist/index.d.cts +186 -7
- package/dist/index.d.mts +186 -7
- package/dist/index.mjs +34 -3
- package/package.json +2 -2
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({
|
|
@@ -3615,6 +3639,8 @@ var Projects = class {
|
|
|
3615
3639
|
*
|
|
3616
3640
|
* Every bucket also carries components — the amounts actually measured. The token counts describe LLM usage alone, so that is where a storage, api_request or compute_execution bucket reports its real quantity instead of zeroed token fields.
|
|
3617
3641
|
*
|
|
3642
|
+
* The rollup can also be narrowed to one session or one end user before it is bucketed. That is the question no dimension answers: group_by splits the project's whole spend, so "what did this conversation cost, per day" and "what has this end user spent across every session" are reachable only by narrowing. The narrowings intersect, apply to the totals as well as the buckets, and are echoed back complete — null for each one not applied — because a rollup of zeros is otherwise indistinguishable from a project that spent nothing.
|
|
3643
|
+
*
|
|
3618
3644
|
*/
|
|
3619
3645
|
static getProjectUsage(options) {
|
|
3620
3646
|
return (options.client ?? client).get({
|
|
@@ -3798,7 +3824,7 @@ var Sessions = class {
|
|
|
3798
3824
|
/**
|
|
3799
3825
|
* Get a session
|
|
3800
3826
|
*
|
|
3801
|
-
* Returns details of a single session, including a `usage` roll-up of what its generations cost. The listing omits `usage`; for a window,
|
|
3827
|
+
* Returns details of a single session, including a `usage` roll-up of what its generations cost. The listing omits `usage`; for a window, a split by day or model, or one end user across every session, narrow `GET /v1/projects/{project_id}/usage` with `session_id` / `actor_id` instead.
|
|
3802
3828
|
*/
|
|
3803
3829
|
static getSession(options) {
|
|
3804
3830
|
return (options.client ?? client).get({
|
|
@@ -4356,9 +4382,11 @@ var Users = class {
|
|
|
4356
4382
|
/**
|
|
4357
4383
|
* Get the current account's billing standing
|
|
4358
4384
|
*
|
|
4359
|
-
* 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.
|
|
4385
|
+
* 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.
|
|
4386
|
+
*
|
|
4387
|
+
* 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.
|
|
4360
4388
|
*
|
|
4361
|
-
*
|
|
4389
|
+
* 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.
|
|
4362
4390
|
*
|
|
4363
4391
|
* 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.
|
|
4364
4392
|
*
|
|
@@ -4436,6 +4464,9 @@ var Webhooks = class {
|
|
|
4436
4464
|
}
|
|
4437
4465
|
/**
|
|
4438
4466
|
* Get a webhook
|
|
4467
|
+
*
|
|
4468
|
+
* 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).
|
|
4469
|
+
*
|
|
4439
4470
|
*/
|
|
4440
4471
|
static getWebhook(options) {
|
|
4441
4472
|
return (options.client ?? client).get({
|