@anyformat/sdk 1.0.0 → 1.2.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/README.md CHANGED
@@ -3,13 +3,9 @@
3
3
  TypeScript SDK for the AnyFormat API (v3). Mirrors the Python SDK's fluent flow.
4
4
 
5
5
  ```bash
6
- npm install @anyformat/sdk@rc
6
+ npm install @anyformat/sdk
7
7
  ```
8
8
 
9
- > **Release candidate.** v3 support ships as `1.0.0-rc.1` on the npm `rc`
10
- > dist-tag. Plain `npm install @anyformat/sdk` keeps resolving to the stable
11
- > 0.2.x (v2) line until 1.0.0 final ships after the RC bake period.
12
-
13
9
  ```ts
14
10
  import { Anyformat, Schema } from "@anyformat/sdk";
15
11
 
@@ -298,7 +294,7 @@ toolchain). Then:
298
294
 
299
295
  ## Releasing
300
296
 
301
- Cut on demand — a maintainer bumps the version in a PR, then pushes a `sdk-js-vX.Y.Z` tag on the release commit. Full flow + one-time setup: [`../RELEASING.md`](../RELEASING.md). Break-glass: `./publish.sh [--build-only|--dry-run]`.
297
+ Released automatically: every change to this package that reaches `main` publishes the next minor version. Breaking the API? `uv run af release-major --package sdk-js` in the same PR. Full flow: [`../RELEASING.md`](../RELEASING.md)
302
298
 
303
299
  ## Node configuration knobs
304
300
 
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.0.0",
55
+ version: "1.2.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