@soat/sdk 0.102.1 → 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
@@ -1353,6 +1353,175 @@ var Chats = class {
1353
1353
  });
1354
1354
  }
1355
1355
  };
1356
+ var Collections = class {
1357
+ /**
1358
+ * List collections
1359
+ *
1360
+ * Returns the collections in scope, oldest first.
1361
+ */
1362
+ static listCollections(options) {
1363
+ return (options?.client ?? client).get({
1364
+ url: "/api/v1/collections",
1365
+ ...options
1366
+ });
1367
+ }
1368
+ /**
1369
+ * Create a collection
1370
+ *
1371
+ * Creates a collection. `name` is unique per project; a second collection of the same name is `409 NAME_CONFLICT`. A `schema` is compiled here, so one JSON Schema cannot parse is refused rather than stored.
1372
+ */
1373
+ static createCollection(options) {
1374
+ return (options.client ?? client).post({
1375
+ url: "/api/v1/collections",
1376
+ ...options,
1377
+ headers: {
1378
+ "Content-Type": "application/json",
1379
+ ...options.headers
1380
+ }
1381
+ });
1382
+ }
1383
+ /**
1384
+ * Delete a collection
1385
+ *
1386
+ * Deletes the collection and every item in it.
1387
+ */
1388
+ static deleteCollection(options) {
1389
+ return (options.client ?? client).delete({
1390
+ url: "/api/v1/collections/{collection_id}",
1391
+ ...options
1392
+ });
1393
+ }
1394
+ /**
1395
+ * Get a collection
1396
+ *
1397
+ * Returns one collection.
1398
+ */
1399
+ static getCollection(options) {
1400
+ return (options.client ?? client).get({
1401
+ url: "/api/v1/collections/{collection_id}",
1402
+ ...options
1403
+ });
1404
+ }
1405
+ /**
1406
+ * Update a collection
1407
+ *
1408
+ * Renames the collection or replaces its `schema`. A new schema governs the next write of each item; items already stored are not re-judged.
1409
+ */
1410
+ static updateCollection(options) {
1411
+ return (options.client ?? client).patch({
1412
+ url: "/api/v1/collections/{collection_id}",
1413
+ ...options,
1414
+ headers: {
1415
+ "Content-Type": "application/json",
1416
+ ...options.headers
1417
+ }
1418
+ });
1419
+ }
1420
+ /**
1421
+ * List items
1422
+ *
1423
+ * Returns the collection's items in key order, narrowed by `data` and `tags`. The listing is bounded by `limit` (at most 100) and a statement timeout; a query past it is `422 QUERY_TIMEOUT`.
1424
+ */
1425
+ static listCollectionItems(options) {
1426
+ return (options.client ?? client).get({
1427
+ url: "/api/v1/collections/{collection_id}/items",
1428
+ ...options
1429
+ });
1430
+ }
1431
+ /**
1432
+ * Delete an item
1433
+ *
1434
+ * Deletes the item at `key`.
1435
+ */
1436
+ static deleteCollectionItem(options) {
1437
+ return (options.client ?? client).delete({
1438
+ url: "/api/v1/collections/{collection_id}/items/{key}",
1439
+ ...options
1440
+ });
1441
+ }
1442
+ /**
1443
+ * Get an item
1444
+ *
1445
+ * Returns the item at `key`.
1446
+ */
1447
+ static getCollectionItem(options) {
1448
+ return (options.client ?? client).get({
1449
+ url: "/api/v1/collections/{collection_id}/items/{key}",
1450
+ ...options
1451
+ });
1452
+ }
1453
+ /**
1454
+ * Update an item
1455
+ *
1456
+ * Merges `data` into the item's as a JSON Merge Patch (RFC 7386): an object merges key by key, `null` removes a key, any other value replaces it. The merged `data` is judged as a put's is.
1457
+ */
1458
+ static updateCollectionItem(options) {
1459
+ return (options.client ?? client).patch({
1460
+ url: "/api/v1/collections/{collection_id}/items/{key}",
1461
+ ...options,
1462
+ headers: {
1463
+ "Content-Type": "application/json",
1464
+ ...options.headers
1465
+ }
1466
+ });
1467
+ }
1468
+ /**
1469
+ * Create or replace an item
1470
+ *
1471
+ * Writes `data` at `key`: `201` when the key was free, `200` when it replaced an item. `tags` replace the bag when sent and leave it alone when omitted. `data` is at most 64 KB as JSON and must satisfy the collection's `schema`. A precondition (`If-Match` or `expected_version`) names a version of an existing item, so it is `404` for a free key.
1472
+ */
1473
+ static putCollectionItem(options) {
1474
+ return (options.client ?? client).put({
1475
+ url: "/api/v1/collections/{collection_id}/items/{key}",
1476
+ ...options,
1477
+ headers: {
1478
+ "Content-Type": "application/json",
1479
+ ...options.headers
1480
+ }
1481
+ });
1482
+ }
1483
+ /**
1484
+ * Get item tags
1485
+ *
1486
+ * Returns the item's tags.
1487
+ */
1488
+ static getCollectionItemTags(options) {
1489
+ return (options.client ?? client).get({
1490
+ url: "/api/v1/collections/{collection_id}/items/{key}/tags",
1491
+ ...options
1492
+ });
1493
+ }
1494
+ /**
1495
+ * Merge item tags
1496
+ *
1497
+ * Merges the given tags into the item's; a key not sent is kept. Bumps the item's `version`.
1498
+ */
1499
+ static mergeCollectionItemTags(options) {
1500
+ return (options.client ?? client).patch({
1501
+ url: "/api/v1/collections/{collection_id}/items/{key}/tags",
1502
+ ...options,
1503
+ headers: {
1504
+ "Content-Type": "application/json",
1505
+ ...options.headers
1506
+ }
1507
+ });
1508
+ }
1509
+ /**
1510
+ * Replace item tags
1511
+ *
1512
+ * Replaces every tag on the item. Bumps the item's `version`.
1513
+ */
1514
+ static replaceCollectionItemTags(options) {
1515
+ return (options.client ?? client).put({
1516
+ url: "/api/v1/collections/{collection_id}/items/{key}/tags",
1517
+ ...options,
1518
+ headers: {
1519
+ "Content-Type": "application/json",
1520
+ ...options.headers
1521
+ }
1522
+ });
1523
+ }
1524
+ };
1356
1525
  var Conversations = class {
1357
1526
  /**
1358
1527
  * List conversations
@@ -3430,6 +3599,132 @@ var ModelRoutes = class {
3430
3599
  });
3431
3600
  }
3432
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
+ };
3433
3728
  var Orchestrations = class {
3434
3729
  /**
3435
3730
  * List orchestrations
@@ -4084,7 +4379,7 @@ var Policies = class {
4084
4379
  /**
4085
4380
  * Delete a policy
4086
4381
  *
4087
- * 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`.
4088
4383
  */
4089
4384
  static deletePolicy(options) {
4090
4385
  return (options.client ?? client).delete({
@@ -5091,7 +5386,7 @@ var Triggers = class {
5091
5386
  /**
5092
5387
  * Update a trigger
5093
5388
  *
5094
- * 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`.
5095
5390
  *
5096
5391
  */
5097
5392
  static updateTrigger(options) {
@@ -5107,7 +5402,7 @@ var Triggers = class {
5107
5402
  /**
5108
5403
  * Fire a trigger
5109
5404
  *
5110
- * 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.
5111
5406
  */
5112
5407
  static fireTrigger(options) {
5113
5408
  return (options.client ?? client).post({
@@ -5695,6 +5990,7 @@ var SoatClient = class {
5695
5990
  auditLog;
5696
5991
  chains;
5697
5992
  chats;
5993
+ collections;
5698
5994
  conversations;
5699
5995
  deciders;
5700
5996
  documents;
@@ -5712,6 +6008,8 @@ var SoatClient = class {
5712
6008
  memoryStores;
5713
6009
  metadataSchemas;
5714
6010
  modelRoutes;
6011
+ oauthClients;
6012
+ oauthConnections;
5715
6013
  orchestrations;
5716
6014
  playbooks;
5717
6015
  policies;
@@ -5747,6 +6045,7 @@ var SoatClient = class {
5747
6045
  this.auditLog = bindResource(AuditLog, httpClient);
5748
6046
  this.chains = bindResource(Chains, httpClient);
5749
6047
  this.chats = bindResource(Chats, httpClient);
6048
+ this.collections = bindResource(Collections, httpClient);
5750
6049
  this.conversations = bindResource(Conversations, httpClient);
5751
6050
  this.deciders = bindResource(Deciders, httpClient);
5752
6051
  this.documents = bindResource(Documents, httpClient);
@@ -5764,6 +6063,8 @@ var SoatClient = class {
5764
6063
  this.memoryStores = bindResource(MemoryStores, httpClient);
5765
6064
  this.metadataSchemas = bindResource(MetadataSchemas, httpClient);
5766
6065
  this.modelRoutes = bindResource(ModelRoutes, httpClient);
6066
+ this.oauthClients = bindResource(OauthClients, httpClient);
6067
+ this.oauthConnections = bindResource(OauthConnections, httpClient);
5767
6068
  this.orchestrations = bindResource(Orchestrations, httpClient);
5768
6069
  this.playbooks = bindResource(Playbooks, httpClient);
5769
6070
  this.policies = bindResource(Policies, httpClient);
@@ -5793,6 +6094,7 @@ exports.Approvals = Approvals;
5793
6094
  exports.AuditLog = AuditLog;
5794
6095
  exports.Chains = Chains;
5795
6096
  exports.Chats = Chats;
6097
+ exports.Collections = Collections;
5796
6098
  exports.Conversations = Conversations;
5797
6099
  exports.Deciders = Deciders;
5798
6100
  exports.Documents = Documents;
@@ -5810,6 +6112,8 @@ exports.MemoryRules = MemoryRules;
5810
6112
  exports.MemoryStores = MemoryStores;
5811
6113
  exports.MetadataSchemas = MetadataSchemas;
5812
6114
  exports.ModelRoutes = ModelRoutes;
6115
+ exports.OauthClients = OauthClients;
6116
+ exports.OauthConnections = OauthConnections;
5813
6117
  exports.Orchestrations = Orchestrations;
5814
6118
  exports.Playbooks = Playbooks;
5815
6119
  exports.Policies = Policies;