@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.mjs CHANGED
@@ -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.301.1",
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.301.1",
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",