extend-ai 1.7.0 → 1.8.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.
Files changed (104) hide show
  1. package/BaseClient.js +2 -2
  2. package/Client.d.ts +3 -0
  3. package/Client.js +53 -48
  4. package/api/resources/batchRuns/client/Client.d.ts +49 -0
  5. package/api/resources/batchRuns/client/Client.js +142 -0
  6. package/api/resources/batchRuns/client/index.d.ts +1 -0
  7. package/api/resources/batchRuns/client/index.js +2 -0
  8. package/api/resources/batchRuns/index.d.ts +1 -0
  9. package/api/resources/batchRuns/index.js +17 -0
  10. package/api/resources/classifierVersions/client/Client.d.ts +6 -3
  11. package/api/resources/classifierVersions/client/Client.js +6 -3
  12. package/api/resources/classifyRuns/client/Client.d.ts +57 -0
  13. package/api/resources/classifyRuns/client/Client.js +111 -1
  14. package/api/resources/classifyRuns/client/requests/ClassifyRunsCreateBatchRequest.d.ts +38 -0
  15. package/api/resources/classifyRuns/client/requests/ClassifyRunsListRequest.d.ts +6 -0
  16. package/api/resources/classifyRuns/client/requests/index.d.ts +1 -0
  17. package/api/resources/classifyRuns/types/ClassifyRunsCreateBatchRequestClassifier.d.ts +11 -0
  18. package/api/resources/classifyRuns/types/ClassifyRunsCreateBatchRequestInputsItem.d.ts +6 -0
  19. package/api/resources/classifyRuns/types/ClassifyRunsCreateBatchRequestInputsItemFile.d.ts +5 -0
  20. package/api/resources/classifyRuns/types/index.d.ts +3 -0
  21. package/api/resources/classifyRuns/types/index.js +3 -0
  22. package/api/resources/extractRuns/client/Client.d.ts +57 -0
  23. package/api/resources/extractRuns/client/Client.js +111 -1
  24. package/api/resources/extractRuns/client/requests/ExtractRunsCreateBatchRequest.d.ts +38 -0
  25. package/api/resources/extractRuns/client/requests/ExtractRunsListRequest.d.ts +6 -0
  26. package/api/resources/extractRuns/client/requests/index.d.ts +1 -0
  27. package/api/resources/extractRuns/types/ExtractRunsCreateBatchRequestExtractor.d.ts +11 -0
  28. package/api/resources/extractRuns/types/ExtractRunsCreateBatchRequestInputsItem.d.ts +6 -0
  29. package/api/resources/extractRuns/types/ExtractRunsCreateBatchRequestInputsItem.js +3 -0
  30. package/api/resources/extractRuns/types/ExtractRunsCreateBatchRequestInputsItemFile.d.ts +5 -0
  31. package/api/resources/extractRuns/types/ExtractRunsCreateBatchRequestInputsItemFile.js +3 -0
  32. package/api/resources/extractRuns/types/index.d.ts +3 -0
  33. package/api/resources/extractRuns/types/index.js +3 -0
  34. package/api/resources/extractorVersions/client/Client.d.ts +6 -3
  35. package/api/resources/extractorVersions/client/Client.js +6 -3
  36. package/api/resources/index.d.ts +1 -0
  37. package/api/resources/index.js +2 -1
  38. package/api/resources/splitRuns/client/Client.d.ts +58 -0
  39. package/api/resources/splitRuns/client/Client.js +112 -1
  40. package/api/resources/splitRuns/client/requests/SplitRunsCreateBatchRequest.d.ts +38 -0
  41. package/api/resources/splitRuns/client/requests/SplitRunsCreateBatchRequest.js +3 -0
  42. package/api/resources/splitRuns/client/requests/SplitRunsListRequest.d.ts +6 -0
  43. package/api/resources/splitRuns/client/requests/index.d.ts +1 -0
  44. package/api/resources/splitRuns/types/SplitRunsCreateBatchRequestInputsItem.d.ts +6 -0
  45. package/api/resources/splitRuns/types/SplitRunsCreateBatchRequestInputsItem.js +3 -0
  46. package/api/resources/splitRuns/types/SplitRunsCreateBatchRequestInputsItemFile.d.ts +5 -0
  47. package/api/resources/splitRuns/types/SplitRunsCreateBatchRequestInputsItemFile.js +3 -0
  48. package/api/resources/splitRuns/types/SplitRunsCreateBatchRequestSplitter.d.ts +11 -0
  49. package/api/resources/splitRuns/types/SplitRunsCreateBatchRequestSplitter.js +3 -0
  50. package/api/resources/splitRuns/types/index.d.ts +3 -0
  51. package/api/resources/splitRuns/types/index.js +3 -0
  52. package/api/resources/splitterVersions/client/Client.d.ts +6 -3
  53. package/api/resources/splitterVersions/client/Client.js +6 -3
  54. package/api/resources/workflowVersions/client/Client.d.ts +6 -6
  55. package/api/resources/workflowVersions/client/Client.js +6 -6
  56. package/api/types/BatchProcessorRunCompletedWebhookEvent.d.ts +6 -0
  57. package/api/types/BatchProcessorRunCompletedWebhookEvent.js +3 -0
  58. package/api/types/BatchProcessorRunFailedWebhookEvent.d.ts +6 -0
  59. package/api/types/BatchProcessorRunFailedWebhookEvent.js +3 -0
  60. package/api/types/BatchRun.d.ts +9 -16
  61. package/api/types/BatchRunStatus.d.ts +7 -5
  62. package/api/types/BatchRunStatus.js +7 -5
  63. package/api/types/Block.d.ts +1 -0
  64. package/api/types/BlockDetails.d.ts +1 -1
  65. package/api/types/BlockType.d.ts +2 -0
  66. package/api/types/BlockType.js +2 -0
  67. package/api/types/FormulaDetails.d.ts +9 -0
  68. package/api/types/FormulaDetails.js +3 -0
  69. package/api/types/LegacyListProcessorsResponse.d.ts +1 -1
  70. package/api/types/ParseConfigAdvancedOptions.d.ts +10 -0
  71. package/api/types/ParseConfigAdvancedOptionsFormattingDetectionItem.d.ts +8 -0
  72. package/api/types/ParseConfigAdvancedOptionsFormattingDetectionItem.js +3 -0
  73. package/api/types/ParseConfigBlockOptions.d.ts +2 -0
  74. package/api/types/ParseConfigBlockOptionsFormulas.d.ts +7 -0
  75. package/api/types/ParseConfigBlockOptionsFormulas.js +3 -0
  76. package/api/types/ProcessorRunStatus.d.ts +2 -0
  77. package/api/types/ProcessorRunStatus.js +2 -0
  78. package/api/types/WebhookEndpointEventType.d.ts +2 -0
  79. package/api/types/WebhookEndpointEventType.js +2 -0
  80. package/api/types/WebhookEvent.d.ts +7 -1
  81. package/api/types/WebhookSubscriptionEventType.d.ts +5 -3
  82. package/api/types/WebhookSubscriptionEventType.js +5 -3
  83. package/api/types/index.d.ts +5 -8
  84. package/api/types/index.js +5 -8
  85. package/package.json +1 -1
  86. package/reference.md +410 -15
  87. package/version.d.ts +1 -1
  88. package/version.js +1 -1
  89. package/api/types/BatchProcessorRun.d.ts +0 -66
  90. package/api/types/BatchProcessorRunMetrics.d.ts +0 -6
  91. package/api/types/BatchProcessorRunOptions.d.ts +0 -9
  92. package/api/types/BatchProcessorRunSource.d.ts +0 -12
  93. package/api/types/BatchProcessorRunSource.js +0 -15
  94. package/api/types/BatchProcessorRunStatus.d.ts +0 -14
  95. package/api/types/BatchProcessorRunStatus.js +0 -17
  96. package/api/types/BatchRunEntity.d.ts +0 -18
  97. package/api/types/BatchRunEntityVersion.d.ts +0 -18
  98. package/api/types/BatchRunMetrics.d.ts +0 -6
  99. /package/api/{types/BatchProcessorRun.js → resources/classifyRuns/client/requests/ClassifyRunsCreateBatchRequest.js} +0 -0
  100. /package/api/{types/BatchProcessorRunMetrics.js → resources/classifyRuns/types/ClassifyRunsCreateBatchRequestClassifier.js} +0 -0
  101. /package/api/{types/BatchProcessorRunOptions.js → resources/classifyRuns/types/ClassifyRunsCreateBatchRequestInputsItem.js} +0 -0
  102. /package/api/{types/BatchRunEntity.js → resources/classifyRuns/types/ClassifyRunsCreateBatchRequestInputsItemFile.js} +0 -0
  103. /package/api/{types/BatchRunEntityVersion.js → resources/extractRuns/client/requests/ExtractRunsCreateBatchRequest.js} +0 -0
  104. /package/api/{types/BatchRunMetrics.js → resources/extractRuns/types/ExtractRunsCreateBatchRequestExtractor.js} +0 -0
package/reference.md CHANGED
@@ -1621,6 +1621,106 @@ Example: `"ex_Xj8mK2pL9nR4vT7qY5wZ"`
1621
1621
  </dl>
1622
1622
 
1623
1623
 
1624
+ </dd>
1625
+ </dl>
1626
+ </details>
1627
+
1628
+ <details><summary><code>client.extractRuns.<a href="/src/api/resources/extractRuns/client/Client.ts">createBatch</a>({ ...params }) -> Extend.BatchRun</code></summary>
1629
+ <dl>
1630
+ <dd>
1631
+
1632
+ #### 📝 Description
1633
+
1634
+ <dl>
1635
+ <dd>
1636
+
1637
+ <dl>
1638
+ <dd>
1639
+
1640
+ Submit up to **1,000 files** for extraction in a single request. Each file is processed as an independent extract run using the same extractor and configuration.
1641
+
1642
+ Unlike the single [Extract File (Async)](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/extract/create-extract-run) endpoint, this batch endpoint accepts an `inputs` array and immediately returns a `BatchRun` object containing a batch `id` and a `PENDING` status. The individual runs are then queued and processed asynchronously.
1643
+
1644
+ **Monitoring results:**
1645
+ - **Webhooks (recommended):** Subscribe to `batch_processor_run.processed` and `batch_processor_run.failed` events. The webhook payload indicates the batch has finished — fetch individual run results using `GET /extract_runs?batchId={id}`.
1646
+ - **Polling:** Call `GET /batch_runs/{id}` to check the overall batch status, and use `GET /extract_runs` filtered by `batchId` to retrieve individual run results.
1647
+
1648
+ **Notes:**
1649
+ - A processor reference (`extractor.id`) is required — inline `config` is not supported for batch requests.
1650
+ - `inputs` must contain between 1 and 1,000 items.
1651
+ - All inputs in a batch use the same extractor version and override config.
1652
+ </dd>
1653
+ </dl>
1654
+ </dd>
1655
+ </dl>
1656
+
1657
+ #### 🔌 Usage
1658
+
1659
+ <dl>
1660
+ <dd>
1661
+
1662
+ <dl>
1663
+ <dd>
1664
+
1665
+ ```typescript
1666
+ await client.extractRuns.createBatch({
1667
+ extractor: {
1668
+ id: "ex_xK9mLPqRtN3vS8wF5hB2cQ"
1669
+ },
1670
+ inputs: [{
1671
+ file: {
1672
+ url: "https://example.com/invoice1.pdf"
1673
+ },
1674
+ metadata: {
1675
+ "customerId": "cust_abc123"
1676
+ }
1677
+ }, {
1678
+ file: {
1679
+ url: "https://example.com/invoice2.pdf"
1680
+ },
1681
+ metadata: {
1682
+ "customerId": "cust_def456"
1683
+ }
1684
+ }, {
1685
+ file: {
1686
+ url: "https://example.com/invoice3.pdf"
1687
+ },
1688
+ metadata: {
1689
+ "customerId": "cust_ghi789"
1690
+ }
1691
+ }]
1692
+ });
1693
+
1694
+ ```
1695
+ </dd>
1696
+ </dl>
1697
+ </dd>
1698
+ </dl>
1699
+
1700
+ #### ⚙️ Parameters
1701
+
1702
+ <dl>
1703
+ <dd>
1704
+
1705
+ <dl>
1706
+ <dd>
1707
+
1708
+ **request:** `Extend.ExtractRunsCreateBatchRequest`
1709
+
1710
+ </dd>
1711
+ </dl>
1712
+
1713
+ <dl>
1714
+ <dd>
1715
+
1716
+ **requestOptions:** `ExtractRunsClient.RequestOptions`
1717
+
1718
+ </dd>
1719
+ </dl>
1720
+ </dd>
1721
+ </dl>
1722
+
1723
+
1624
1724
  </dd>
1625
1725
  </dl>
1626
1726
  </details>
@@ -2116,7 +2216,7 @@ Retrieve a specific version of an extractor in Extend
2116
2216
  <dd>
2117
2217
 
2118
2218
  ```typescript
2119
- await client.extractorVersions.retrieve("extractor_id_here", "extractor_version_id_here");
2219
+ await client.extractorVersions.retrieve("extractor_id_here", "draft");
2120
2220
 
2121
2221
  ```
2122
2222
  </dd>
@@ -2146,9 +2246,12 @@ Example: `"ex_Xj8mK2pL9nR4vT7qY5wZ"`
2146
2246
 
2147
2247
  **versionId:** `string`
2148
2248
 
2149
- The ID of the specific extractor version.
2249
+ The version to retrieve. Accepts any of the following:
2150
2250
 
2151
- Example: `"extv_QYk6jgHA_8CsO8rVWhyNC"`
2251
+ - `"draft"` — returns the current draft version
2252
+ - `"latest"` — returns the latest published version (falls back to draft if none published)
2253
+ - A version number (e.g. `"0.1"`, `"1.0"`) — returns that specific published version
2254
+ - A version ID (e.g. `"extv_QYk6jgHA_8CsO8rVWhyNC"`) — returns that specific version by ID
2152
2255
 
2153
2256
  </dd>
2154
2257
  </dl>
@@ -2539,6 +2642,106 @@ Example: `"cl_Xj8mK2pL9nR4vT7qY5wZ"`
2539
2642
  </dl>
2540
2643
 
2541
2644
 
2645
+ </dd>
2646
+ </dl>
2647
+ </details>
2648
+
2649
+ <details><summary><code>client.classifyRuns.<a href="/src/api/resources/classifyRuns/client/Client.ts">createBatch</a>({ ...params }) -> Extend.BatchRun</code></summary>
2650
+ <dl>
2651
+ <dd>
2652
+
2653
+ #### 📝 Description
2654
+
2655
+ <dl>
2656
+ <dd>
2657
+
2658
+ <dl>
2659
+ <dd>
2660
+
2661
+ Submit up to **1,000 files** for classification in a single request. Each file is processed as an independent classify run using the same classifier and configuration.
2662
+
2663
+ Unlike the single [Classify File (Async)](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/classify/create-classify-run) endpoint, this batch endpoint accepts an `inputs` array and immediately returns a `BatchRun` object containing a batch `id` and a `PENDING` status. The individual runs are then queued and processed asynchronously.
2664
+
2665
+ **Monitoring results:**
2666
+ - **Webhooks (recommended):** Subscribe to `batch_processor_run.processed` and `batch_processor_run.failed` events. The webhook payload indicates the batch has finished — fetch individual run results using `GET /classify_runs?batchId={id}`.
2667
+ - **Polling:** Call `GET /batch_runs/{id}` to check the overall batch status, and use `GET /classify_runs` filtered by `batchId` to retrieve individual run results.
2668
+
2669
+ **Notes:**
2670
+ - A processor reference (`classifier.id`) is required — inline `config` is not supported for batch requests.
2671
+ - `inputs` must contain between 1 and 1,000 items.
2672
+ - All inputs in a batch use the same classifier version and override config.
2673
+ </dd>
2674
+ </dl>
2675
+ </dd>
2676
+ </dl>
2677
+
2678
+ #### 🔌 Usage
2679
+
2680
+ <dl>
2681
+ <dd>
2682
+
2683
+ <dl>
2684
+ <dd>
2685
+
2686
+ ```typescript
2687
+ await client.classifyRuns.createBatch({
2688
+ classifier: {
2689
+ id: "cl_xK9mLPqRtN3vS8wF5hB2cQ"
2690
+ },
2691
+ inputs: [{
2692
+ file: {
2693
+ url: "https://example.com/document1.pdf"
2694
+ },
2695
+ metadata: {
2696
+ "customerId": "cust_abc123"
2697
+ }
2698
+ }, {
2699
+ file: {
2700
+ url: "https://example.com/document2.pdf"
2701
+ },
2702
+ metadata: {
2703
+ "customerId": "cust_def456"
2704
+ }
2705
+ }, {
2706
+ file: {
2707
+ url: "https://example.com/document3.pdf"
2708
+ },
2709
+ metadata: {
2710
+ "customerId": "cust_ghi789"
2711
+ }
2712
+ }]
2713
+ });
2714
+
2715
+ ```
2716
+ </dd>
2717
+ </dl>
2718
+ </dd>
2719
+ </dl>
2720
+
2721
+ #### ⚙️ Parameters
2722
+
2723
+ <dl>
2724
+ <dd>
2725
+
2726
+ <dl>
2727
+ <dd>
2728
+
2729
+ **request:** `Extend.ClassifyRunsCreateBatchRequest`
2730
+
2731
+ </dd>
2732
+ </dl>
2733
+
2734
+ <dl>
2735
+ <dd>
2736
+
2737
+ **requestOptions:** `ClassifyRunsClient.RequestOptions`
2738
+
2739
+ </dd>
2740
+ </dl>
2741
+ </dd>
2742
+ </dl>
2743
+
2744
+
2542
2745
  </dd>
2543
2746
  </dl>
2544
2747
  </details>
@@ -3030,7 +3233,7 @@ Retrieve a specific version of a classifier in Extend
3030
3233
  <dd>
3031
3234
 
3032
3235
  ```typescript
3033
- await client.classifierVersions.retrieve("classifier_id_here", "classifier_version_id_here");
3236
+ await client.classifierVersions.retrieve("classifier_id_here", "draft");
3034
3237
 
3035
3238
  ```
3036
3239
  </dd>
@@ -3060,9 +3263,12 @@ Example: `"cl_Xj8mK2pL9nR4vT7qY5wZ"`
3060
3263
 
3061
3264
  **versionId:** `string`
3062
3265
 
3063
- The ID of the specific classifier version.
3266
+ The version to retrieve. Accepts any of the following:
3064
3267
 
3065
- Example: `"clsv_QYk6jgHA_8CsO8rVWhyNC"`
3268
+ - `"draft"` — returns the current draft version
3269
+ - `"latest"` — returns the latest published version (falls back to draft if none published)
3270
+ - A version number (e.g. `"0.1"`, `"1.0"`) — returns that specific published version
3271
+ - A version ID (e.g. `"clsv_QYk6jgHA_8CsO8rVWhyNC"`) — returns that specific version by ID
3066
3272
 
3067
3273
  </dd>
3068
3274
  </dl>
@@ -3453,6 +3659,107 @@ Example: `"spl_Xj8mK2pL9nR4vT7qY5wZ"`
3453
3659
  </dl>
3454
3660
 
3455
3661
 
3662
+ </dd>
3663
+ </dl>
3664
+ </details>
3665
+
3666
+ <details><summary><code>client.splitRuns.<a href="/src/api/resources/splitRuns/client/Client.ts">createBatch</a>({ ...params }) -> Extend.BatchRun</code></summary>
3667
+ <dl>
3668
+ <dd>
3669
+
3670
+ #### 📝 Description
3671
+
3672
+ <dl>
3673
+ <dd>
3674
+
3675
+ <dl>
3676
+ <dd>
3677
+
3678
+ Submit up to **1,000 files** for splitting in a single request. Each file is processed as an independent split run using the same splitter and configuration.
3679
+
3680
+ Unlike the single [Split File (Async)](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/split/create-split-run) endpoint, this batch endpoint accepts an `inputs` array and immediately returns a `BatchRun` object containing a batch `id` and a `PENDING` status. The individual runs are then queued and processed asynchronously.
3681
+
3682
+ **Monitoring results:**
3683
+ - **Webhooks (recommended):** Subscribe to `batch_processor_run.processed` and `batch_processor_run.failed` events. The webhook payload indicates the batch has finished — fetch individual run results using `GET /split_runs?batchId={id}`.
3684
+ - **Polling:** Call `GET /batch_runs/{id}` to check the overall batch status, and use `GET /split_runs` filtered by `batchId` to retrieve individual run results.
3685
+
3686
+ **Notes:**
3687
+ - A processor reference (`splitter.id`) is required — inline `config` is not supported for batch requests.
3688
+ - `inputs` must contain between 1 and 1,000 items.
3689
+ - All inputs in a batch use the same splitter version and override config.
3690
+ - Raw text input (`FileFromText`) is not supported for split runs. Use a URL or file ID.
3691
+ </dd>
3692
+ </dl>
3693
+ </dd>
3694
+ </dl>
3695
+
3696
+ #### 🔌 Usage
3697
+
3698
+ <dl>
3699
+ <dd>
3700
+
3701
+ <dl>
3702
+ <dd>
3703
+
3704
+ ```typescript
3705
+ await client.splitRuns.createBatch({
3706
+ splitter: {
3707
+ id: "spl_xK9mLPqRtN3vS8wF5hB2cQ"
3708
+ },
3709
+ inputs: [{
3710
+ file: {
3711
+ url: "https://example.com/multi-doc1.pdf"
3712
+ },
3713
+ metadata: {
3714
+ "customerId": "cust_abc123"
3715
+ }
3716
+ }, {
3717
+ file: {
3718
+ url: "https://example.com/multi-doc2.pdf"
3719
+ },
3720
+ metadata: {
3721
+ "customerId": "cust_def456"
3722
+ }
3723
+ }, {
3724
+ file: {
3725
+ url: "https://example.com/multi-doc3.pdf"
3726
+ },
3727
+ metadata: {
3728
+ "customerId": "cust_ghi789"
3729
+ }
3730
+ }]
3731
+ });
3732
+
3733
+ ```
3734
+ </dd>
3735
+ </dl>
3736
+ </dd>
3737
+ </dl>
3738
+
3739
+ #### ⚙️ Parameters
3740
+
3741
+ <dl>
3742
+ <dd>
3743
+
3744
+ <dl>
3745
+ <dd>
3746
+
3747
+ **request:** `Extend.SplitRunsCreateBatchRequest`
3748
+
3749
+ </dd>
3750
+ </dl>
3751
+
3752
+ <dl>
3753
+ <dd>
3754
+
3755
+ **requestOptions:** `SplitRunsClient.RequestOptions`
3756
+
3757
+ </dd>
3758
+ </dl>
3759
+ </dd>
3760
+ </dl>
3761
+
3762
+
3456
3763
  </dd>
3457
3764
  </dl>
3458
3765
  </details>
@@ -3946,7 +4253,7 @@ Retrieve a specific version of a splitter in Extend
3946
4253
  <dd>
3947
4254
 
3948
4255
  ```typescript
3949
- await client.splitterVersions.retrieve("splitter_id_here", "splitter_version_id_here");
4256
+ await client.splitterVersions.retrieve("splitter_id_here", "draft");
3950
4257
 
3951
4258
  ```
3952
4259
  </dd>
@@ -3976,9 +4283,12 @@ Example: `"spl_Xj8mK2pL9nR4vT7qY5wZ"`
3976
4283
 
3977
4284
  **versionId:** `string`
3978
4285
 
3979
- The ID of the specific splitter version.
4286
+ The version to retrieve. Accepts any of the following:
3980
4287
 
3981
- Example: `"splv_QYk6jgHA_8CsO8rVWhyNC"`
4288
+ - `"draft"` — returns the current draft version
4289
+ - `"latest"` — returns the latest published version (falls back to draft if none published)
4290
+ - A version number (e.g. `"0.1"`, `"1.0"`) — returns that specific published version
4291
+ - A version ID (e.g. `"splv_QYk6jgHA_8CsO8rVWhyNC"`) — returns that specific version by ID
3982
4292
 
3983
4293
  </dd>
3984
4294
  </dl>
@@ -4439,11 +4749,6 @@ await client.workflowVersions.create("workflow_abc123");
4439
4749
  <dd>
4440
4750
 
4441
4751
  Get a specific version of a workflow, including its step definitions.
4442
-
4443
- The `versionId` parameter accepts:
4444
- - `"draft"` — returns the current draft version
4445
- - A version number (e.g. `"1"`, `"2"`) — returns that deployed version
4446
- - An internal version ID (e.g. `"workflow_version_abc123"`) — returns that specific version
4447
4752
  </dd>
4448
4753
  </dl>
4449
4754
  </dd>
@@ -4482,7 +4787,14 @@ await client.workflowVersions.retrieve("workflow_abc123", "draft");
4482
4787
  <dl>
4483
4788
  <dd>
4484
4789
 
4485
- **versionId:** `string` — The version to retrieve. Use `"draft"` for the draft, a number like `"1"` for a deployed version, or the internal version ID.
4790
+ **versionId:** `string`
4791
+
4792
+ The version to retrieve. Accepts any of the following:
4793
+
4794
+ - `"draft"` — returns the current draft version
4795
+ - `"latest"` — returns the latest published version (falls back to draft if none published)
4796
+ - A version number (e.g. `"1"`, `"2"`) — returns that specific published version
4797
+ - A version ID (e.g. `"workflow_version_abc123"`) — returns that specific version by ID
4486
4798
 
4487
4799
  </dd>
4488
4800
  </dl>
@@ -5938,6 +6250,89 @@ Example: `"bpr_Xj8mK2pL9nR4vT7qY5wZ"`
5938
6250
  </dl>
5939
6251
 
5940
6252
 
6253
+ </dd>
6254
+ </dl>
6255
+ </details>
6256
+
6257
+ ## BatchRuns
6258
+ <details><summary><code>client.batchRuns.<a href="/src/api/resources/batchRuns/client/Client.ts">get</a>(id) -> Extend.BatchRun</code></summary>
6259
+ <dl>
6260
+ <dd>
6261
+
6262
+ #### 📝 Description
6263
+
6264
+ <dl>
6265
+ <dd>
6266
+
6267
+ <dl>
6268
+ <dd>
6269
+
6270
+ Retrieve the status of a batch run by its ID. The `status` field reflects the aggregate state of the batch.
6271
+
6272
+ This is a unified endpoint that works for batches created via any of the batch submission endpoints (`POST /extract_runs/batch`, `POST /classify_runs/batch`, `POST /split_runs/batch`).
6273
+
6274
+ | Status | Meaning |
6275
+ |---|---|
6276
+ | `PENDING` | Queued, not yet started |
6277
+ | `PROCESSING` | Runs are actively being processed |
6278
+ | `PROCESSED` | All runs have completed |
6279
+ | `FAILED` | The batch encountered a fatal error |
6280
+ | `CANCELLED` | The batch was cancelled |
6281
+
6282
+ To retrieve individual run results, use the List endpoint for the relevant processor type filtered by `batchId`:
6283
+ - `GET /extract_runs?batchId={id}`
6284
+ - `GET /classify_runs?batchId={id}`
6285
+ - `GET /split_runs?batchId={id}`
6286
+ </dd>
6287
+ </dl>
6288
+ </dd>
6289
+ </dl>
6290
+
6291
+ #### 🔌 Usage
6292
+
6293
+ <dl>
6294
+ <dd>
6295
+
6296
+ <dl>
6297
+ <dd>
6298
+
6299
+ ```typescript
6300
+ await client.batchRuns.get("bpr_Xj8mK2pL9nR4vT7qY5wZ");
6301
+
6302
+ ```
6303
+ </dd>
6304
+ </dl>
6305
+ </dd>
6306
+ </dl>
6307
+
6308
+ #### ⚙️ Parameters
6309
+
6310
+ <dl>
6311
+ <dd>
6312
+
6313
+ <dl>
6314
+ <dd>
6315
+
6316
+ **id:** `string`
6317
+
6318
+ The unique identifier of the batch processor run to retrieve.
6319
+
6320
+ Example: `"bpr_Xj8mK2pL9nR4vT7qY5wZ"`
6321
+
6322
+ </dd>
6323
+ </dl>
6324
+
6325
+ <dl>
6326
+ <dd>
6327
+
6328
+ **requestOptions:** `BatchRunsClient.RequestOptions`
6329
+
6330
+ </dd>
6331
+ </dl>
6332
+ </dd>
6333
+ </dl>
6334
+
6335
+
5941
6336
  </dd>
5942
6337
  </dl>
5943
6338
  </details>
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.7.0";
1
+ export declare const SDK_VERSION = "1.8.0";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.7.0";
4
+ exports.SDK_VERSION = "1.8.0";
@@ -1,66 +0,0 @@
1
- import type * as Extend from "../index";
2
- export interface BatchProcessorRun {
3
- /** The type of response. In this case, it will always be `"batch_processor_run"`. */
4
- object: string;
5
- /**
6
- * The unique identifier for this batch processor run.
7
- *
8
- * Example: `"batch_processor_run_Xj8mK2pL9nR4vT7qY5wZ"`
9
- */
10
- id: string;
11
- /**
12
- * The ID of the processor used for this run.
13
- *
14
- * Example: `"ex_Xj8mK2pL9nR4vT7qY5wZ"`
15
- */
16
- processorId: string;
17
- /**
18
- * The ID of the specific processor version used.
19
- *
20
- * Example: `"exv_xK9mLPqRtN3vS8wF5hB2cQ"`
21
- */
22
- processorVersionId: string;
23
- /**
24
- * The name of the processor.
25
- *
26
- * Example: `"Invoice Processor"`
27
- */
28
- processorName: string;
29
- metrics: Extend.BatchProcessorRunMetrics;
30
- /**
31
- * The current status of the batch processor run:
32
- * * `"PENDING"` - The batch processor run is waiting to start
33
- * * `"PROCESSING"` - The batch processor run is in progress
34
- * * `"PROCESSED"` - The batch processor run completed successfully
35
- * * `"FAILED"` - The batch processor run encountered an error
36
- */
37
- status: Extend.BatchProcessorRunStatus;
38
- /**
39
- * The source of the batch processor run:
40
- * * `"EVAL_SET"` - The batch processor run was made from an evaluation set. The `sourceId` will be the ID of the evaluation set (e.g., `"ev_1234"`)
41
- * * `"PLAYGROUND"` - The batch processor run was made from the playground. The `sourceId` will not be set
42
- * * `"STUDIO"` - The batch processor run was made for a processor in Studio. The `sourceId` will be the ID of the processor (e.g., `"ex_1234"`)
43
- */
44
- source: Extend.BatchProcessorRunSource;
45
- /**
46
- * The ID of the source of the batch processor run. See the `source` field for more details.
47
- * Example: `"ev_1234"` for EVAL_SET source, `"ex_1234"` for STUDIO source
48
- */
49
- sourceId?: string;
50
- /** The number of runs that were made. */
51
- runCount: number;
52
- /** The options for the batch processor run. */
53
- options: Extend.BatchProcessorRunOptions;
54
- /**
55
- * The time (in UTC) at which the batch processor run was created. Will follow the RFC 3339 format.
56
- *
57
- * Example: `"2024-03-21T15:30:00Z"`
58
- */
59
- createdAt: string;
60
- /**
61
- * The time (in UTC) at which the batch processor run was last updated. Will follow the RFC 3339 format.
62
- *
63
- * Example: `"2024-03-21T16:45:00Z"`
64
- */
65
- updatedAt: string;
66
- }
@@ -1,6 +0,0 @@
1
- export interface BatchProcessorRunMetrics {
2
- /** The total number of files processed in this batch run */
3
- numFiles?: number;
4
- /** The total number of pages processed in this batch run */
5
- numPages?: number;
6
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * The options for the batch processor run.
3
- */
4
- export interface BatchProcessorRunOptions {
5
- /** The fields that were fuzzy matched. */
6
- fuzzyMatchFields?: string[];
7
- /** The fields that were excluded from the run. */
8
- excludeFields?: string[];
9
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * The source of the batch processor run:
3
- * * `"EVAL_SET"` - The batch processor run was made from an evaluation set. The `sourceId` will be the ID of the evaluation set (e.g., `"ev_1234"`)
4
- * * `"PLAYGROUND"` - The batch processor run was made from the playground. The `sourceId` will not be set
5
- * * `"STUDIO"` - The batch processor run was made for a processor in Studio. The `sourceId` will be the ID of the processor (e.g., `"ex_1234"`)
6
- */
7
- export declare const BatchProcessorRunSource: {
8
- readonly EvalSet: "EVAL_SET";
9
- readonly Playground: "PLAYGROUND";
10
- readonly Studio: "STUDIO";
11
- };
12
- export type BatchProcessorRunSource = (typeof BatchProcessorRunSource)[keyof typeof BatchProcessorRunSource] | string;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.BatchProcessorRunSource = void 0;
5
- /**
6
- * The source of the batch processor run:
7
- * * `"EVAL_SET"` - The batch processor run was made from an evaluation set. The `sourceId` will be the ID of the evaluation set (e.g., `"ev_1234"`)
8
- * * `"PLAYGROUND"` - The batch processor run was made from the playground. The `sourceId` will not be set
9
- * * `"STUDIO"` - The batch processor run was made for a processor in Studio. The `sourceId` will be the ID of the processor (e.g., `"ex_1234"`)
10
- */
11
- exports.BatchProcessorRunSource = {
12
- EvalSet: "EVAL_SET",
13
- Playground: "PLAYGROUND",
14
- Studio: "STUDIO",
15
- };
@@ -1,14 +0,0 @@
1
- /**
2
- * The current status of the batch processor run:
3
- * * `"PENDING"` - The batch processor run is waiting to start
4
- * * `"PROCESSING"` - The batch processor run is in progress
5
- * * `"PROCESSED"` - The batch processor run completed successfully
6
- * * `"FAILED"` - The batch processor run encountered an error
7
- */
8
- export declare const BatchProcessorRunStatus: {
9
- readonly Pending: "PENDING";
10
- readonly Processing: "PROCESSING";
11
- readonly Processed: "PROCESSED";
12
- readonly Failed: "FAILED";
13
- };
14
- export type BatchProcessorRunStatus = (typeof BatchProcessorRunStatus)[keyof typeof BatchProcessorRunStatus] | string;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.BatchProcessorRunStatus = void 0;
5
- /**
6
- * The current status of the batch processor run:
7
- * * `"PENDING"` - The batch processor run is waiting to start
8
- * * `"PROCESSING"` - The batch processor run is in progress
9
- * * `"PROCESSED"` - The batch processor run completed successfully
10
- * * `"FAILED"` - The batch processor run encountered an error
11
- */
12
- exports.BatchProcessorRunStatus = {
13
- Pending: "PENDING",
14
- Processing: "PROCESSING",
15
- Processed: "PROCESSED",
16
- Failed: "FAILED",
17
- };
@@ -1,18 +0,0 @@
1
- import type * as Extend from "../index";
2
- /**
3
- * The extractor, classifier, or splitter that was run.
4
- *
5
- * **Availability:** Present when an entity was provided when creating the batch run.
6
- */
7
- export type BatchRunEntity = Extend.BatchRunEntity.Extractor | Extend.BatchRunEntity.Classifier | Extend.BatchRunEntity.Splitter;
8
- export declare namespace BatchRunEntity {
9
- interface Extractor extends Extend.ExtractorSummary {
10
- object: "extractor";
11
- }
12
- interface Classifier extends Extend.ClassifierSummary {
13
- object: "classifier";
14
- }
15
- interface Splitter extends Extend.SplitterSummary {
16
- object: "splitter";
17
- }
18
- }