@soat/sdk 0.102.0 → 0.103.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 +172 -0
- package/dist/index.d.cts +1003 -126
- package/dist/index.d.mts +1003 -126
- package/dist/index.mjs +172 -1
- package/package.json +1 -1
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
|
|
@@ -5694,6 +5863,7 @@ var SoatClient = class {
|
|
|
5694
5863
|
auditLog;
|
|
5695
5864
|
chains;
|
|
5696
5865
|
chats;
|
|
5866
|
+
collections;
|
|
5697
5867
|
conversations;
|
|
5698
5868
|
deciders;
|
|
5699
5869
|
documents;
|
|
@@ -5746,6 +5916,7 @@ var SoatClient = class {
|
|
|
5746
5916
|
this.auditLog = bindResource(AuditLog, httpClient);
|
|
5747
5917
|
this.chains = bindResource(Chains, httpClient);
|
|
5748
5918
|
this.chats = bindResource(Chats, httpClient);
|
|
5919
|
+
this.collections = bindResource(Collections, httpClient);
|
|
5749
5920
|
this.conversations = bindResource(Conversations, httpClient);
|
|
5750
5921
|
this.deciders = bindResource(Deciders, httpClient);
|
|
5751
5922
|
this.documents = bindResource(Documents, httpClient);
|
|
@@ -5782,4 +5953,4 @@ var SoatClient = class {
|
|
|
5782
5953
|
}
|
|
5783
5954
|
};
|
|
5784
5955
|
//#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 };
|
|
5956
|
+
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, Orchestrations, Playbooks, Policies, Projects, Quotas, Secrets, Sessions, Shares, SoatClient, Tasks, Tools, Traces, Triggers, Usage, Users, Webhooks, Workflows, createClient, createConfig };
|