@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.cjs CHANGED
@@ -1290,6 +1290,44 @@ var Documents = class {
1290
1290
  });
1291
1291
  }
1292
1292
  /**
1293
+ * Get document ingestion status
1294
+ *
1295
+ * Returns a lightweight ingestion status payload for polling — `status`,
1296
+ * `chunk_count`, `total_pages`, and (when failed) `error`. Unlike
1297
+ * `GET /documents/{document_id}`, it never returns the assembled chunk
1298
+ * content, so it is cheap to poll on large documents. A document whose
1299
+ * ingestion has stalled (no progress past the configured timeout) is
1300
+ * transitioned to `failed` with `error=INGESTION_TIMEOUT` on read.
1301
+ *
1302
+ */
1303
+ static getDocumentStatus(options) {
1304
+ return (options.client ?? client).get({
1305
+ url: "/api/v1/documents/{document_id}/status",
1306
+ ...options
1307
+ });
1308
+ }
1309
+ /**
1310
+ * Re-ingest an existing document
1311
+ *
1312
+ * Re-runs ingestion for an existing document against its already-stored
1313
+ * source file. Existing chunks are discarded and the document is reset to
1314
+ * `status=pending` before re-processing. Use this to recover a document
1315
+ * stuck in `processing`/`failed` or to re-chunk with a different strategy
1316
+ * without re-uploading the file. Async by default (`202`); pass
1317
+ * `?async=false` to run synchronously (`201`).
1318
+ *
1319
+ */
1320
+ static reingestDocument(options) {
1321
+ return (options.client ?? client).post({
1322
+ url: "/api/v1/documents/{document_id}/ingest",
1323
+ ...options,
1324
+ headers: {
1325
+ "Content-Type": "application/json",
1326
+ ...options.headers
1327
+ }
1328
+ });
1329
+ }
1330
+ /**
1293
1331
  * Get document tags
1294
1332
  *
1295
1333
  * Returns all tags attached to the document
@@ -1410,13 +1448,13 @@ var Files = class {
1410
1448
  });
1411
1449
  }
1412
1450
  /**
1413
- * Request a file upload token
1451
+ * Create a presigned upload URL
1414
1452
  *
1415
- * 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.
1453
+ * 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.
1416
1454
  */
1417
- static createUploadToken(options) {
1455
+ static createPresignedUrl(options) {
1418
1456
  return (options.client ?? client).post({
1419
- url: "/api/v1/files/upload-token",
1457
+ url: "/api/v1/files/presigned-url",
1420
1458
  ...options,
1421
1459
  headers: {
1422
1460
  "Content-Type": "application/json",
@@ -1427,7 +1465,7 @@ var Files = class {
1427
1465
  /**
1428
1466
  * Upload a file using an upload token
1429
1467
  *
1430
- * 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.
1468
+ * 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.
1431
1469
  */
1432
1470
  static uploadFileWithToken(options) {
1433
1471
  return (options.client ?? client).post({