@naturali/sdk 0.301.0 → 0.302.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 +79 -5
- package/dist/index.d.cts +337 -10
- package/dist/index.d.mts +337 -10
- package/dist/index.mjs +79 -5
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -5322,7 +5322,7 @@ var Policies = class {
|
|
|
5322
5322
|
/**
|
|
5323
5323
|
* List policies
|
|
5324
5324
|
*
|
|
5325
|
-
* Returns the policies of the project `project_id` names, or of the project a project-scoped credential is bound to. Without
|
|
5325
|
+
* Returns the policies of the project `project_id` names, or of the project a project-scoped credential is bound to. `project_group_id` lists that project group's policies instead, which needs `project-groups:ListPolicies` on `srn:project-group:<project_group_id>:policy*`. Without any, the unrestricted admin lists every policy, global, project and project group ones. Pass `user_id` (unrestricted admin only) to list only the policies attached to that user.
|
|
5326
5326
|
*
|
|
5327
5327
|
*/
|
|
5328
5328
|
static listPolicies(options) {
|
|
@@ -5334,7 +5334,7 @@ var Policies = class {
|
|
|
5334
5334
|
/**
|
|
5335
5335
|
* Create a policy
|
|
5336
5336
|
*
|
|
5337
|
-
* Creates a project policy when `project_id` is given or the credential is bound to a project: its `Allow` statements may name only that project's resources (`srn:<project_id>:<type>:<id>`), else `400`; an `Allow` without `resource` grants every resource of that project. Without a project, creates a global policy, which only the unrestricted admin may.
|
|
5337
|
+
* Creates a project policy when `project_id` is given or the credential is bound to a project: its `Allow` statements may name only that project's resources (`srn:<project_id>:<type>:<id>`), else `400`; an `Allow` without `resource` grants every resource of that project. With `project_group_id`, creates a project group policy, which needs `project-groups:CreatePolicy` on `srn:project-group:<project_group_id>:policy*`: its `Allow` statements may name only the project group's own resources (`srn:project-group:<project_group_id>:<type>/<id>`) and those of a project in it, else `400`; an `Allow` without `resource` grants a project group action on the project group and any other action on its projects, read when the policy is evaluated. Only the project group and its keys may carry it in `policy_ids`. Without a project or a project group, creates a global policy, which only the unrestricted admin may.
|
|
5338
5338
|
*/
|
|
5339
5339
|
static createPolicy(options) {
|
|
5340
5340
|
return (options.client ?? client).post({
|
|
@@ -5349,7 +5349,7 @@ var Policies = class {
|
|
|
5349
5349
|
/**
|
|
5350
5350
|
* Delete a policy
|
|
5351
5351
|
*
|
|
5352
|
-
* Deletes a policy. A project policy needs `policies:DeletePolicy` in its project; a global one, the unrestricted admin. Refused with `409 POLICY_HAS_DEPENDENTS` while a trigger, agent, webhook, user or API key names it in its `policy_ids`.
|
|
5352
|
+
* Deletes a policy. A project policy needs `policies:DeletePolicy` in its project; a project group policy, `project-groups:DeletePolicy` on `srn:project-group:<project_group_id>:policy/<policy_id>`; a global one, the unrestricted admin. Refused with `409 POLICY_HAS_DEPENDENTS` while a trigger, agent, webhook, user, project group or API key names it in its `policy_ids`.
|
|
5353
5353
|
*/
|
|
5354
5354
|
static deletePolicy(options) {
|
|
5355
5355
|
return (options.client ?? client).delete({
|
|
@@ -5360,7 +5360,7 @@ var Policies = class {
|
|
|
5360
5360
|
/**
|
|
5361
5361
|
* Get a policy
|
|
5362
5362
|
*
|
|
5363
|
-
* Returns a policy. A project policy needs `policies:GetPolicy` in its project; a global one, the unrestricted admin.
|
|
5363
|
+
* Returns a policy. A project policy needs `policies:GetPolicy` in its project; a project group policy, `project-groups:GetPolicy` on `srn:project-group:<project_group_id>:policy/<policy_id>`; a global one, the unrestricted admin.
|
|
5364
5364
|
*/
|
|
5365
5365
|
static getPolicy(options) {
|
|
5366
5366
|
return (options.client ?? client).get({
|
|
@@ -5371,7 +5371,7 @@ var Policies = class {
|
|
|
5371
5371
|
/**
|
|
5372
5372
|
* Update a policy
|
|
5373
5373
|
*
|
|
5374
|
-
* Updates a policy. A project policy needs `policies:UpdatePolicy` in its project and its `Allow` statements stay within that project; a global one, the unrestricted admin. The project never changes.
|
|
5374
|
+
* Updates a policy. A project policy needs `policies:UpdatePolicy` in its project and its `Allow` statements stay within that project; a project group policy, `project-groups:UpdatePolicy` on `srn:project-group:<project_group_id>:policy/<policy_id>`, and its `Allow` statements stay within the project group; a global one, the unrestricted admin. The project or project group never changes.
|
|
5375
5375
|
*/
|
|
5376
5376
|
static updatePolicy(options) {
|
|
5377
5377
|
return (options.client ?? client).put({
|
|
@@ -5383,6 +5383,80 @@ var Policies = class {
|
|
|
5383
5383
|
}
|
|
5384
5384
|
});
|
|
5385
5385
|
}
|
|
5386
|
+
/**
|
|
5387
|
+
* List policies
|
|
5388
|
+
*
|
|
5389
|
+
* Acts on the caller's account: the account's project group is the one addressed, never named in the request.
|
|
5390
|
+
*
|
|
5391
|
+
* Returns the policies of the project `project_id` names, or of the project a project-scoped credential is bound to. `project_group_id` lists that project group's policies instead, which needs `project-groups:ListPolicies` on `srn:project-group:<project_group_id>:policy*`. Without any, the unrestricted admin lists every policy, global, project and project group ones. Pass `user_id` (unrestricted admin only) to list only the policies attached to that user.
|
|
5392
|
+
*
|
|
5393
|
+
*/
|
|
5394
|
+
static listAccountPolicies(options) {
|
|
5395
|
+
return (options?.client ?? client).get({
|
|
5396
|
+
url: "/v1/account/policies",
|
|
5397
|
+
...options
|
|
5398
|
+
});
|
|
5399
|
+
}
|
|
5400
|
+
/**
|
|
5401
|
+
* Create a policy
|
|
5402
|
+
*
|
|
5403
|
+
* Acts on the caller's account: the account's project group is the one addressed, never named in the request.
|
|
5404
|
+
*
|
|
5405
|
+
* Creates a project policy when `project_id` is given or the credential is bound to a project: its `Allow` statements may name only that project's resources (`srn:<project_id>:<type>:<id>`), else `400`; an `Allow` without `resource` grants every resource of that project. With `project_group_id`, creates a project group policy, which needs `project-groups:CreatePolicy` on `srn:project-group:<project_group_id>:policy*`: its `Allow` statements may name only the project group's own resources (`srn:project-group:<project_group_id>:<type>/<id>`) and those of a project in it, else `400`; an `Allow` without `resource` grants a project group action on the project group and any other action on its projects, read when the policy is evaluated. Only the project group and its keys may carry it in `policy_ids`. Without a project or a project group, creates a global policy, which only the unrestricted admin may.
|
|
5406
|
+
*/
|
|
5407
|
+
static createAccountPolicy(options) {
|
|
5408
|
+
return (options.client ?? client).post({
|
|
5409
|
+
url: "/v1/account/policies",
|
|
5410
|
+
...options,
|
|
5411
|
+
headers: {
|
|
5412
|
+
"Content-Type": "application/json",
|
|
5413
|
+
...options.headers
|
|
5414
|
+
}
|
|
5415
|
+
});
|
|
5416
|
+
}
|
|
5417
|
+
/**
|
|
5418
|
+
* Delete a policy
|
|
5419
|
+
*
|
|
5420
|
+
* Acts on the caller's account: the account's project group is the one addressed, never named in the request.
|
|
5421
|
+
*
|
|
5422
|
+
* Deletes a policy. A project policy needs `policies:DeletePolicy` in its project; a project group policy, `project-groups:DeletePolicy` on `srn:project-group:<project_group_id>:policy/<policy_id>`; a global one, the unrestricted admin. Refused with `409 POLICY_HAS_DEPENDENTS` while a trigger, agent, webhook, user, project group or API key names it in its `policy_ids`.
|
|
5423
|
+
*/
|
|
5424
|
+
static deleteAccountPolicy(options) {
|
|
5425
|
+
return (options.client ?? client).delete({
|
|
5426
|
+
url: "/v1/account/policies/{policy_id}",
|
|
5427
|
+
...options
|
|
5428
|
+
});
|
|
5429
|
+
}
|
|
5430
|
+
/**
|
|
5431
|
+
* Get a policy
|
|
5432
|
+
*
|
|
5433
|
+
* Acts on the caller's account: the account's project group is the one addressed, never named in the request.
|
|
5434
|
+
*
|
|
5435
|
+
* Returns a policy. A project policy needs `policies:GetPolicy` in its project; a project group policy, `project-groups:GetPolicy` on `srn:project-group:<project_group_id>:policy/<policy_id>`; a global one, the unrestricted admin.
|
|
5436
|
+
*/
|
|
5437
|
+
static getAccountPolicy(options) {
|
|
5438
|
+
return (options.client ?? client).get({
|
|
5439
|
+
url: "/v1/account/policies/{policy_id}",
|
|
5440
|
+
...options
|
|
5441
|
+
});
|
|
5442
|
+
}
|
|
5443
|
+
/**
|
|
5444
|
+
* Update a policy
|
|
5445
|
+
*
|
|
5446
|
+
* Acts on the caller's account: the account's project group is the one addressed, never named in the request.
|
|
5447
|
+
*
|
|
5448
|
+
* Updates a policy. A project policy needs `policies:UpdatePolicy` in its project and its `Allow` statements stay within that project; a project group policy, `project-groups:UpdatePolicy` on `srn:project-group:<project_group_id>:policy/<policy_id>`, and its `Allow` statements stay within the project group; a global one, the unrestricted admin. The project or project group never changes.
|
|
5449
|
+
*/
|
|
5450
|
+
static updateAccountPolicy(options) {
|
|
5451
|
+
return (options.client ?? client).put({
|
|
5452
|
+
url: "/v1/account/policies/{policy_id}",
|
|
5453
|
+
...options,
|
|
5454
|
+
headers: {
|
|
5455
|
+
"Content-Type": "application/json",
|
|
5456
|
+
...options.headers
|
|
5457
|
+
}
|
|
5458
|
+
});
|
|
5459
|
+
}
|
|
5386
5460
|
};
|
|
5387
5461
|
var Projects = class {
|
|
5388
5462
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.302.0",
|
|
4
4
|
"description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"naturali",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@hey-api/openapi-ts": "^0.99.0",
|
|
41
|
-
"@naturali/api": "0.
|
|
41
|
+
"@naturali/api": "0.302.0",
|
|
42
42
|
"@ttoss/openapi-codegen": "^0.10.1",
|
|
43
43
|
"@types/node": "^26.5.1",
|
|
44
44
|
"tsdown": "^0.23.0",
|