@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.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({
|
|
@@ -3614,6 +3638,8 @@ var Projects = class {
|
|
|
3614
3638
|
*
|
|
3615
3639
|
* 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.
|
|
3616
3640
|
*
|
|
3641
|
+
* 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.
|
|
3642
|
+
*
|
|
3617
3643
|
*/
|
|
3618
3644
|
static getProjectUsage(options) {
|
|
3619
3645
|
return (options.client ?? client).get({
|
|
@@ -3797,7 +3823,7 @@ var Sessions = class {
|
|
|
3797
3823
|
/**
|
|
3798
3824
|
* Get a session
|
|
3799
3825
|
*
|
|
3800
|
-
* Returns details of a single session, including a `usage` roll-up of what its generations cost. The listing omits `usage`; for a window,
|
|
3826
|
+
* 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.
|
|
3801
3827
|
*/
|
|
3802
3828
|
static getSession(options) {
|
|
3803
3829
|
return (options.client ?? client).get({
|
|
@@ -4355,9 +4381,11 @@ var Users = class {
|
|
|
4355
4381
|
/**
|
|
4356
4382
|
* Get the current account's billing standing
|
|
4357
4383
|
*
|
|
4358
|
-
* 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.
|
|
4384
|
+
* 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.
|
|
4385
|
+
*
|
|
4386
|
+
* 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.
|
|
4359
4387
|
*
|
|
4360
|
-
*
|
|
4388
|
+
* 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.
|
|
4361
4389
|
*
|
|
4362
4390
|
* 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.
|
|
4363
4391
|
*
|
|
@@ -4435,6 +4463,9 @@ var Webhooks = class {
|
|
|
4435
4463
|
}
|
|
4436
4464
|
/**
|
|
4437
4465
|
* Get a webhook
|
|
4466
|
+
*
|
|
4467
|
+
* 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).
|
|
4468
|
+
*
|
|
4438
4469
|
*/
|
|
4439
4470
|
static getWebhook(options) {
|
|
4440
4471
|
return (options.client ?? client).get({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.125.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.
|
|
40
|
+
"@naturali/api": "0.125.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"generate": "tsx scripts/generate.ts",
|