@soat/sdk 0.103.0 → 0.104.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
@@ -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 global policy. Requires admin role. 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({
@@ -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;