@naturali/sdk 0.232.1 → 0.233.1

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
@@ -5295,6 +5295,72 @@ var Playbooks = class {
5295
5295
  });
5296
5296
  }
5297
5297
  };
5298
+ var Policies = class {
5299
+ /**
5300
+ * List policies
5301
+ *
5302
+ * 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.
5303
+ *
5304
+ */
5305
+ static listPolicies(options) {
5306
+ return (options.client ?? client).get({
5307
+ url: "/v1/projects/{project_id}/policies",
5308
+ ...options
5309
+ });
5310
+ }
5311
+ /**
5312
+ * Create a policy
5313
+ *
5314
+ * 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.
5315
+ */
5316
+ static createPolicy(options) {
5317
+ return (options.client ?? client).post({
5318
+ url: "/v1/projects/{project_id}/policies",
5319
+ ...options,
5320
+ headers: {
5321
+ "Content-Type": "application/json",
5322
+ ...options.headers
5323
+ }
5324
+ });
5325
+ }
5326
+ /**
5327
+ * Delete a policy
5328
+ *
5329
+ * 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`.
5330
+ */
5331
+ static deletePolicy(options) {
5332
+ return (options.client ?? client).delete({
5333
+ url: "/v1/projects/{project_id}/policies/{policy_id}",
5334
+ ...options
5335
+ });
5336
+ }
5337
+ /**
5338
+ * Get a policy
5339
+ *
5340
+ * Returns a policy. A project policy needs `policies:GetPolicy` in its project; a global one, the unrestricted admin.
5341
+ */
5342
+ static getPolicy(options) {
5343
+ return (options.client ?? client).get({
5344
+ url: "/v1/projects/{project_id}/policies/{policy_id}",
5345
+ ...options
5346
+ });
5347
+ }
5348
+ /**
5349
+ * Update a policy
5350
+ *
5351
+ * 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.
5352
+ */
5353
+ static updatePolicy(options) {
5354
+ return (options.client ?? client).put({
5355
+ url: "/v1/projects/{project_id}/policies/{policy_id}",
5356
+ ...options,
5357
+ headers: {
5358
+ "Content-Type": "application/json",
5359
+ ...options.headers
5360
+ }
5361
+ });
5362
+ }
5363
+ };
5298
5364
  var Projects = class {
5299
5365
  /**
5300
5366
  * List projects
@@ -7018,6 +7084,7 @@ var NaturaliClient = class {
7018
7084
  models;
7019
7085
  orchestrations;
7020
7086
  playbooks;
7087
+ policies;
7021
7088
  projects;
7022
7089
  secrets;
7023
7090
  sessions;
@@ -7078,6 +7145,7 @@ var NaturaliClient = class {
7078
7145
  this.models = bindResource(Models, this.http);
7079
7146
  this.orchestrations = bindResource(Orchestrations, this.http);
7080
7147
  this.playbooks = bindResource(Playbooks, this.http);
7148
+ this.policies = bindResource(Policies, this.http);
7081
7149
  this.projects = bindResource(Projects, this.http);
7082
7150
  this.secrets = bindResource(Secrets, this.http);
7083
7151
  this.sessions = bindResource(Sessions, this.http);
@@ -7091,4 +7159,4 @@ var NaturaliClient = class {
7091
7159
  }
7092
7160
  };
7093
7161
  //#endregion
7094
- export { Activity, Actors, Admin, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, Assistant, AuditLog, Auth, Chains, Channels, Collections, Conversations, Deciders, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Installs, Knowledge, Listings, McpServers, Memories, MemoryRules, MemoryStores, MetadataSchemas, ModelRoutes, Models, NaturaliClient, OauthClients, OauthConnections, Orchestrations, Playbooks, Projects, Quotas, Secrets, Sessions, Tasks, Tools, Traces, Triggers, Users, Webhooks, Workflows, createClient, createConfig };
7162
+ export { Activity, Actors, Admin, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, Assistant, AuditLog, Auth, Chains, Channels, Collections, Conversations, Deciders, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Installs, Knowledge, Listings, McpServers, Memories, MemoryRules, MemoryStores, MetadataSchemas, ModelRoutes, Models, NaturaliClient, OauthClients, OauthConnections, Orchestrations, Playbooks, Policies, Projects, Quotas, Secrets, Sessions, Tasks, Tools, Traces, Triggers, Users, Webhooks, Workflows, createClient, createConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/sdk",
3
- "version": "0.232.1",
3
+ "version": "0.233.1",
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.232.1",
41
+ "@naturali/api": "0.233.1",
42
42
  "@ttoss/openapi-codegen": "^0.10.1",
43
43
  "@types/node": "^26.5.1",
44
44
  "tsdown": "^0.23.0",