@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.mjs CHANGED
@@ -1352,6 +1352,175 @@ var Chats = class {
1352
1352
  });
1353
1353
  }
1354
1354
  };
1355
+ var Collections = class {
1356
+ /**
1357
+ * List collections
1358
+ *
1359
+ * Returns the collections in scope, oldest first.
1360
+ */
1361
+ static listCollections(options) {
1362
+ return (options?.client ?? client).get({
1363
+ url: "/api/v1/collections",
1364
+ ...options
1365
+ });
1366
+ }
1367
+ /**
1368
+ * Create a collection
1369
+ *
1370
+ * 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.
1371
+ */
1372
+ static createCollection(options) {
1373
+ return (options.client ?? client).post({
1374
+ url: "/api/v1/collections",
1375
+ ...options,
1376
+ headers: {
1377
+ "Content-Type": "application/json",
1378
+ ...options.headers
1379
+ }
1380
+ });
1381
+ }
1382
+ /**
1383
+ * Delete a collection
1384
+ *
1385
+ * Deletes the collection and every item in it.
1386
+ */
1387
+ static deleteCollection(options) {
1388
+ return (options.client ?? client).delete({
1389
+ url: "/api/v1/collections/{collection_id}",
1390
+ ...options
1391
+ });
1392
+ }
1393
+ /**
1394
+ * Get a collection
1395
+ *
1396
+ * Returns one collection.
1397
+ */
1398
+ static getCollection(options) {
1399
+ return (options.client ?? client).get({
1400
+ url: "/api/v1/collections/{collection_id}",
1401
+ ...options
1402
+ });
1403
+ }
1404
+ /**
1405
+ * Update a collection
1406
+ *
1407
+ * Renames the collection or replaces its `schema`. A new schema governs the next write of each item; items already stored are not re-judged.
1408
+ */
1409
+ static updateCollection(options) {
1410
+ return (options.client ?? client).patch({
1411
+ url: "/api/v1/collections/{collection_id}",
1412
+ ...options,
1413
+ headers: {
1414
+ "Content-Type": "application/json",
1415
+ ...options.headers
1416
+ }
1417
+ });
1418
+ }
1419
+ /**
1420
+ * List items
1421
+ *
1422
+ * 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`.
1423
+ */
1424
+ static listCollectionItems(options) {
1425
+ return (options.client ?? client).get({
1426
+ url: "/api/v1/collections/{collection_id}/items",
1427
+ ...options
1428
+ });
1429
+ }
1430
+ /**
1431
+ * Delete an item
1432
+ *
1433
+ * Deletes the item at `key`.
1434
+ */
1435
+ static deleteCollectionItem(options) {
1436
+ return (options.client ?? client).delete({
1437
+ url: "/api/v1/collections/{collection_id}/items/{key}",
1438
+ ...options
1439
+ });
1440
+ }
1441
+ /**
1442
+ * Get an item
1443
+ *
1444
+ * Returns the item at `key`.
1445
+ */
1446
+ static getCollectionItem(options) {
1447
+ return (options.client ?? client).get({
1448
+ url: "/api/v1/collections/{collection_id}/items/{key}",
1449
+ ...options
1450
+ });
1451
+ }
1452
+ /**
1453
+ * Update an item
1454
+ *
1455
+ * 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.
1456
+ */
1457
+ static updateCollectionItem(options) {
1458
+ return (options.client ?? client).patch({
1459
+ url: "/api/v1/collections/{collection_id}/items/{key}",
1460
+ ...options,
1461
+ headers: {
1462
+ "Content-Type": "application/json",
1463
+ ...options.headers
1464
+ }
1465
+ });
1466
+ }
1467
+ /**
1468
+ * Create or replace an item
1469
+ *
1470
+ * 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.
1471
+ */
1472
+ static putCollectionItem(options) {
1473
+ return (options.client ?? client).put({
1474
+ url: "/api/v1/collections/{collection_id}/items/{key}",
1475
+ ...options,
1476
+ headers: {
1477
+ "Content-Type": "application/json",
1478
+ ...options.headers
1479
+ }
1480
+ });
1481
+ }
1482
+ /**
1483
+ * Get item tags
1484
+ *
1485
+ * Returns the item's tags.
1486
+ */
1487
+ static getCollectionItemTags(options) {
1488
+ return (options.client ?? client).get({
1489
+ url: "/api/v1/collections/{collection_id}/items/{key}/tags",
1490
+ ...options
1491
+ });
1492
+ }
1493
+ /**
1494
+ * Merge item tags
1495
+ *
1496
+ * Merges the given tags into the item's; a key not sent is kept. Bumps the item's `version`.
1497
+ */
1498
+ static mergeCollectionItemTags(options) {
1499
+ return (options.client ?? client).patch({
1500
+ url: "/api/v1/collections/{collection_id}/items/{key}/tags",
1501
+ ...options,
1502
+ headers: {
1503
+ "Content-Type": "application/json",
1504
+ ...options.headers
1505
+ }
1506
+ });
1507
+ }
1508
+ /**
1509
+ * Replace item tags
1510
+ *
1511
+ * Replaces every tag on the item. Bumps the item's `version`.
1512
+ */
1513
+ static replaceCollectionItemTags(options) {
1514
+ return (options.client ?? client).put({
1515
+ url: "/api/v1/collections/{collection_id}/items/{key}/tags",
1516
+ ...options,
1517
+ headers: {
1518
+ "Content-Type": "application/json",
1519
+ ...options.headers
1520
+ }
1521
+ });
1522
+ }
1523
+ };
1355
1524
  var Conversations = class {
1356
1525
  /**
1357
1526
  * List conversations
@@ -3429,6 +3598,132 @@ var ModelRoutes = class {
3429
3598
  });
3430
3599
  }
3431
3600
  };
3601
+ var OauthClients = class {
3602
+ /**
3603
+ * List OAuth clients
3604
+ *
3605
+ * Returns the OAuth clients of a project.
3606
+ */
3607
+ static listOauthClients(options) {
3608
+ return (options?.client ?? client).get({
3609
+ url: "/api/v1/oauth-clients",
3610
+ ...options
3611
+ });
3612
+ }
3613
+ /**
3614
+ * Create an OAuth client
3615
+ *
3616
+ * Registers your app at a provider. `client_secret` is a `{{secret:sec_...}}` reference, and the caller needs `secrets:UseSecret` on it.
3617
+ */
3618
+ static createOauthClient(options) {
3619
+ return (options.client ?? client).post({
3620
+ url: "/api/v1/oauth-clients",
3621
+ ...options,
3622
+ headers: {
3623
+ "Content-Type": "application/json",
3624
+ ...options.headers
3625
+ }
3626
+ });
3627
+ }
3628
+ /**
3629
+ * Delete an OAuth client
3630
+ *
3631
+ * Deletes the client and every connection made through it.
3632
+ */
3633
+ static deleteOauthClient(options) {
3634
+ return (options.client ?? client).delete({
3635
+ url: "/api/v1/oauth-clients/{oauth_client_id}",
3636
+ ...options
3637
+ });
3638
+ }
3639
+ /**
3640
+ * Get an OAuth client
3641
+ *
3642
+ * Returns the client; `client_secret` is its secret reference.
3643
+ */
3644
+ static getOauthClient(options) {
3645
+ return (options.client ?? client).get({
3646
+ url: "/api/v1/oauth-clients/{oauth_client_id}",
3647
+ ...options
3648
+ });
3649
+ }
3650
+ /**
3651
+ * Update an OAuth client
3652
+ *
3653
+ * Changes only the fields sent; `null` clears a nullable one.
3654
+ */
3655
+ static updateOauthClient(options) {
3656
+ return (options.client ?? client).patch({
3657
+ url: "/api/v1/oauth-clients/{oauth_client_id}",
3658
+ ...options,
3659
+ headers: {
3660
+ "Content-Type": "application/json",
3661
+ ...options.headers
3662
+ }
3663
+ });
3664
+ }
3665
+ };
3666
+ var OauthConnections = class {
3667
+ /**
3668
+ * List OAuth connections
3669
+ *
3670
+ * Returns a project's OAuth connections, without tokens.
3671
+ */
3672
+ static listOauthConnections(options) {
3673
+ return (options?.client ?? client).get({
3674
+ url: "/api/v1/oauth-connections",
3675
+ ...options
3676
+ });
3677
+ }
3678
+ /**
3679
+ * Start an OAuth connection
3680
+ *
3681
+ * 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.
3682
+ */
3683
+ static createOauthConnection(options) {
3684
+ return (options.client ?? client).post({
3685
+ url: "/api/v1/oauth-connections",
3686
+ ...options,
3687
+ headers: {
3688
+ "Content-Type": "application/json",
3689
+ ...options.headers
3690
+ }
3691
+ });
3692
+ }
3693
+ /**
3694
+ * Complete an OAuth connection
3695
+ *
3696
+ * 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.
3697
+ */
3698
+ static completeOauthConnection(options) {
3699
+ return (options?.client ?? client).get({
3700
+ url: "/api/v1/oauth-connections/callback",
3701
+ ...options
3702
+ });
3703
+ }
3704
+ /**
3705
+ * Delete an OAuth connection
3706
+ *
3707
+ * 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.
3708
+ */
3709
+ static deleteOauthConnection(options) {
3710
+ return (options.client ?? client).delete({
3711
+ url: "/api/v1/oauth-connections/{oauth_connection_id}",
3712
+ ...options
3713
+ });
3714
+ }
3715
+ /**
3716
+ * Get an OAuth connection
3717
+ *
3718
+ * Returns the connection's status, without tokens.
3719
+ */
3720
+ static getOauthConnection(options) {
3721
+ return (options.client ?? client).get({
3722
+ url: "/api/v1/oauth-connections/{oauth_connection_id}",
3723
+ ...options
3724
+ });
3725
+ }
3726
+ };
3432
3727
  var Orchestrations = class {
3433
3728
  /**
3434
3729
  * List orchestrations
@@ -4083,7 +4378,7 @@ var Policies = class {
4083
4378
  /**
4084
4379
  * Delete a policy
4085
4380
  *
4086
- * Deletes a global policy. Requires admin role. Refused with `409 POLICY_HAS_DEPENDENTS` while a trigger's `policy_id` names it.
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`.
4087
4382
  */
4088
4383
  static deletePolicy(options) {
4089
4384
  return (options.client ?? client).delete({
@@ -5090,7 +5385,7 @@ var Triggers = class {
5090
5385
  /**
5091
5386
  * Update a trigger
5092
5387
  *
5093
- * 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`.
5388
+ * 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`.
5094
5389
  *
5095
5390
  */
5096
5391
  static updateTrigger(options) {
@@ -5106,7 +5401,7 @@ var Triggers = class {
5106
5401
  /**
5107
5402
  * Fire a trigger
5108
5403
  *
5109
- * 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.
5404
+ * 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.
5110
5405
  */
5111
5406
  static fireTrigger(options) {
5112
5407
  return (options.client ?? client).post({
@@ -5694,6 +5989,7 @@ var SoatClient = class {
5694
5989
  auditLog;
5695
5990
  chains;
5696
5991
  chats;
5992
+ collections;
5697
5993
  conversations;
5698
5994
  deciders;
5699
5995
  documents;
@@ -5711,6 +6007,8 @@ var SoatClient = class {
5711
6007
  memoryStores;
5712
6008
  metadataSchemas;
5713
6009
  modelRoutes;
6010
+ oauthClients;
6011
+ oauthConnections;
5714
6012
  orchestrations;
5715
6013
  playbooks;
5716
6014
  policies;
@@ -5746,6 +6044,7 @@ var SoatClient = class {
5746
6044
  this.auditLog = bindResource(AuditLog, httpClient);
5747
6045
  this.chains = bindResource(Chains, httpClient);
5748
6046
  this.chats = bindResource(Chats, httpClient);
6047
+ this.collections = bindResource(Collections, httpClient);
5749
6048
  this.conversations = bindResource(Conversations, httpClient);
5750
6049
  this.deciders = bindResource(Deciders, httpClient);
5751
6050
  this.documents = bindResource(Documents, httpClient);
@@ -5763,6 +6062,8 @@ var SoatClient = class {
5763
6062
  this.memoryStores = bindResource(MemoryStores, httpClient);
5764
6063
  this.metadataSchemas = bindResource(MetadataSchemas, httpClient);
5765
6064
  this.modelRoutes = bindResource(ModelRoutes, httpClient);
6065
+ this.oauthClients = bindResource(OauthClients, httpClient);
6066
+ this.oauthConnections = bindResource(OauthConnections, httpClient);
5766
6067
  this.orchestrations = bindResource(Orchestrations, httpClient);
5767
6068
  this.playbooks = bindResource(Playbooks, httpClient);
5768
6069
  this.policies = bindResource(Policies, httpClient);
@@ -5782,4 +6083,4 @@ var SoatClient = class {
5782
6083
  }
5783
6084
  };
5784
6085
  //#endregion
5785
- export { Activity, Actors, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, AuditLog, Chains, Chats, Conversations, Deciders, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryRules, MemoryStores, MetadataSchemas, ModelRoutes, Orchestrations, Playbooks, Policies, Projects, Quotas, Secrets, Sessions, Shares, SoatClient, Tasks, Tools, Traces, Triggers, Usage, Users, Webhooks, Workflows, createClient, createConfig };
6086
+ export { Activity, Actors, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, AuditLog, Chains, Chats, Collections, Conversations, Deciders, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryRules, MemoryStores, MetadataSchemas, ModelRoutes, OauthClients, OauthConnections, Orchestrations, Playbooks, Policies, Projects, Quotas, Secrets, Sessions, Shares, SoatClient, Tasks, Tools, Traces, Triggers, Usage, Users, Webhooks, Workflows, createClient, createConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/sdk",
3
- "version": "0.102.1",
3
+ "version": "0.104.0",
4
4
  "description": "TypeScript SDK for SOAT — open-source infrastructure for production-ready AI agents.",
5
5
  "keywords": [
6
6
  "ai-agents",