@soat/sdk 0.103.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
@@ -3599,6 +3599,132 @@ var ModelRoutes = class {
3599
3599
  });
3600
3600
  }
3601
3601
  };
3602
+ var OauthClients = class {
3603
+ /**
3604
+ * List OAuth clients
3605
+ *
3606
+ * Returns the OAuth clients of a project.
3607
+ */
3608
+ static listOauthClients(options) {
3609
+ return (options?.client ?? client).get({
3610
+ url: "/api/v1/oauth-clients",
3611
+ ...options
3612
+ });
3613
+ }
3614
+ /**
3615
+ * Create an OAuth client
3616
+ *
3617
+ * Registers your app at a provider. `client_secret` is a `{{secret:sec_...}}` reference, and the caller needs `secrets:UseSecret` on it.
3618
+ */
3619
+ static createOauthClient(options) {
3620
+ return (options.client ?? client).post({
3621
+ url: "/api/v1/oauth-clients",
3622
+ ...options,
3623
+ headers: {
3624
+ "Content-Type": "application/json",
3625
+ ...options.headers
3626
+ }
3627
+ });
3628
+ }
3629
+ /**
3630
+ * Delete an OAuth client
3631
+ *
3632
+ * Deletes the client and every connection made through it.
3633
+ */
3634
+ static deleteOauthClient(options) {
3635
+ return (options.client ?? client).delete({
3636
+ url: "/api/v1/oauth-clients/{oauth_client_id}",
3637
+ ...options
3638
+ });
3639
+ }
3640
+ /**
3641
+ * Get an OAuth client
3642
+ *
3643
+ * Returns the client; `client_secret` is its secret reference.
3644
+ */
3645
+ static getOauthClient(options) {
3646
+ return (options.client ?? client).get({
3647
+ url: "/api/v1/oauth-clients/{oauth_client_id}",
3648
+ ...options
3649
+ });
3650
+ }
3651
+ /**
3652
+ * Update an OAuth client
3653
+ *
3654
+ * Changes only the fields sent; `null` clears a nullable one.
3655
+ */
3656
+ static updateOauthClient(options) {
3657
+ return (options.client ?? client).patch({
3658
+ url: "/api/v1/oauth-clients/{oauth_client_id}",
3659
+ ...options,
3660
+ headers: {
3661
+ "Content-Type": "application/json",
3662
+ ...options.headers
3663
+ }
3664
+ });
3665
+ }
3666
+ };
3667
+ var OauthConnections = class {
3668
+ /**
3669
+ * List OAuth connections
3670
+ *
3671
+ * Returns a project's OAuth connections, without tokens.
3672
+ */
3673
+ static listOauthConnections(options) {
3674
+ return (options?.client ?? client).get({
3675
+ url: "/api/v1/oauth-connections",
3676
+ ...options
3677
+ });
3678
+ }
3679
+ /**
3680
+ * Start an OAuth connection
3681
+ *
3682
+ * Starts the authorization of an actor through an OAuth client and returns the `authorize_url` to send the person to; it is single-use and expires after 10 minutes. Starting again for the same actor and client restarts the same connection (`200`), and a connected one keeps its tokens until the new authorization completes. Hand the `authorize_url` only to the person the actor is: whoever consents connects their account to that actor.
3683
+ */
3684
+ static createOauthConnection(options) {
3685
+ return (options.client ?? client).post({
3686
+ url: "/api/v1/oauth-connections",
3687
+ ...options,
3688
+ headers: {
3689
+ "Content-Type": "application/json",
3690
+ ...options.headers
3691
+ }
3692
+ });
3693
+ }
3694
+ /**
3695
+ * Complete an OAuth connection
3696
+ *
3697
+ * The provider's redirect target. Not IAM-gated: the single-use `state` is the credential. Exchanges `code` for tokens and connects the connection; redirects to its `return_url` when one was given, else answers the connection. A front end that receives the provider's redirect itself forwards `code` and `state` here.
3698
+ */
3699
+ static completeOauthConnection(options) {
3700
+ return (options?.client ?? client).get({
3701
+ url: "/api/v1/oauth-connections/callback",
3702
+ ...options
3703
+ });
3704
+ }
3705
+ /**
3706
+ * Delete an OAuth connection
3707
+ *
3708
+ * Revokes the grant at the provider's `revocation_url`, when the client has one, and deletes the connection. A failed revocation does not stop the deletion.
3709
+ */
3710
+ static deleteOauthConnection(options) {
3711
+ return (options.client ?? client).delete({
3712
+ url: "/api/v1/oauth-connections/{oauth_connection_id}",
3713
+ ...options
3714
+ });
3715
+ }
3716
+ /**
3717
+ * Get an OAuth connection
3718
+ *
3719
+ * Returns the connection's status, without tokens.
3720
+ */
3721
+ static getOauthConnection(options) {
3722
+ return (options.client ?? client).get({
3723
+ url: "/api/v1/oauth-connections/{oauth_connection_id}",
3724
+ ...options
3725
+ });
3726
+ }
3727
+ };
3602
3728
  var Orchestrations = class {
3603
3729
  /**
3604
3730
  * List orchestrations
@@ -4224,9 +4350,9 @@ var Playbooks = class {
4224
4350
  };
4225
4351
  var Policies = class {
4226
4352
  /**
4227
- * List all policies
4353
+ * List policies
4228
4354
  *
4229
- * 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.
4230
4356
  *
4231
4357
  */
4232
4358
  static listPolicies(options) {
@@ -4238,7 +4364,7 @@ var Policies = class {
4238
4364
  /**
4239
4365
  * Create a policy
4240
4366
  *
4241
- * 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.
4242
4368
  */
4243
4369
  static createPolicy(options) {
4244
4370
  return (options.client ?? client).post({
@@ -4253,7 +4379,7 @@ var Policies = class {
4253
4379
  /**
4254
4380
  * Delete a policy
4255
4381
  *
4256
- * Deletes a global policy. Requires admin role. Refused with `409 POLICY_HAS_DEPENDENTS` while a trigger's `policy_id` names it.
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`.
4257
4383
  */
4258
4384
  static deletePolicy(options) {
4259
4385
  return (options.client ?? client).delete({
@@ -4264,7 +4390,7 @@ var Policies = class {
4264
4390
  /**
4265
4391
  * Get a policy
4266
4392
  *
4267
- * 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.
4268
4394
  */
4269
4395
  static getPolicy(options) {
4270
4396
  return (options.client ?? client).get({
@@ -4275,7 +4401,7 @@ var Policies = class {
4275
4401
  /**
4276
4402
  * Update a policy
4277
4403
  *
4278
- * 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.
4279
4405
  */
4280
4406
  static updatePolicy(options) {
4281
4407
  return (options.client ?? client).put({
@@ -5260,7 +5386,7 @@ var Triggers = class {
5260
5386
  /**
5261
5387
  * Update a trigger
5262
5388
  *
5263
- * Updates an existing trigger's configuration. The type is immutable. Changing `target_type` or `target_id` re-checks the target-start action (`orchestrations:StartRun`, `agents:CreateAgentGeneration` or `tools:CallTool`) against the resulting target, because a firing runs with the trigger creator's authority rather than the updater's. A caller who could not start the new target is answered `403` and the trigger keeps the target it had. A `{{secret:...}}` reference in a written `tool_context`, or in the stored one when the target changes, also needs `secrets:UseSecret` on that secret, else `403`.
5389
+ * Updates an existing trigger's configuration. The type is immutable. Changing `target_type` or `target_id` re-checks the target-start action (`orchestrations:StartRun`, `agents:CreateAgentGeneration` or `tools:CallTool`) against the resulting target, because a firing acts under the trigger's `policy_ids` rather than the updater's grant. A caller who could not start the new target is answered `403` and the trigger keeps the target it had. A `{{secret:...}}` reference in a written `tool_context`, or in the stored one when the target changes, also needs `secrets:UseSecret` on that secret, else `403`.
5264
5390
  *
5265
5391
  */
5266
5392
  static updateTrigger(options) {
@@ -5276,7 +5402,7 @@ var Triggers = class {
5276
5402
  /**
5277
5403
  * Fire a trigger
5278
5404
  *
5279
- * Fires a trigger synchronously and returns the terminal firing record. The firing itself always settles here; an `eval` target's run is queued rather than executed inline, so the record names a `queued` run to poll.
5405
+ * Fires a trigger synchronously and returns the terminal firing record. The firing acts as the caller ∩ the trigger's `policy_ids`, which must allow starting the target, else `403`. The firing itself always settles here; an `eval` target's run is queued rather than executed inline, so the record names a `queued` run to poll.
5280
5406
  */
5281
5407
  static fireTrigger(options) {
5282
5408
  return (options.client ?? client).post({
@@ -5882,6 +6008,8 @@ var SoatClient = class {
5882
6008
  memoryStores;
5883
6009
  metadataSchemas;
5884
6010
  modelRoutes;
6011
+ oauthClients;
6012
+ oauthConnections;
5885
6013
  orchestrations;
5886
6014
  playbooks;
5887
6015
  policies;
@@ -5935,6 +6063,8 @@ var SoatClient = class {
5935
6063
  this.memoryStores = bindResource(MemoryStores, httpClient);
5936
6064
  this.metadataSchemas = bindResource(MetadataSchemas, httpClient);
5937
6065
  this.modelRoutes = bindResource(ModelRoutes, httpClient);
6066
+ this.oauthClients = bindResource(OauthClients, httpClient);
6067
+ this.oauthConnections = bindResource(OauthConnections, httpClient);
5938
6068
  this.orchestrations = bindResource(Orchestrations, httpClient);
5939
6069
  this.playbooks = bindResource(Playbooks, httpClient);
5940
6070
  this.policies = bindResource(Policies, httpClient);
@@ -5982,6 +6112,8 @@ exports.MemoryRules = MemoryRules;
5982
6112
  exports.MemoryStores = MemoryStores;
5983
6113
  exports.MetadataSchemas = MetadataSchemas;
5984
6114
  exports.ModelRoutes = ModelRoutes;
6115
+ exports.OauthClients = OauthClients;
6116
+ exports.OauthConnections = OauthConnections;
5985
6117
  exports.Orchestrations = Orchestrations;
5986
6118
  exports.Playbooks = Playbooks;
5987
6119
  exports.Policies = Policies;