@naturali/sdk 0.232.0 → 0.233.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
@@ -5296,6 +5296,72 @@ var Playbooks = class {
5296
5296
  });
5297
5297
  }
5298
5298
  };
5299
+ var Policies = class {
5300
+ /**
5301
+ * List policies
5302
+ *
5303
+ * 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.
5304
+ *
5305
+ */
5306
+ static listPolicies(options) {
5307
+ return (options.client ?? client).get({
5308
+ url: "/v1/projects/{project_id}/policies",
5309
+ ...options
5310
+ });
5311
+ }
5312
+ /**
5313
+ * Create a policy
5314
+ *
5315
+ * 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`. Without a project, creates a global policy, which only the unrestricted admin may.
5316
+ */
5317
+ static createPolicy(options) {
5318
+ return (options.client ?? client).post({
5319
+ url: "/v1/projects/{project_id}/policies",
5320
+ ...options,
5321
+ headers: {
5322
+ "Content-Type": "application/json",
5323
+ ...options.headers
5324
+ }
5325
+ });
5326
+ }
5327
+ /**
5328
+ * Delete a policy
5329
+ *
5330
+ * 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 or webhook names it in its `policy_ids`.
5331
+ */
5332
+ static deletePolicy(options) {
5333
+ return (options.client ?? client).delete({
5334
+ url: "/v1/projects/{project_id}/policies/{policy_id}",
5335
+ ...options
5336
+ });
5337
+ }
5338
+ /**
5339
+ * Get a policy
5340
+ *
5341
+ * Returns a policy. A project policy needs `policies:GetPolicy` in its project; a global one, the unrestricted admin.
5342
+ */
5343
+ static getPolicy(options) {
5344
+ return (options.client ?? client).get({
5345
+ url: "/v1/projects/{project_id}/policies/{policy_id}",
5346
+ ...options
5347
+ });
5348
+ }
5349
+ /**
5350
+ * Update a policy
5351
+ *
5352
+ * 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.
5353
+ */
5354
+ static updatePolicy(options) {
5355
+ return (options.client ?? client).put({
5356
+ url: "/v1/projects/{project_id}/policies/{policy_id}",
5357
+ ...options,
5358
+ headers: {
5359
+ "Content-Type": "application/json",
5360
+ ...options.headers
5361
+ }
5362
+ });
5363
+ }
5364
+ };
5299
5365
  var Projects = class {
5300
5366
  /**
5301
5367
  * List projects
@@ -6175,6 +6241,8 @@ var Tools = class {
6175
6241
  *
6176
6242
  * A credential scoped to a project the tool is shared with, through an accepted share, calls it in that project: the calling project's guardrails adjudicate it, it is metered there with `publisher_project_id`, and the tool receives the calling project as the `calling_project_id` tool context key.
6177
6243
  *
6244
+ * `actor_id` runs the call for an actor without a session or a generation, such as a scheduled sync reading each user's own data through their OAuth connection.
6245
+ *
6178
6246
  */
6179
6247
  static callTool(options) {
6180
6248
  return (options.client ?? client).post({
@@ -7017,6 +7085,7 @@ var NaturaliClient = class {
7017
7085
  models;
7018
7086
  orchestrations;
7019
7087
  playbooks;
7088
+ policies;
7020
7089
  projects;
7021
7090
  secrets;
7022
7091
  sessions;
@@ -7077,6 +7146,7 @@ var NaturaliClient = class {
7077
7146
  this.models = bindResource(Models, this.http);
7078
7147
  this.orchestrations = bindResource(Orchestrations, this.http);
7079
7148
  this.playbooks = bindResource(Playbooks, this.http);
7149
+ this.policies = bindResource(Policies, this.http);
7080
7150
  this.projects = bindResource(Projects, this.http);
7081
7151
  this.secrets = bindResource(Secrets, this.http);
7082
7152
  this.sessions = bindResource(Sessions, this.http);
@@ -7130,6 +7200,7 @@ exports.OauthClients = OauthClients;
7130
7200
  exports.OauthConnections = OauthConnections;
7131
7201
  exports.Orchestrations = Orchestrations;
7132
7202
  exports.Playbooks = Playbooks;
7203
+ exports.Policies = Policies;
7133
7204
  exports.Projects = Projects;
7134
7205
  exports.Quotas = Quotas;
7135
7206
  exports.Secrets = Secrets;