@soat/sdk 0.104.0 → 0.105.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
@@ -4350,9 +4350,9 @@ var Playbooks = class {
4350
4350
  };
4351
4351
  var Policies = class {
4352
4352
  /**
4353
- * List all policies
4353
+ * List policies
4354
4354
  *
4355
- * Returns global policies. Requires admin role. Pass user_id to list only the policies attached to that user.
4355
+ * 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.
4356
4356
  *
4357
4357
  */
4358
4358
  static listPolicies(options) {
@@ -4364,7 +4364,7 @@ var Policies = class {
4364
4364
  /**
4365
4365
  * Create a policy
4366
4366
  *
4367
- * Creates a new global policy. Requires admin role.
4367
+ * 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.
4368
4368
  */
4369
4369
  static createPolicy(options) {
4370
4370
  return (options.client ?? client).post({
@@ -4379,7 +4379,7 @@ var Policies = class {
4379
4379
  /**
4380
4380
  * Delete a policy
4381
4381
  *
4382
- * Deletes a global policy. Requires admin role. Refused with `409 POLICY_HAS_DEPENDENTS` while a trigger, agent or webhook names it in its `policy_ids`.
4382
+ * 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`.
4383
4383
  */
4384
4384
  static deletePolicy(options) {
4385
4385
  return (options.client ?? client).delete({
@@ -4390,7 +4390,7 @@ var Policies = class {
4390
4390
  /**
4391
4391
  * Get a policy
4392
4392
  *
4393
- * Returns details of a specific policy. Requires admin role.
4393
+ * Returns a policy. A project policy needs `policies:GetPolicy` in its project; a global one, the unrestricted admin.
4394
4394
  */
4395
4395
  static getPolicy(options) {
4396
4396
  return (options.client ?? client).get({
@@ -4401,7 +4401,7 @@ var Policies = class {
4401
4401
  /**
4402
4402
  * Update a policy
4403
4403
  *
4404
- * Updates an existing global policy. Requires admin role.
4404
+ * 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.
4405
4405
  */
4406
4406
  static updatePolicy(options) {
4407
4407
  return (options.client ?? client).put({
package/dist/index.d.cts CHANGED
@@ -6944,6 +6944,10 @@ type PolicyRecord = {
6944
6944
  * Public policy ID (pol_ prefix)
6945
6945
  */
6946
6946
  id?: string;
6947
+ /**
6948
+ * The project the policy belongs to; `null` for a global policy.
6949
+ */
6950
+ project_id?: string | null;
6947
6951
  name?: string | null;
6948
6952
  description?: string | null;
6949
6953
  document?: PolicyDocument;
@@ -24293,6 +24297,10 @@ type ListPoliciesData = {
24293
24297
  body?: never;
24294
24298
  path?: never;
24295
24299
  query?: {
24300
+ /**
24301
+ * List only this project's policies (proj_...)
24302
+ */
24303
+ project_id?: string;
24296
24304
  /**
24297
24305
  * Return only policies attached to this user (user_...)
24298
24306
  */
@@ -24318,7 +24326,7 @@ type ListPoliciesErrors = {
24318
24326
  */
24319
24327
  401: ErrorResponse;
24320
24328
  /**
24321
- * Forbidden (non-admin user)
24329
+ * Forbidden: the caller may not list policies in the project, or lists global policies without being the unrestricted admin
24322
24330
  */
24323
24331
  403: ErrorResponse;
24324
24332
  /**
@@ -24342,6 +24350,10 @@ type ListPoliciesResponses = {
24342
24350
  type ListPoliciesResponse = ListPoliciesResponses[keyof ListPoliciesResponses];
24343
24351
  type CreatePolicyData = {
24344
24352
  body: {
24353
+ /**
24354
+ * The project the policy belongs to (proj_...). Defaults to a project-scoped credential's own project; omitted otherwise, the policy is global.
24355
+ */
24356
+ project_id?: string;
24345
24357
  name?: string;
24346
24358
  description?: string;
24347
24359
  document: PolicyDocument;
@@ -24352,7 +24364,7 @@ type CreatePolicyData = {
24352
24364
  };
24353
24365
  type CreatePolicyErrors = {
24354
24366
  /**
24355
- * Bad request (invalid policy document)
24367
+ * Bad request: an invalid policy document, or an `Allow` resource outside the policy's project
24356
24368
  */
24357
24369
  400: ErrorResponse;
24358
24370
  /**
@@ -24360,7 +24372,7 @@ type CreatePolicyErrors = {
24360
24372
  */
24361
24373
  401: ErrorResponse;
24362
24374
  /**
24363
- * Forbidden (non-admin user)
24375
+ * Forbidden (the caller may not act on this policy)
24364
24376
  */
24365
24377
  403: ErrorResponse;
24366
24378
  /**
@@ -24405,7 +24417,7 @@ type DeletePolicyErrors = {
24405
24417
  */
24406
24418
  401: ErrorResponse;
24407
24419
  /**
24408
- * Forbidden (non-admin user)
24420
+ * Forbidden (the caller may not act on this policy)
24409
24421
  */
24410
24422
  403: ErrorResponse;
24411
24423
  /**
@@ -24454,7 +24466,7 @@ type GetPolicyErrors = {
24454
24466
  */
24455
24467
  401: ErrorResponse;
24456
24468
  /**
24457
- * Forbidden (non-admin user)
24469
+ * Forbidden (the caller may not act on this policy)
24458
24470
  */
24459
24471
  403: ErrorResponse;
24460
24472
  /**
@@ -24495,7 +24507,7 @@ type UpdatePolicyData = {
24495
24507
  };
24496
24508
  type UpdatePolicyErrors = {
24497
24509
  /**
24498
- * Bad request (invalid policy document)
24510
+ * Bad request: an invalid policy document, or an `Allow` resource outside the policy's project
24499
24511
  */
24500
24512
  400: ErrorResponse;
24501
24513
  /**
@@ -24503,7 +24515,7 @@ type UpdatePolicyErrors = {
24503
24515
  */
24504
24516
  401: ErrorResponse;
24505
24517
  /**
24506
- * Forbidden (non-admin user)
24518
+ * Forbidden (the caller may not act on this policy)
24507
24519
  */
24508
24520
  403: ErrorResponse;
24509
24521
  /**
@@ -32307,34 +32319,34 @@ export declare class Playbooks {
32307
32319
  }
32308
32320
  export declare class Policies {
32309
32321
  /**
32310
- * List all policies
32322
+ * List policies
32311
32323
  *
32312
- * Returns global policies. Requires admin role. Pass user_id to list only the policies attached to that user.
32324
+ * 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.
32313
32325
  *
32314
32326
  */
32315
32327
  static listPolicies<ThrowOnError extends boolean = false>(options?: Options<ListPoliciesData, ThrowOnError>): RequestResult<ListPoliciesResponses, ListPoliciesErrors, ThrowOnError>;
32316
32328
  /**
32317
32329
  * Create a policy
32318
32330
  *
32319
- * Creates a new global policy. Requires admin role.
32331
+ * 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.
32320
32332
  */
32321
32333
  static createPolicy<ThrowOnError extends boolean = false>(options: Options<CreatePolicyData, ThrowOnError>): RequestResult<CreatePolicyResponses, CreatePolicyErrors, ThrowOnError>;
32322
32334
  /**
32323
32335
  * Delete a policy
32324
32336
  *
32325
- * Deletes a global policy. Requires admin role. Refused with `409 POLICY_HAS_DEPENDENTS` while a trigger, agent or webhook names it in its `policy_ids`.
32337
+ * 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`.
32326
32338
  */
32327
32339
  static deletePolicy<ThrowOnError extends boolean = false>(options: Options<DeletePolicyData, ThrowOnError>): RequestResult<DeletePolicyResponses, DeletePolicyErrors, ThrowOnError>;
32328
32340
  /**
32329
32341
  * Get a policy
32330
32342
  *
32331
- * Returns details of a specific policy. Requires admin role.
32343
+ * Returns a policy. A project policy needs `policies:GetPolicy` in its project; a global one, the unrestricted admin.
32332
32344
  */
32333
32345
  static getPolicy<ThrowOnError extends boolean = false>(options: Options<GetPolicyData, ThrowOnError>): RequestResult<GetPolicyResponses, GetPolicyErrors, ThrowOnError>;
32334
32346
  /**
32335
32347
  * Update a policy
32336
32348
  *
32337
- * Updates an existing global policy. Requires admin role.
32349
+ * 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.
32338
32350
  */
32339
32351
  static updatePolicy<ThrowOnError extends boolean = false>(options: Options<UpdatePolicyData, ThrowOnError>): RequestResult<UpdatePolicyResponses, UpdatePolicyErrors, ThrowOnError>;
32340
32352
  }
package/dist/index.d.mts CHANGED
@@ -6944,6 +6944,10 @@ type PolicyRecord = {
6944
6944
  * Public policy ID (pol_ prefix)
6945
6945
  */
6946
6946
  id?: string;
6947
+ /**
6948
+ * The project the policy belongs to; `null` for a global policy.
6949
+ */
6950
+ project_id?: string | null;
6947
6951
  name?: string | null;
6948
6952
  description?: string | null;
6949
6953
  document?: PolicyDocument;
@@ -24293,6 +24297,10 @@ type ListPoliciesData = {
24293
24297
  body?: never;
24294
24298
  path?: never;
24295
24299
  query?: {
24300
+ /**
24301
+ * List only this project's policies (proj_...)
24302
+ */
24303
+ project_id?: string;
24296
24304
  /**
24297
24305
  * Return only policies attached to this user (user_...)
24298
24306
  */
@@ -24318,7 +24326,7 @@ type ListPoliciesErrors = {
24318
24326
  */
24319
24327
  401: ErrorResponse;
24320
24328
  /**
24321
- * Forbidden (non-admin user)
24329
+ * Forbidden: the caller may not list policies in the project, or lists global policies without being the unrestricted admin
24322
24330
  */
24323
24331
  403: ErrorResponse;
24324
24332
  /**
@@ -24342,6 +24350,10 @@ type ListPoliciesResponses = {
24342
24350
  type ListPoliciesResponse = ListPoliciesResponses[keyof ListPoliciesResponses];
24343
24351
  type CreatePolicyData = {
24344
24352
  body: {
24353
+ /**
24354
+ * The project the policy belongs to (proj_...). Defaults to a project-scoped credential's own project; omitted otherwise, the policy is global.
24355
+ */
24356
+ project_id?: string;
24345
24357
  name?: string;
24346
24358
  description?: string;
24347
24359
  document: PolicyDocument;
@@ -24352,7 +24364,7 @@ type CreatePolicyData = {
24352
24364
  };
24353
24365
  type CreatePolicyErrors = {
24354
24366
  /**
24355
- * Bad request (invalid policy document)
24367
+ * Bad request: an invalid policy document, or an `Allow` resource outside the policy's project
24356
24368
  */
24357
24369
  400: ErrorResponse;
24358
24370
  /**
@@ -24360,7 +24372,7 @@ type CreatePolicyErrors = {
24360
24372
  */
24361
24373
  401: ErrorResponse;
24362
24374
  /**
24363
- * Forbidden (non-admin user)
24375
+ * Forbidden (the caller may not act on this policy)
24364
24376
  */
24365
24377
  403: ErrorResponse;
24366
24378
  /**
@@ -24405,7 +24417,7 @@ type DeletePolicyErrors = {
24405
24417
  */
24406
24418
  401: ErrorResponse;
24407
24419
  /**
24408
- * Forbidden (non-admin user)
24420
+ * Forbidden (the caller may not act on this policy)
24409
24421
  */
24410
24422
  403: ErrorResponse;
24411
24423
  /**
@@ -24454,7 +24466,7 @@ type GetPolicyErrors = {
24454
24466
  */
24455
24467
  401: ErrorResponse;
24456
24468
  /**
24457
- * Forbidden (non-admin user)
24469
+ * Forbidden (the caller may not act on this policy)
24458
24470
  */
24459
24471
  403: ErrorResponse;
24460
24472
  /**
@@ -24495,7 +24507,7 @@ type UpdatePolicyData = {
24495
24507
  };
24496
24508
  type UpdatePolicyErrors = {
24497
24509
  /**
24498
- * Bad request (invalid policy document)
24510
+ * Bad request: an invalid policy document, or an `Allow` resource outside the policy's project
24499
24511
  */
24500
24512
  400: ErrorResponse;
24501
24513
  /**
@@ -24503,7 +24515,7 @@ type UpdatePolicyErrors = {
24503
24515
  */
24504
24516
  401: ErrorResponse;
24505
24517
  /**
24506
- * Forbidden (non-admin user)
24518
+ * Forbidden (the caller may not act on this policy)
24507
24519
  */
24508
24520
  403: ErrorResponse;
24509
24521
  /**
@@ -32307,34 +32319,34 @@ export declare class Playbooks {
32307
32319
  }
32308
32320
  export declare class Policies {
32309
32321
  /**
32310
- * List all policies
32322
+ * List policies
32311
32323
  *
32312
- * Returns global policies. Requires admin role. Pass user_id to list only the policies attached to that user.
32324
+ * 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.
32313
32325
  *
32314
32326
  */
32315
32327
  static listPolicies<ThrowOnError extends boolean = false>(options?: Options<ListPoliciesData, ThrowOnError>): RequestResult<ListPoliciesResponses, ListPoliciesErrors, ThrowOnError>;
32316
32328
  /**
32317
32329
  * Create a policy
32318
32330
  *
32319
- * Creates a new global policy. Requires admin role.
32331
+ * 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.
32320
32332
  */
32321
32333
  static createPolicy<ThrowOnError extends boolean = false>(options: Options<CreatePolicyData, ThrowOnError>): RequestResult<CreatePolicyResponses, CreatePolicyErrors, ThrowOnError>;
32322
32334
  /**
32323
32335
  * Delete a policy
32324
32336
  *
32325
- * Deletes a global policy. Requires admin role. Refused with `409 POLICY_HAS_DEPENDENTS` while a trigger, agent or webhook names it in its `policy_ids`.
32337
+ * 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`.
32326
32338
  */
32327
32339
  static deletePolicy<ThrowOnError extends boolean = false>(options: Options<DeletePolicyData, ThrowOnError>): RequestResult<DeletePolicyResponses, DeletePolicyErrors, ThrowOnError>;
32328
32340
  /**
32329
32341
  * Get a policy
32330
32342
  *
32331
- * Returns details of a specific policy. Requires admin role.
32343
+ * Returns a policy. A project policy needs `policies:GetPolicy` in its project; a global one, the unrestricted admin.
32332
32344
  */
32333
32345
  static getPolicy<ThrowOnError extends boolean = false>(options: Options<GetPolicyData, ThrowOnError>): RequestResult<GetPolicyResponses, GetPolicyErrors, ThrowOnError>;
32334
32346
  /**
32335
32347
  * Update a policy
32336
32348
  *
32337
- * Updates an existing global policy. Requires admin role.
32349
+ * 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.
32338
32350
  */
32339
32351
  static updatePolicy<ThrowOnError extends boolean = false>(options: Options<UpdatePolicyData, ThrowOnError>): RequestResult<UpdatePolicyResponses, UpdatePolicyErrors, ThrowOnError>;
32340
32352
  }
package/dist/index.mjs CHANGED
@@ -4349,9 +4349,9 @@ var Playbooks = class {
4349
4349
  };
4350
4350
  var Policies = class {
4351
4351
  /**
4352
- * List all policies
4352
+ * List policies
4353
4353
  *
4354
- * Returns global policies. Requires admin role. Pass user_id to list only the policies attached to that user.
4354
+ * 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.
4355
4355
  *
4356
4356
  */
4357
4357
  static listPolicies(options) {
@@ -4363,7 +4363,7 @@ var Policies = class {
4363
4363
  /**
4364
4364
  * Create a policy
4365
4365
  *
4366
- * Creates a new global policy. Requires admin role.
4366
+ * 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.
4367
4367
  */
4368
4368
  static createPolicy(options) {
4369
4369
  return (options.client ?? client).post({
@@ -4378,7 +4378,7 @@ var Policies = class {
4378
4378
  /**
4379
4379
  * Delete a policy
4380
4380
  *
4381
- * Deletes a global policy. Requires admin role. Refused with `409 POLICY_HAS_DEPENDENTS` while a trigger, agent or webhook names it in its `policy_ids`.
4381
+ * 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`.
4382
4382
  */
4383
4383
  static deletePolicy(options) {
4384
4384
  return (options.client ?? client).delete({
@@ -4389,7 +4389,7 @@ var Policies = class {
4389
4389
  /**
4390
4390
  * Get a policy
4391
4391
  *
4392
- * Returns details of a specific policy. Requires admin role.
4392
+ * Returns a policy. A project policy needs `policies:GetPolicy` in its project; a global one, the unrestricted admin.
4393
4393
  */
4394
4394
  static getPolicy(options) {
4395
4395
  return (options.client ?? client).get({
@@ -4400,7 +4400,7 @@ var Policies = class {
4400
4400
  /**
4401
4401
  * Update a policy
4402
4402
  *
4403
- * Updates an existing global policy. Requires admin role.
4403
+ * 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.
4404
4404
  */
4405
4405
  static updatePolicy(options) {
4406
4406
  return (options.client ?? client).put({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/sdk",
3
- "version": "0.104.0",
3
+ "version": "0.105.0",
4
4
  "description": "TypeScript SDK for SOAT — open-source infrastructure for production-ready AI agents.",
5
5
  "keywords": [
6
6
  "ai-agents",