@anyformat/sdk 1.1.0 → 1.3.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
@@ -52,7 +52,7 @@ module.exports = __toCommonJS(index_exports);
52
52
  // package.json
53
53
  var package_default = {
54
54
  name: "@anyformat/sdk",
55
- version: "1.1.0",
55
+ version: "1.3.0",
56
56
  description: "TypeScript SDK for the AnyFormat API",
57
57
  license: "MIT",
58
58
  author: "Anyformat <info@anyformat.ai>",
@@ -1140,6 +1140,11 @@ var v3GetRun = (options) => (options.client ?? client).get({
1140
1140
  url: "/v3/runs/{run_id}/",
1141
1141
  ...options
1142
1142
  });
1143
+ var v3DownloadSplitPdf = (options) => (options.client ?? client).get({
1144
+ security: [{ scheme: "bearer", type: "http" }],
1145
+ url: "/v3/splits/{split_id}/pdf/",
1146
+ ...options
1147
+ });
1143
1148
  var v3ListWorkflows = (options) => (options?.client ?? client).get({
1144
1149
  security: [{ scheme: "bearer", type: "http" }],
1145
1150
  url: "/v3/workflows/",
@@ -1793,6 +1798,21 @@ var Anyformat = class {
1793
1798
  if (res.error) throw toApiError(res.response?.status ?? 500, res.error, res.response?.headers);
1794
1799
  return res.data;
1795
1800
  }
1801
+ /**
1802
+ * Download one split's pages as a PDF.
1803
+ *
1804
+ * Take `splitId` from a run's `results.splits[].id`, or from
1805
+ * `results.splits[].partitions[].id` when the splitter partitions that
1806
+ * category (the category's own `id` is then `null`, because it is several
1807
+ * sub-documents and no single one of them).
1808
+ *
1809
+ * The document is built when you ask for it and never stored.
1810
+ */
1811
+ async downloadSplitPdf(splitId) {
1812
+ const res = await v3DownloadSplitPdf({ client: this._client, path: { split_id: splitId } });
1813
+ if (res.error) throw toApiError(res.response?.status ?? 500, res.error, res.response?.headers);
1814
+ return res.data;
1815
+ }
1796
1816
  /**
1797
1817
  * Parse a document with the platform's atomic parse operation (fast lite
1798
1818
  * parse). Returns the run id; poll `getParseMarkdown(runId)` for the parsed