@arbidocs/sdk 0.4.63 → 0.4.65

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/browser.cjs CHANGED
@@ -4482,10 +4482,10 @@ async function uploadUrl(arbi, urls, shared = false) {
4482
4482
  "Failed to upload from URLs"
4483
4483
  );
4484
4484
  }
4485
- async function getParsedContent(auth, docId, stage) {
4485
+ async function getParsedContent(auth, docId, stage, version) {
4486
4486
  const res = await authenticatedFetch({
4487
4487
  ...auth,
4488
- path: `/v1/document/${docId}/parsed-${stage}`
4488
+ path: `/v1/document/${docId}/parsed-${stage}${version ? `?version=${version}` : ""}`
4489
4489
  });
4490
4490
  return res.json();
4491
4491
  }
@@ -4543,10 +4543,10 @@ async function uploadFiles(auth, files, options) {
4543
4543
  });
4544
4544
  return res.json();
4545
4545
  }
4546
- async function downloadDocument(auth, docId) {
4546
+ async function downloadDocument(auth, docId, version) {
4547
4547
  return authenticatedFetch({
4548
4548
  ...auth,
4549
- path: `/v1/document/${docId}/download`
4549
+ path: `/v1/document/${docId}/download${version ? `?version=${version}` : ""}`
4550
4550
  });
4551
4551
  }
4552
4552
  function mimeFromName(name) {
@@ -4705,6 +4705,7 @@ async function uploadDocumentsDirect(arbi, workspaceKey, files, options) {
4705
4705
  );
4706
4706
  return {
4707
4707
  doc_ext_ids: commitResult.doc_ext_ids ?? [],
4708
+ version: commitResult.version ?? null,
4708
4709
  skipped: [...skipped, ...commitResult.skipped ?? []]
4709
4710
  };
4710
4711
  }
@@ -6585,7 +6586,7 @@ var Arbi = class {
6585
6586
  */
6586
6587
  listAll: (options) => listAll(this.requireClient(), options),
6587
6588
  get: (externalIds) => getDocuments(this.requireClient(), externalIds),
6588
- /** Every version of a document (any version's id), oldest first; `is_current` marks the current one. */
6589
+ /** Every version of a document, oldest first; `is_current` marks the current one. */
6589
6590
  versions: (docId) => listVersions(this.requireClient(), docId),
6590
6591
  delete: (externalIds) => deleteDocuments(this.requireClient(), externalIds),
6591
6592
  update: (documents) => updateDocuments(this.requireClient(), documents),
@@ -6599,8 +6600,11 @@ var Arbi = class {
6599
6600
  () => uploadFile(this.getAuthHeaders(), fileData, fileName, options)
6600
6601
  );
6601
6602
  },
6602
- download: (docId) => this.recovering(() => downloadDocument(this.getAuthHeaders(), docId)),
6603
- getParsedContent: (docId, stage) => this.recovering(() => getParsedContent(this.getAuthHeaders(), docId, stage)),
6603
+ /** Download a document's original file — its current version, or `version`. */
6604
+ download: (docId, version) => this.recovering(() => downloadDocument(this.getAuthHeaders(), docId, version)),
6605
+ getParsedContent: (docId, stage, version) => this.recovering(
6606
+ () => getParsedContent(this.getAuthHeaders(), docId, stage, version)
6607
+ ),
6604
6608
  getThumbnails: (docIds) => this.recovering(() => getThumbnails(this.getAuthHeaders(), docIds))
6605
6609
  };
6606
6610
  // ── Conversations ─────────────────────────────────────────────────────