@soat/sdk 0.13.5 → 0.13.7

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
@@ -1289,6 +1289,44 @@ var Documents = class {
1289
1289
  });
1290
1290
  }
1291
1291
  /**
1292
+ * Get document ingestion status
1293
+ *
1294
+ * Returns a lightweight ingestion status payload for polling — `status`,
1295
+ * `chunk_count`, `total_pages`, and (when failed) `error`. Unlike
1296
+ * `GET /documents/{document_id}`, it never returns the assembled chunk
1297
+ * content, so it is cheap to poll on large documents. A document whose
1298
+ * ingestion has stalled (no progress past the configured timeout) is
1299
+ * transitioned to `failed` with `error=INGESTION_TIMEOUT` on read.
1300
+ *
1301
+ */
1302
+ static getDocumentStatus(options) {
1303
+ return (options.client ?? client).get({
1304
+ url: "/api/v1/documents/{document_id}/status",
1305
+ ...options
1306
+ });
1307
+ }
1308
+ /**
1309
+ * Re-ingest an existing document
1310
+ *
1311
+ * Re-runs ingestion for an existing document against its already-stored
1312
+ * source file. Existing chunks are discarded and the document is reset to
1313
+ * `status=pending` before re-processing. Use this to recover a document
1314
+ * stuck in `processing`/`failed` or to re-chunk with a different strategy
1315
+ * without re-uploading the file. Async by default (`202`); pass
1316
+ * `?async=false` to run synchronously (`201`).
1317
+ *
1318
+ */
1319
+ static reingestDocument(options) {
1320
+ return (options.client ?? client).post({
1321
+ url: "/api/v1/documents/{document_id}/ingest",
1322
+ ...options,
1323
+ headers: {
1324
+ "Content-Type": "application/json",
1325
+ ...options.headers
1326
+ }
1327
+ });
1328
+ }
1329
+ /**
1292
1330
  * Get document tags
1293
1331
  *
1294
1332
  * Returns all tags attached to the document
@@ -1409,13 +1447,13 @@ var Files = class {
1409
1447
  });
1410
1448
  }
1411
1449
  /**
1412
- * Request a file upload token
1450
+ * Create a presigned upload URL
1413
1451
  *
1414
- * Creates a short-lived, single-use upload token — the local-storage equivalent of an S3 presigned URL. The client then uploads the file content directly to the returned `upload_url` via `POST /api/v1/files/upload/{token}`, bypassing MCP payload size limits.
1452
+ * Creates a short-lived, single-use presigned upload URL — the local-storage equivalent of an S3 presigned URL. The client then uploads the file content directly to the returned `upload_url` via `POST /api/v1/files/upload/{token}`, bypassing MCP payload size limits. When the server is configured with `SOAT_BASE_URL`, `upload_url` is a fully-qualified absolute URL so MCP agents and other clients can POST to it without knowing the server base URL in advance.
1415
1453
  */
1416
- static createUploadToken(options) {
1454
+ static createPresignedUrl(options) {
1417
1455
  return (options.client ?? client).post({
1418
- url: "/api/v1/files/upload-token",
1456
+ url: "/api/v1/files/presigned-url",
1419
1457
  ...options,
1420
1458
  headers: {
1421
1459
  "Content-Type": "application/json",
@@ -1426,7 +1464,7 @@ var Files = class {
1426
1464
  /**
1427
1465
  * Upload a file using an upload token
1428
1466
  *
1429
- * Uploads file content authorized by a single-use token from `POST /api/v1/files/upload-token`. No bearer credential is required — the token is the credential. Accepts either multipart/form-data (field `file`) or JSON with a base64-encoded `content` field. Excluded from the MCP tool surface; clients call it directly over HTTP.
1467
+ * Uploads file content authorized by a single-use token from `POST /api/v1/files/presigned-url`. No bearer credential is required — the token is the credential. Accepts either multipart/form-data (field `file`) or JSON with a base64-encoded `content` field. Excluded from the MCP tool surface; clients call it directly over HTTP.
1430
1468
  */
1431
1469
  static uploadFileWithToken(options) {
1432
1470
  return (options.client ?? client).post({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/sdk",
3
- "version": "0.13.5",
3
+ "version": "0.13.7",
4
4
  "description": "TypeScript SDK for the SOAT API",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",