@naturali/sdk 0.301.1 → 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 +74 -0
- package/dist/index.d.cts +316 -1
- package/dist/index.d.mts +316 -1
- package/dist/index.mjs +74 -0
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -5384,6 +5384,80 @@ var Policies = class {
|
|
|
5384
5384
|
}
|
|
5385
5385
|
});
|
|
5386
5386
|
}
|
|
5387
|
+
/**
|
|
5388
|
+
* List policies
|
|
5389
|
+
*
|
|
5390
|
+
* Acts on the caller's account: the account's project group is the one addressed, never named in the request.
|
|
5391
|
+
*
|
|
5392
|
+
* 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.
|
|
5393
|
+
*
|
|
5394
|
+
*/
|
|
5395
|
+
static listAccountPolicies(options) {
|
|
5396
|
+
return (options?.client ?? client).get({
|
|
5397
|
+
url: "/v1/account/policies",
|
|
5398
|
+
...options
|
|
5399
|
+
});
|
|
5400
|
+
}
|
|
5401
|
+
/**
|
|
5402
|
+
* Create a policy
|
|
5403
|
+
*
|
|
5404
|
+
* Acts on the caller's account: the account's project group is the one addressed, never named in the request.
|
|
5405
|
+
*
|
|
5406
|
+
* 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.
|
|
5407
|
+
*/
|
|
5408
|
+
static createAccountPolicy(options) {
|
|
5409
|
+
return (options.client ?? client).post({
|
|
5410
|
+
url: "/v1/account/policies",
|
|
5411
|
+
...options,
|
|
5412
|
+
headers: {
|
|
5413
|
+
"Content-Type": "application/json",
|
|
5414
|
+
...options.headers
|
|
5415
|
+
}
|
|
5416
|
+
});
|
|
5417
|
+
}
|
|
5418
|
+
/**
|
|
5419
|
+
* Delete a policy
|
|
5420
|
+
*
|
|
5421
|
+
* Acts on the caller's account: the account's project group is the one addressed, never named in the request.
|
|
5422
|
+
*
|
|
5423
|
+
* 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`.
|
|
5424
|
+
*/
|
|
5425
|
+
static deleteAccountPolicy(options) {
|
|
5426
|
+
return (options.client ?? client).delete({
|
|
5427
|
+
url: "/v1/account/policies/{policy_id}",
|
|
5428
|
+
...options
|
|
5429
|
+
});
|
|
5430
|
+
}
|
|
5431
|
+
/**
|
|
5432
|
+
* Get a policy
|
|
5433
|
+
*
|
|
5434
|
+
* Acts on the caller's account: the account's project group is the one addressed, never named in the request.
|
|
5435
|
+
*
|
|
5436
|
+
* 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.
|
|
5437
|
+
*/
|
|
5438
|
+
static getAccountPolicy(options) {
|
|
5439
|
+
return (options.client ?? client).get({
|
|
5440
|
+
url: "/v1/account/policies/{policy_id}",
|
|
5441
|
+
...options
|
|
5442
|
+
});
|
|
5443
|
+
}
|
|
5444
|
+
/**
|
|
5445
|
+
* Update a policy
|
|
5446
|
+
*
|
|
5447
|
+
* Acts on the caller's account: the account's project group is the one addressed, never named in the request.
|
|
5448
|
+
*
|
|
5449
|
+
* 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.
|
|
5450
|
+
*/
|
|
5451
|
+
static updateAccountPolicy(options) {
|
|
5452
|
+
return (options.client ?? client).put({
|
|
5453
|
+
url: "/v1/account/policies/{policy_id}",
|
|
5454
|
+
...options,
|
|
5455
|
+
headers: {
|
|
5456
|
+
"Content-Type": "application/json",
|
|
5457
|
+
...options.headers
|
|
5458
|
+
}
|
|
5459
|
+
});
|
|
5460
|
+
}
|
|
5387
5461
|
};
|
|
5388
5462
|
var Projects = class {
|
|
5389
5463
|
/**
|