@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 CHANGED
@@ -5323,7 +5323,7 @@ var Policies = class {
5323
5323
  /**
5324
5324
  * List policies
5325
5325
  *
5326
- * Returns the policies of the project `project_id` names, or of the project a project-scoped credential is bound to. Without either, the unrestricted admin lists every policy, global and project ones. Pass `user_id` (unrestricted admin only) to list only the policies attached to that user.
5326
+ * 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.
5327
5327
  *
5328
5328
  */
5329
5329
  static listPolicies(options) {
@@ -5335,7 +5335,7 @@ var Policies = class {
5335
5335
  /**
5336
5336
  * Create a policy
5337
5337
  *
5338
- * 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.
5338
+ * 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.
5339
5339
  */
5340
5340
  static createPolicy(options) {
5341
5341
  return (options.client ?? client).post({
@@ -5350,7 +5350,7 @@ var Policies = class {
5350
5350
  /**
5351
5351
  * Delete a policy
5352
5352
  *
5353
- * 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`.
5353
+ * 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`.
5354
5354
  */
5355
5355
  static deletePolicy(options) {
5356
5356
  return (options.client ?? client).delete({
@@ -5361,7 +5361,7 @@ var Policies = class {
5361
5361
  /**
5362
5362
  * Get a policy
5363
5363
  *
5364
- * Returns a policy. A project policy needs `policies:GetPolicy` in its project; a global one, the unrestricted admin.
5364
+ * 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.
5365
5365
  */
5366
5366
  static getPolicy(options) {
5367
5367
  return (options.client ?? client).get({
@@ -5372,7 +5372,7 @@ var Policies = class {
5372
5372
  /**
5373
5373
  * Update a policy
5374
5374
  *
5375
- * 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.
5375
+ * 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.
5376
5376
  */
5377
5377
  static updatePolicy(options) {
5378
5378
  return (options.client ?? client).put({
@@ -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
  /**