@naturali/sdk 0.75.0 → 0.76.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 +122 -0
- package/dist/index.d.cts +621 -1
- package/dist/index.d.mts +621 -1
- package/dist/index.mjs +120 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -616,6 +616,19 @@ const createClient = (config = {}) => {
|
|
|
616
616
|
const client = createClient(createConfig());
|
|
617
617
|
//#endregion
|
|
618
618
|
//#region src/generated/sdk.gen.ts
|
|
619
|
+
var Activity = class {
|
|
620
|
+
/**
|
|
621
|
+
* List activity feed entries
|
|
622
|
+
*
|
|
623
|
+
* Returns activity entries for a project, newest first, filterable by kind and severity. Paginated with an opaque cursor rather than offset/limit — pass the previous page's `next_cursor` to fetch the next one; a `null` `next_cursor` means there is no more data.
|
|
624
|
+
*/
|
|
625
|
+
static listActivity(options) {
|
|
626
|
+
return (options.client ?? client).get({
|
|
627
|
+
url: "/v1/projects/{project_id}/activity",
|
|
628
|
+
...options
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
};
|
|
619
632
|
var Actors = class {
|
|
620
633
|
/**
|
|
621
634
|
* List actors
|
|
@@ -1505,6 +1518,41 @@ var Assistant = class {
|
|
|
1505
1518
|
});
|
|
1506
1519
|
}
|
|
1507
1520
|
};
|
|
1521
|
+
var AuditLog = class {
|
|
1522
|
+
/**
|
|
1523
|
+
* List audit entries
|
|
1524
|
+
*
|
|
1525
|
+
* Returns audit-log entries visible to the caller, newest first. All filters are optional and combine with AND. `resource_srn` is a prefix match (e.g. `srn:{project}:secret:` matches every secret action); every other filter is exact.
|
|
1526
|
+
*/
|
|
1527
|
+
static listAuditEntries(options) {
|
|
1528
|
+
return (options.client ?? client).get({
|
|
1529
|
+
url: "/v1/projects/{project_id}/audit-log",
|
|
1530
|
+
...options
|
|
1531
|
+
});
|
|
1532
|
+
}
|
|
1533
|
+
/**
|
|
1534
|
+
* Export audit entries as NDJSON
|
|
1535
|
+
*
|
|
1536
|
+
* Streams a project's audit-log entries as newline-delimited JSON — one entry object per line, oldest first — for archival before the retention window expires, or for shipping into an external system. `project_id` is required: the export is per-project by design. Filters behave exactly as they do on the list endpoint.
|
|
1537
|
+
*/
|
|
1538
|
+
static exportAuditEntries(options) {
|
|
1539
|
+
return (options.client ?? client).get({
|
|
1540
|
+
url: "/v1/projects/{project_id}/audit-log/export",
|
|
1541
|
+
...options
|
|
1542
|
+
});
|
|
1543
|
+
}
|
|
1544
|
+
/**
|
|
1545
|
+
* Get an audit entry
|
|
1546
|
+
*
|
|
1547
|
+
* Returns a single audit-log entry, including its `detail` payload
|
|
1548
|
+
*/
|
|
1549
|
+
static getAuditEntry(options) {
|
|
1550
|
+
return (options.client ?? client).get({
|
|
1551
|
+
url: "/v1/projects/{project_id}/audit-log/{entry_id}",
|
|
1552
|
+
...options
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
};
|
|
1508
1556
|
var Auth = class {
|
|
1509
1557
|
/**
|
|
1510
1558
|
* Email a sign-in code
|
|
@@ -3243,6 +3291,71 @@ var Projects = class {
|
|
|
3243
3291
|
});
|
|
3244
3292
|
}
|
|
3245
3293
|
};
|
|
3294
|
+
var Quotas = class {
|
|
3295
|
+
/**
|
|
3296
|
+
* List quotas
|
|
3297
|
+
*
|
|
3298
|
+
* Returns the quotas defined in a project
|
|
3299
|
+
*/
|
|
3300
|
+
static listQuotas(options) {
|
|
3301
|
+
return (options.client ?? client).get({
|
|
3302
|
+
url: "/v1/projects/{project_id}/quotas",
|
|
3303
|
+
...options
|
|
3304
|
+
});
|
|
3305
|
+
}
|
|
3306
|
+
/**
|
|
3307
|
+
* Create a quota
|
|
3308
|
+
*
|
|
3309
|
+
* Creates a project-scoped quota. `requests` is valid for `scope: project`/`api_key`; `tokens` and `cost_usd` are valid for `scope: project`/`agent`/`actor`. Any other scope/metric pair is rejected with 400 (no attribution exists to enforce it). An `actor` quota caps one end user's spend, matched from the generation's session; a null `scope_ref` means one budget *per* actor rather than a pooled project total. A duplicate quota (same project, scope, scope_ref, metric, window) is rejected with 409.
|
|
3310
|
+
*/
|
|
3311
|
+
static createQuota(options) {
|
|
3312
|
+
return (options.client ?? client).post({
|
|
3313
|
+
url: "/v1/projects/{project_id}/quotas",
|
|
3314
|
+
...options,
|
|
3315
|
+
headers: {
|
|
3316
|
+
"Content-Type": "application/json",
|
|
3317
|
+
...options.headers
|
|
3318
|
+
}
|
|
3319
|
+
});
|
|
3320
|
+
}
|
|
3321
|
+
/**
|
|
3322
|
+
* Delete a quota
|
|
3323
|
+
*
|
|
3324
|
+
* Deletes a quota and drops its window counters
|
|
3325
|
+
*/
|
|
3326
|
+
static deleteQuota(options) {
|
|
3327
|
+
return (options.client ?? client).delete({
|
|
3328
|
+
url: "/v1/projects/{project_id}/quotas/{quota_id}",
|
|
3329
|
+
...options
|
|
3330
|
+
});
|
|
3331
|
+
}
|
|
3332
|
+
/**
|
|
3333
|
+
* Get a quota
|
|
3334
|
+
*
|
|
3335
|
+
* Returns a specific quota, including current window usage
|
|
3336
|
+
*/
|
|
3337
|
+
static getQuota(options) {
|
|
3338
|
+
return (options.client ?? client).get({
|
|
3339
|
+
url: "/v1/projects/{project_id}/quotas/{quota_id}",
|
|
3340
|
+
...options
|
|
3341
|
+
});
|
|
3342
|
+
}
|
|
3343
|
+
/**
|
|
3344
|
+
* Update a quota
|
|
3345
|
+
*
|
|
3346
|
+
* Updates a quota's limit and/or mode. Other fields are immutable.
|
|
3347
|
+
*/
|
|
3348
|
+
static updateQuota(options) {
|
|
3349
|
+
return (options.client ?? client).patch({
|
|
3350
|
+
url: "/v1/projects/{project_id}/quotas/{quota_id}",
|
|
3351
|
+
...options,
|
|
3352
|
+
headers: {
|
|
3353
|
+
"Content-Type": "application/json",
|
|
3354
|
+
...options.headers
|
|
3355
|
+
}
|
|
3356
|
+
});
|
|
3357
|
+
}
|
|
3358
|
+
};
|
|
3246
3359
|
var Secrets = class {
|
|
3247
3360
|
/**
|
|
3248
3361
|
* List secrets
|
|
@@ -4149,12 +4262,14 @@ const API_BASE_URL = "https://api.naturali.ai";
|
|
|
4149
4262
|
* is available as typed data.
|
|
4150
4263
|
*/
|
|
4151
4264
|
var NaturaliClient = class {
|
|
4265
|
+
activity;
|
|
4152
4266
|
actors;
|
|
4153
4267
|
agents;
|
|
4154
4268
|
agentVersions;
|
|
4155
4269
|
aiProviders;
|
|
4156
4270
|
apiKeys;
|
|
4157
4271
|
approvals;
|
|
4272
|
+
auditLog;
|
|
4158
4273
|
assistant;
|
|
4159
4274
|
channels;
|
|
4160
4275
|
auth;
|
|
@@ -4171,6 +4286,7 @@ var NaturaliClient = class {
|
|
|
4171
4286
|
memories;
|
|
4172
4287
|
memoryEntries;
|
|
4173
4288
|
modelRoutes;
|
|
4289
|
+
quotas;
|
|
4174
4290
|
models;
|
|
4175
4291
|
orchestrations;
|
|
4176
4292
|
projects;
|
|
@@ -4193,12 +4309,14 @@ var NaturaliClient = class {
|
|
|
4193
4309
|
...headers
|
|
4194
4310
|
}
|
|
4195
4311
|
}));
|
|
4312
|
+
this.activity = bindResource(Activity, this.http);
|
|
4196
4313
|
this.actors = bindResource(Actors, this.http);
|
|
4197
4314
|
this.agents = bindResource(Agents, this.http);
|
|
4198
4315
|
this.agentVersions = bindResource(AgentVersions, this.http);
|
|
4199
4316
|
this.aiProviders = bindResource(AiProviders, this.http);
|
|
4200
4317
|
this.apiKeys = bindResource(ApiKeys, this.http);
|
|
4201
4318
|
this.approvals = bindResource(Approvals, this.http);
|
|
4319
|
+
this.auditLog = bindResource(AuditLog, this.http);
|
|
4202
4320
|
this.assistant = bindResource(Assistant, this.http);
|
|
4203
4321
|
this.channels = bindResource(Channels, this.http);
|
|
4204
4322
|
this.auth = bindResource(Auth, this.http);
|
|
@@ -4215,6 +4333,7 @@ var NaturaliClient = class {
|
|
|
4215
4333
|
this.memories = bindResource(Memories, this.http);
|
|
4216
4334
|
this.memoryEntries = bindResource(MemoryEntries, this.http);
|
|
4217
4335
|
this.modelRoutes = bindResource(ModelRoutes, this.http);
|
|
4336
|
+
this.quotas = bindResource(Quotas, this.http);
|
|
4218
4337
|
this.models = bindResource(Models, this.http);
|
|
4219
4338
|
this.orchestrations = bindResource(Orchestrations, this.http);
|
|
4220
4339
|
this.projects = bindResource(Projects, this.http);
|
|
@@ -4230,4 +4349,4 @@ var NaturaliClient = class {
|
|
|
4230
4349
|
}
|
|
4231
4350
|
};
|
|
4232
4351
|
//#endregion
|
|
4233
|
-
export { Actors, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, Assistant, Auth, Channels, Conversations, Documents, Embeddings, Evaluations, Exceptions, Files, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryEntries, ModelRoutes, Models, NaturaliClient, Orchestrations, Projects, Secrets, Sessions, Tasks, Tools, Traces, Triggers, Users, Webhooks, Workflows, createClient, createConfig };
|
|
4352
|
+
export { Activity, Actors, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, Assistant, AuditLog, Auth, Channels, Conversations, Documents, Embeddings, Evaluations, Exceptions, Files, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryEntries, ModelRoutes, Models, NaturaliClient, Orchestrations, Projects, Quotas, Secrets, Sessions, Tasks, Tools, Traces, Triggers, Users, Webhooks, Workflows, createClient, createConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.76.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.76.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"generate": "tsx scripts/generate.ts",
|