@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 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
@@ -5695,6 +5864,7 @@ var SoatClient = class {
5695
5864
  auditLog;
5696
5865
  chains;
5697
5866
  chats;
5867
+ collections;
5698
5868
  conversations;
5699
5869
  deciders;
5700
5870
  documents;
@@ -5747,6 +5917,7 @@ var SoatClient = class {
5747
5917
  this.auditLog = bindResource(AuditLog, httpClient);
5748
5918
  this.chains = bindResource(Chains, httpClient);
5749
5919
  this.chats = bindResource(Chats, httpClient);
5920
+ this.collections = bindResource(Collections, httpClient);
5750
5921
  this.conversations = bindResource(Conversations, httpClient);
5751
5922
  this.deciders = bindResource(Deciders, httpClient);
5752
5923
  this.documents = bindResource(Documents, httpClient);
@@ -5793,6 +5964,7 @@ exports.Approvals = Approvals;
5793
5964
  exports.AuditLog = AuditLog;
5794
5965
  exports.Chains = Chains;
5795
5966
  exports.Chats = Chats;
5967
+ exports.Collections = Collections;
5796
5968
  exports.Conversations = Conversations;
5797
5969
  exports.Deciders = Deciders;
5798
5970
  exports.Documents = Documents;