@naturali/cli 0.75.0 → 0.77.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 +521 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
14
14
|
};
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region package.json
|
|
17
|
-
var version = "0.
|
|
17
|
+
var version = "0.77.0";
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region ../sdk/src/generated/core/bodySerializer.gen.ts
|
|
20
20
|
const serializeFormDataPair = (data, key, value) => {
|
|
@@ -634,6 +634,19 @@ const createClient = (config = {}) => {
|
|
|
634
634
|
const client = createClient(createConfig());
|
|
635
635
|
//#endregion
|
|
636
636
|
//#region ../sdk/src/generated/sdk.gen.ts
|
|
637
|
+
var Activity = class {
|
|
638
|
+
/**
|
|
639
|
+
* List activity feed entries
|
|
640
|
+
*
|
|
641
|
+
* 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.
|
|
642
|
+
*/
|
|
643
|
+
static listActivity(options) {
|
|
644
|
+
return (options.client ?? client).get({
|
|
645
|
+
url: "/v1/projects/{project_id}/activity",
|
|
646
|
+
...options
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
};
|
|
637
650
|
var Actors = class {
|
|
638
651
|
/**
|
|
639
652
|
* List actors
|
|
@@ -1523,6 +1536,41 @@ var Assistant = class {
|
|
|
1523
1536
|
});
|
|
1524
1537
|
}
|
|
1525
1538
|
};
|
|
1539
|
+
var AuditLog = class {
|
|
1540
|
+
/**
|
|
1541
|
+
* List audit entries
|
|
1542
|
+
*
|
|
1543
|
+
* 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.
|
|
1544
|
+
*/
|
|
1545
|
+
static listAuditEntries(options) {
|
|
1546
|
+
return (options.client ?? client).get({
|
|
1547
|
+
url: "/v1/projects/{project_id}/audit-log",
|
|
1548
|
+
...options
|
|
1549
|
+
});
|
|
1550
|
+
}
|
|
1551
|
+
/**
|
|
1552
|
+
* Export audit entries as NDJSON
|
|
1553
|
+
*
|
|
1554
|
+
* 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.
|
|
1555
|
+
*/
|
|
1556
|
+
static exportAuditEntries(options) {
|
|
1557
|
+
return (options.client ?? client).get({
|
|
1558
|
+
url: "/v1/projects/{project_id}/audit-log/export",
|
|
1559
|
+
...options
|
|
1560
|
+
});
|
|
1561
|
+
}
|
|
1562
|
+
/**
|
|
1563
|
+
* Get an audit entry
|
|
1564
|
+
*
|
|
1565
|
+
* Returns a single audit-log entry, including its `detail` payload
|
|
1566
|
+
*/
|
|
1567
|
+
static getAuditEntry(options) {
|
|
1568
|
+
return (options.client ?? client).get({
|
|
1569
|
+
url: "/v1/projects/{project_id}/audit-log/{entry_id}",
|
|
1570
|
+
...options
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
};
|
|
1526
1574
|
var Auth = class {
|
|
1527
1575
|
/**
|
|
1528
1576
|
* Email a sign-in code
|
|
@@ -3261,6 +3309,71 @@ var Projects = class {
|
|
|
3261
3309
|
});
|
|
3262
3310
|
}
|
|
3263
3311
|
};
|
|
3312
|
+
var Quotas = class {
|
|
3313
|
+
/**
|
|
3314
|
+
* List quotas
|
|
3315
|
+
*
|
|
3316
|
+
* Returns the quotas defined in a project
|
|
3317
|
+
*/
|
|
3318
|
+
static listQuotas(options) {
|
|
3319
|
+
return (options.client ?? client).get({
|
|
3320
|
+
url: "/v1/projects/{project_id}/quotas",
|
|
3321
|
+
...options
|
|
3322
|
+
});
|
|
3323
|
+
}
|
|
3324
|
+
/**
|
|
3325
|
+
* Create a quota
|
|
3326
|
+
*
|
|
3327
|
+
* 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.
|
|
3328
|
+
*/
|
|
3329
|
+
static createQuota(options) {
|
|
3330
|
+
return (options.client ?? client).post({
|
|
3331
|
+
url: "/v1/projects/{project_id}/quotas",
|
|
3332
|
+
...options,
|
|
3333
|
+
headers: {
|
|
3334
|
+
"Content-Type": "application/json",
|
|
3335
|
+
...options.headers
|
|
3336
|
+
}
|
|
3337
|
+
});
|
|
3338
|
+
}
|
|
3339
|
+
/**
|
|
3340
|
+
* Delete a quota
|
|
3341
|
+
*
|
|
3342
|
+
* Deletes a quota and drops its window counters
|
|
3343
|
+
*/
|
|
3344
|
+
static deleteQuota(options) {
|
|
3345
|
+
return (options.client ?? client).delete({
|
|
3346
|
+
url: "/v1/projects/{project_id}/quotas/{quota_id}",
|
|
3347
|
+
...options
|
|
3348
|
+
});
|
|
3349
|
+
}
|
|
3350
|
+
/**
|
|
3351
|
+
* Get a quota
|
|
3352
|
+
*
|
|
3353
|
+
* Returns a specific quota, including current window usage
|
|
3354
|
+
*/
|
|
3355
|
+
static getQuota(options) {
|
|
3356
|
+
return (options.client ?? client).get({
|
|
3357
|
+
url: "/v1/projects/{project_id}/quotas/{quota_id}",
|
|
3358
|
+
...options
|
|
3359
|
+
});
|
|
3360
|
+
}
|
|
3361
|
+
/**
|
|
3362
|
+
* Update a quota
|
|
3363
|
+
*
|
|
3364
|
+
* Updates a quota's limit and/or mode. Other fields are immutable.
|
|
3365
|
+
*/
|
|
3366
|
+
static updateQuota(options) {
|
|
3367
|
+
return (options.client ?? client).patch({
|
|
3368
|
+
url: "/v1/projects/{project_id}/quotas/{quota_id}",
|
|
3369
|
+
...options,
|
|
3370
|
+
headers: {
|
|
3371
|
+
"Content-Type": "application/json",
|
|
3372
|
+
...options.headers
|
|
3373
|
+
}
|
|
3374
|
+
});
|
|
3375
|
+
}
|
|
3376
|
+
};
|
|
3264
3377
|
var Secrets = class {
|
|
3265
3378
|
/**
|
|
3266
3379
|
* List secrets
|
|
@@ -4167,12 +4280,14 @@ const API_BASE_URL$1 = "https://api.naturali.ai";
|
|
|
4167
4280
|
* is available as typed data.
|
|
4168
4281
|
*/
|
|
4169
4282
|
var NaturaliClient = class {
|
|
4283
|
+
activity;
|
|
4170
4284
|
actors;
|
|
4171
4285
|
agents;
|
|
4172
4286
|
agentVersions;
|
|
4173
4287
|
aiProviders;
|
|
4174
4288
|
apiKeys;
|
|
4175
4289
|
approvals;
|
|
4290
|
+
auditLog;
|
|
4176
4291
|
assistant;
|
|
4177
4292
|
channels;
|
|
4178
4293
|
auth;
|
|
@@ -4189,6 +4304,7 @@ var NaturaliClient = class {
|
|
|
4189
4304
|
memories;
|
|
4190
4305
|
memoryEntries;
|
|
4191
4306
|
modelRoutes;
|
|
4307
|
+
quotas;
|
|
4192
4308
|
models;
|
|
4193
4309
|
orchestrations;
|
|
4194
4310
|
projects;
|
|
@@ -4211,12 +4327,14 @@ var NaturaliClient = class {
|
|
|
4211
4327
|
...headers
|
|
4212
4328
|
}
|
|
4213
4329
|
}));
|
|
4330
|
+
this.activity = bindResource(Activity, this.http);
|
|
4214
4331
|
this.actors = bindResource(Actors, this.http);
|
|
4215
4332
|
this.agents = bindResource(Agents, this.http);
|
|
4216
4333
|
this.agentVersions = bindResource(AgentVersions, this.http);
|
|
4217
4334
|
this.aiProviders = bindResource(AiProviders, this.http);
|
|
4218
4335
|
this.apiKeys = bindResource(ApiKeys, this.http);
|
|
4219
4336
|
this.approvals = bindResource(Approvals, this.http);
|
|
4337
|
+
this.auditLog = bindResource(AuditLog, this.http);
|
|
4220
4338
|
this.assistant = bindResource(Assistant, this.http);
|
|
4221
4339
|
this.channels = bindResource(Channels, this.http);
|
|
4222
4340
|
this.auth = bindResource(Auth, this.http);
|
|
@@ -4233,6 +4351,7 @@ var NaturaliClient = class {
|
|
|
4233
4351
|
this.memories = bindResource(Memories, this.http);
|
|
4234
4352
|
this.memoryEntries = bindResource(MemoryEntries, this.http);
|
|
4235
4353
|
this.modelRoutes = bindResource(ModelRoutes, this.http);
|
|
4354
|
+
this.quotas = bindResource(Quotas, this.http);
|
|
4236
4355
|
this.models = bindResource(Models, this.http);
|
|
4237
4356
|
this.orchestrations = bindResource(Orchestrations, this.http);
|
|
4238
4357
|
this.projects = bindResource(Projects, this.http);
|
|
@@ -4250,6 +4369,7 @@ var NaturaliClient = class {
|
|
|
4250
4369
|
//#endregion
|
|
4251
4370
|
//#region ../sdk/src/index.ts
|
|
4252
4371
|
var src_exports = /* @__PURE__ */ __exportAll({
|
|
4372
|
+
Activity: () => Activity,
|
|
4253
4373
|
Actors: () => Actors,
|
|
4254
4374
|
AgentVersions: () => AgentVersions,
|
|
4255
4375
|
Agents: () => Agents,
|
|
@@ -4257,6 +4377,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
4257
4377
|
ApiKeys: () => ApiKeys,
|
|
4258
4378
|
Approvals: () => Approvals,
|
|
4259
4379
|
Assistant: () => Assistant,
|
|
4380
|
+
AuditLog: () => AuditLog,
|
|
4260
4381
|
Auth: () => Auth,
|
|
4261
4382
|
Channels: () => Channels,
|
|
4262
4383
|
Conversations: () => Conversations,
|
|
@@ -4276,6 +4397,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
4276
4397
|
NaturaliClient: () => NaturaliClient,
|
|
4277
4398
|
Orchestrations: () => Orchestrations,
|
|
4278
4399
|
Projects: () => Projects,
|
|
4400
|
+
Quotas: () => Quotas,
|
|
4279
4401
|
Secrets: () => Secrets,
|
|
4280
4402
|
Sessions: () => Sessions,
|
|
4281
4403
|
Tasks: () => Tasks,
|
|
@@ -4653,6 +4775,57 @@ const dispatchCommand = async (args) => {
|
|
|
4653
4775
|
//#endregion
|
|
4654
4776
|
//#region src/generated/routes.ts
|
|
4655
4777
|
const routes = {
|
|
4778
|
+
"list-activity": {
|
|
4779
|
+
serviceClass: "Activity",
|
|
4780
|
+
operationId: "listActivity",
|
|
4781
|
+
description: "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.",
|
|
4782
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/activity",
|
|
4783
|
+
httpMethod: "get",
|
|
4784
|
+
pathParams: ["project_id"],
|
|
4785
|
+
queryParams: [
|
|
4786
|
+
"kind",
|
|
4787
|
+
"severity",
|
|
4788
|
+
"cursor",
|
|
4789
|
+
"limit"
|
|
4790
|
+
],
|
|
4791
|
+
flags: [
|
|
4792
|
+
{
|
|
4793
|
+
"name": "project_id",
|
|
4794
|
+
"description": "Project public ID (proj_ prefix).",
|
|
4795
|
+
"required": true,
|
|
4796
|
+
"type": "string",
|
|
4797
|
+
"in": "path"
|
|
4798
|
+
},
|
|
4799
|
+
{
|
|
4800
|
+
"name": "kind",
|
|
4801
|
+
"description": "Filter by activity kind",
|
|
4802
|
+
"required": false,
|
|
4803
|
+
"type": "string",
|
|
4804
|
+
"in": "query"
|
|
4805
|
+
},
|
|
4806
|
+
{
|
|
4807
|
+
"name": "severity",
|
|
4808
|
+
"description": "Filter by severity",
|
|
4809
|
+
"required": false,
|
|
4810
|
+
"type": "string",
|
|
4811
|
+
"in": "query"
|
|
4812
|
+
},
|
|
4813
|
+
{
|
|
4814
|
+
"name": "cursor",
|
|
4815
|
+
"description": "Opaque cursor from a previous page's `next_cursor`",
|
|
4816
|
+
"required": false,
|
|
4817
|
+
"type": "string",
|
|
4818
|
+
"in": "query"
|
|
4819
|
+
},
|
|
4820
|
+
{
|
|
4821
|
+
"name": "limit",
|
|
4822
|
+
"description": "Maximum number of results to return",
|
|
4823
|
+
"required": false,
|
|
4824
|
+
"type": "integer",
|
|
4825
|
+
"in": "query"
|
|
4826
|
+
}
|
|
4827
|
+
]
|
|
4828
|
+
},
|
|
4656
4829
|
"list-actors": {
|
|
4657
4830
|
serviceClass: "Actors",
|
|
4658
4831
|
operationId: "listActors",
|
|
@@ -6776,6 +6949,178 @@ const routes = {
|
|
|
6776
6949
|
"in": "body"
|
|
6777
6950
|
}]
|
|
6778
6951
|
},
|
|
6952
|
+
"list-audit-entries": {
|
|
6953
|
+
serviceClass: "AuditLog",
|
|
6954
|
+
operationId: "listAuditEntries",
|
|
6955
|
+
description: "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.",
|
|
6956
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/audit-log",
|
|
6957
|
+
httpMethod: "get",
|
|
6958
|
+
pathParams: ["project_id"],
|
|
6959
|
+
queryParams: [
|
|
6960
|
+
"action",
|
|
6961
|
+
"principal_id",
|
|
6962
|
+
"resource_public_id",
|
|
6963
|
+
"resource_srn",
|
|
6964
|
+
"from",
|
|
6965
|
+
"to",
|
|
6966
|
+
"limit",
|
|
6967
|
+
"offset"
|
|
6968
|
+
],
|
|
6969
|
+
flags: [
|
|
6970
|
+
{
|
|
6971
|
+
"name": "project_id",
|
|
6972
|
+
"description": "Project public ID (proj_ prefix).",
|
|
6973
|
+
"required": true,
|
|
6974
|
+
"type": "string",
|
|
6975
|
+
"in": "path"
|
|
6976
|
+
},
|
|
6977
|
+
{
|
|
6978
|
+
"name": "action",
|
|
6979
|
+
"description": "Exact permission-action string, e.g. `secrets:DeleteSecret`",
|
|
6980
|
+
"required": false,
|
|
6981
|
+
"type": "string",
|
|
6982
|
+
"in": "query"
|
|
6983
|
+
},
|
|
6984
|
+
{
|
|
6985
|
+
"name": "principal_id",
|
|
6986
|
+
"description": "Public id of the principal (`user_…` or `key_…`)",
|
|
6987
|
+
"required": false,
|
|
6988
|
+
"type": "string",
|
|
6989
|
+
"in": "query"
|
|
6990
|
+
},
|
|
6991
|
+
{
|
|
6992
|
+
"name": "resource_public_id",
|
|
6993
|
+
"description": "Exact target resource public id, e.g. `sec_…`",
|
|
6994
|
+
"required": false,
|
|
6995
|
+
"type": "string",
|
|
6996
|
+
"in": "query"
|
|
6997
|
+
},
|
|
6998
|
+
{
|
|
6999
|
+
"name": "resource_srn",
|
|
7000
|
+
"description": "SRN prefix match, e.g. `srn:{project}:secret:`. An entry written before an earlier prefix rename keeps its original SRN (the log is append-only), and an `srn:` prefix matches those too, so history stays reachable.",
|
|
7001
|
+
"required": false,
|
|
7002
|
+
"type": "string",
|
|
7003
|
+
"in": "query"
|
|
7004
|
+
},
|
|
7005
|
+
{
|
|
7006
|
+
"name": "from",
|
|
7007
|
+
"description": "Only entries created at or after this timestamp (ISO 8601)",
|
|
7008
|
+
"required": false,
|
|
7009
|
+
"type": "string",
|
|
7010
|
+
"in": "query"
|
|
7011
|
+
},
|
|
7012
|
+
{
|
|
7013
|
+
"name": "to",
|
|
7014
|
+
"description": "Only entries created at or before this timestamp (ISO 8601)",
|
|
7015
|
+
"required": false,
|
|
7016
|
+
"type": "string",
|
|
7017
|
+
"in": "query"
|
|
7018
|
+
},
|
|
7019
|
+
{
|
|
7020
|
+
"name": "limit",
|
|
7021
|
+
"description": "Number of results per page (1–200, default 25)",
|
|
7022
|
+
"required": false,
|
|
7023
|
+
"type": "integer",
|
|
7024
|
+
"in": "query"
|
|
7025
|
+
},
|
|
7026
|
+
{
|
|
7027
|
+
"name": "offset",
|
|
7028
|
+
"description": "Number of results to skip",
|
|
7029
|
+
"required": false,
|
|
7030
|
+
"type": "integer",
|
|
7031
|
+
"in": "query"
|
|
7032
|
+
}
|
|
7033
|
+
]
|
|
7034
|
+
},
|
|
7035
|
+
"export-audit-entries": {
|
|
7036
|
+
serviceClass: "AuditLog",
|
|
7037
|
+
operationId: "exportAuditEntries",
|
|
7038
|
+
description: "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.",
|
|
7039
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/audit-log",
|
|
7040
|
+
httpMethod: "get",
|
|
7041
|
+
pathParams: ["project_id"],
|
|
7042
|
+
queryParams: [
|
|
7043
|
+
"action",
|
|
7044
|
+
"principal_id",
|
|
7045
|
+
"resource_public_id",
|
|
7046
|
+
"resource_srn",
|
|
7047
|
+
"from",
|
|
7048
|
+
"to"
|
|
7049
|
+
],
|
|
7050
|
+
flags: [
|
|
7051
|
+
{
|
|
7052
|
+
"name": "project_id",
|
|
7053
|
+
"description": "Project public ID (proj_ prefix).",
|
|
7054
|
+
"required": true,
|
|
7055
|
+
"type": "string",
|
|
7056
|
+
"in": "path"
|
|
7057
|
+
},
|
|
7058
|
+
{
|
|
7059
|
+
"name": "action",
|
|
7060
|
+
"description": "Exact permission-action string, e.g. `secrets:DeleteSecret`",
|
|
7061
|
+
"required": false,
|
|
7062
|
+
"type": "string",
|
|
7063
|
+
"in": "query"
|
|
7064
|
+
},
|
|
7065
|
+
{
|
|
7066
|
+
"name": "principal_id",
|
|
7067
|
+
"description": "Public id of the principal (`user_…` or `key_…`)",
|
|
7068
|
+
"required": false,
|
|
7069
|
+
"type": "string",
|
|
7070
|
+
"in": "query"
|
|
7071
|
+
},
|
|
7072
|
+
{
|
|
7073
|
+
"name": "resource_public_id",
|
|
7074
|
+
"description": "Exact target resource public id, e.g. `sec_…`",
|
|
7075
|
+
"required": false,
|
|
7076
|
+
"type": "string",
|
|
7077
|
+
"in": "query"
|
|
7078
|
+
},
|
|
7079
|
+
{
|
|
7080
|
+
"name": "resource_srn",
|
|
7081
|
+
"description": "SRN prefix match, e.g. `srn:{project}:secret:`. An entry written before an earlier prefix rename keeps its original SRN (the log is append-only), and an `srn:` prefix matches those too, so history stays reachable.",
|
|
7082
|
+
"required": false,
|
|
7083
|
+
"type": "string",
|
|
7084
|
+
"in": "query"
|
|
7085
|
+
},
|
|
7086
|
+
{
|
|
7087
|
+
"name": "from",
|
|
7088
|
+
"description": "Only entries created at or after this timestamp (ISO 8601)",
|
|
7089
|
+
"required": false,
|
|
7090
|
+
"type": "string",
|
|
7091
|
+
"in": "query"
|
|
7092
|
+
},
|
|
7093
|
+
{
|
|
7094
|
+
"name": "to",
|
|
7095
|
+
"description": "Only entries created at or before this timestamp (ISO 8601)",
|
|
7096
|
+
"required": false,
|
|
7097
|
+
"type": "string",
|
|
7098
|
+
"in": "query"
|
|
7099
|
+
}
|
|
7100
|
+
]
|
|
7101
|
+
},
|
|
7102
|
+
"get-audit-entry": {
|
|
7103
|
+
serviceClass: "AuditLog",
|
|
7104
|
+
operationId: "getAuditEntry",
|
|
7105
|
+
description: "Returns a single audit-log entry, including its `detail` payload",
|
|
7106
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/audit-log",
|
|
7107
|
+
httpMethod: "get",
|
|
7108
|
+
pathParams: ["project_id", "entry_id"],
|
|
7109
|
+
queryParams: [],
|
|
7110
|
+
flags: [{
|
|
7111
|
+
"name": "project_id",
|
|
7112
|
+
"description": "Project public ID (proj_ prefix).",
|
|
7113
|
+
"required": true,
|
|
7114
|
+
"type": "string",
|
|
7115
|
+
"in": "path"
|
|
7116
|
+
}, {
|
|
7117
|
+
"name": "entry_id",
|
|
7118
|
+
"description": "Audit entry ID",
|
|
7119
|
+
"required": true,
|
|
7120
|
+
"type": "string",
|
|
7121
|
+
"in": "path"
|
|
7122
|
+
}]
|
|
7123
|
+
},
|
|
6779
7124
|
"request-sign-in-code": {
|
|
6780
7125
|
serviceClass: "Auth",
|
|
6781
7126
|
operationId: "requestSignInCode",
|
|
@@ -12076,6 +12421,181 @@ const routes = {
|
|
|
12076
12421
|
}
|
|
12077
12422
|
]
|
|
12078
12423
|
},
|
|
12424
|
+
"list-quotas": {
|
|
12425
|
+
serviceClass: "Quotas",
|
|
12426
|
+
operationId: "listQuotas",
|
|
12427
|
+
description: "Returns the quotas defined in a project",
|
|
12428
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/quotas",
|
|
12429
|
+
httpMethod: "get",
|
|
12430
|
+
pathParams: ["project_id"],
|
|
12431
|
+
queryParams: ["limit", "offset"],
|
|
12432
|
+
flags: [
|
|
12433
|
+
{
|
|
12434
|
+
"name": "project_id",
|
|
12435
|
+
"description": "Project public ID (proj_ prefix).",
|
|
12436
|
+
"required": true,
|
|
12437
|
+
"type": "string",
|
|
12438
|
+
"in": "path"
|
|
12439
|
+
},
|
|
12440
|
+
{
|
|
12441
|
+
"name": "limit",
|
|
12442
|
+
"description": "Maximum number of results to return",
|
|
12443
|
+
"required": false,
|
|
12444
|
+
"type": "integer",
|
|
12445
|
+
"in": "query"
|
|
12446
|
+
},
|
|
12447
|
+
{
|
|
12448
|
+
"name": "offset",
|
|
12449
|
+
"description": "Number of results to skip",
|
|
12450
|
+
"required": false,
|
|
12451
|
+
"type": "integer",
|
|
12452
|
+
"in": "query"
|
|
12453
|
+
}
|
|
12454
|
+
]
|
|
12455
|
+
},
|
|
12456
|
+
"create-quota": {
|
|
12457
|
+
serviceClass: "Quotas",
|
|
12458
|
+
operationId: "createQuota",
|
|
12459
|
+
description: "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.",
|
|
12460
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/quotas",
|
|
12461
|
+
httpMethod: "post",
|
|
12462
|
+
pathParams: ["project_id"],
|
|
12463
|
+
queryParams: [],
|
|
12464
|
+
flags: [
|
|
12465
|
+
{
|
|
12466
|
+
"name": "project_id",
|
|
12467
|
+
"description": "Project public ID (proj_ prefix).",
|
|
12468
|
+
"required": true,
|
|
12469
|
+
"type": "string",
|
|
12470
|
+
"in": "path"
|
|
12471
|
+
},
|
|
12472
|
+
{
|
|
12473
|
+
"name": "scope",
|
|
12474
|
+
"description": "The scope the quota applies to",
|
|
12475
|
+
"required": true,
|
|
12476
|
+
"type": "string",
|
|
12477
|
+
"in": "body"
|
|
12478
|
+
},
|
|
12479
|
+
{
|
|
12480
|
+
"name": "scope_ref",
|
|
12481
|
+
"description": "Public id of the api key / agent / actor the quota applies to. For `api_key` and `agent` scope, NULL means all entities of that scope type in the project. For `actor` scope, NULL means one budget *per* actor — each end user gets their own allowance — rather than a pooled total across all actors.",
|
|
12482
|
+
"required": false,
|
|
12483
|
+
"type": "string",
|
|
12484
|
+
"in": "body"
|
|
12485
|
+
},
|
|
12486
|
+
{
|
|
12487
|
+
"name": "metric",
|
|
12488
|
+
"description": "The metric being capped",
|
|
12489
|
+
"required": true,
|
|
12490
|
+
"type": "string",
|
|
12491
|
+
"in": "body"
|
|
12492
|
+
},
|
|
12493
|
+
{
|
|
12494
|
+
"name": "window",
|
|
12495
|
+
"description": "The window over which the metric is aggregated",
|
|
12496
|
+
"required": true,
|
|
12497
|
+
"type": "string",
|
|
12498
|
+
"in": "body"
|
|
12499
|
+
},
|
|
12500
|
+
{
|
|
12501
|
+
"name": "limit",
|
|
12502
|
+
"description": "The cap. Must be a positive integer for requests/tokens; fractional values are allowed for cost_usd.",
|
|
12503
|
+
"required": true,
|
|
12504
|
+
"type": "number",
|
|
12505
|
+
"in": "body"
|
|
12506
|
+
},
|
|
12507
|
+
{
|
|
12508
|
+
"name": "mode",
|
|
12509
|
+
"description": "enforce blocks with 429 (requests at the middleware, tokens/cost_usd at the pre-generation check); monitor observes without blocking — a breach fires the quota.exceeded webhook and writes a quotas:MonitorBreach audit entry, but the request is let through.",
|
|
12510
|
+
"required": false,
|
|
12511
|
+
"type": "string",
|
|
12512
|
+
"in": "body"
|
|
12513
|
+
}
|
|
12514
|
+
]
|
|
12515
|
+
},
|
|
12516
|
+
"get-quota": {
|
|
12517
|
+
serviceClass: "Quotas",
|
|
12518
|
+
operationId: "getQuota",
|
|
12519
|
+
description: "Returns a specific quota, including current window usage",
|
|
12520
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/quotas",
|
|
12521
|
+
httpMethod: "get",
|
|
12522
|
+
pathParams: ["project_id", "quota_id"],
|
|
12523
|
+
queryParams: [],
|
|
12524
|
+
flags: [{
|
|
12525
|
+
"name": "project_id",
|
|
12526
|
+
"description": "Project public ID (proj_ prefix).",
|
|
12527
|
+
"required": true,
|
|
12528
|
+
"type": "string",
|
|
12529
|
+
"in": "path"
|
|
12530
|
+
}, {
|
|
12531
|
+
"name": "quota_id",
|
|
12532
|
+
"description": "Quota ID",
|
|
12533
|
+
"required": true,
|
|
12534
|
+
"type": "string",
|
|
12535
|
+
"in": "path"
|
|
12536
|
+
}]
|
|
12537
|
+
},
|
|
12538
|
+
"update-quota": {
|
|
12539
|
+
serviceClass: "Quotas",
|
|
12540
|
+
operationId: "updateQuota",
|
|
12541
|
+
description: "Updates a quota's limit and/or mode. Other fields are immutable.",
|
|
12542
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/quotas",
|
|
12543
|
+
httpMethod: "patch",
|
|
12544
|
+
pathParams: ["project_id", "quota_id"],
|
|
12545
|
+
queryParams: [],
|
|
12546
|
+
flags: [
|
|
12547
|
+
{
|
|
12548
|
+
"name": "project_id",
|
|
12549
|
+
"description": "Project public ID (proj_ prefix).",
|
|
12550
|
+
"required": true,
|
|
12551
|
+
"type": "string",
|
|
12552
|
+
"in": "path"
|
|
12553
|
+
},
|
|
12554
|
+
{
|
|
12555
|
+
"name": "quota_id",
|
|
12556
|
+
"description": "Quota ID",
|
|
12557
|
+
"required": true,
|
|
12558
|
+
"type": "string",
|
|
12559
|
+
"in": "path"
|
|
12560
|
+
},
|
|
12561
|
+
{
|
|
12562
|
+
"name": "limit",
|
|
12563
|
+
"description": "New limit",
|
|
12564
|
+
"required": false,
|
|
12565
|
+
"type": "number",
|
|
12566
|
+
"in": "body"
|
|
12567
|
+
},
|
|
12568
|
+
{
|
|
12569
|
+
"name": "mode",
|
|
12570
|
+
"description": "New mode",
|
|
12571
|
+
"required": false,
|
|
12572
|
+
"type": "string",
|
|
12573
|
+
"in": "body"
|
|
12574
|
+
}
|
|
12575
|
+
]
|
|
12576
|
+
},
|
|
12577
|
+
"delete-quota": {
|
|
12578
|
+
serviceClass: "Quotas",
|
|
12579
|
+
operationId: "deleteQuota",
|
|
12580
|
+
description: "Deletes a quota and drops its window counters",
|
|
12581
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/quotas",
|
|
12582
|
+
httpMethod: "delete",
|
|
12583
|
+
pathParams: ["project_id", "quota_id"],
|
|
12584
|
+
queryParams: [],
|
|
12585
|
+
flags: [{
|
|
12586
|
+
"name": "project_id",
|
|
12587
|
+
"description": "Project public ID (proj_ prefix).",
|
|
12588
|
+
"required": true,
|
|
12589
|
+
"type": "string",
|
|
12590
|
+
"in": "path"
|
|
12591
|
+
}, {
|
|
12592
|
+
"name": "quota_id",
|
|
12593
|
+
"description": "Quota ID",
|
|
12594
|
+
"required": true,
|
|
12595
|
+
"type": "string",
|
|
12596
|
+
"in": "path"
|
|
12597
|
+
}]
|
|
12598
|
+
},
|
|
12079
12599
|
"list-secrets": {
|
|
12080
12600
|
serviceClass: "Secrets",
|
|
12081
12601
|
operationId: "listSecrets",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.77.0",
|
|
4
4
|
"description": "Command-line interface for the naturali.ai API, generated from its OpenAPI specs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tsx": "^4.23.1",
|
|
31
31
|
"typescript": "~6.0.3",
|
|
32
32
|
"vitest": "^4.1.10",
|
|
33
|
-
"@naturali/sdk": "0.
|
|
33
|
+
"@naturali/sdk": "0.77.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"generate": "tsx scripts/generate.ts",
|