extend-ai 1.8.0 → 1.10.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/BaseClient.js +2 -2
- package/Client.d.ts +3 -0
- package/Client.js +43 -38
- package/api/resources/batchRuns/client/Client.d.ts +3 -2
- package/api/resources/batchRuns/client/Client.js +3 -2
- package/api/resources/editTemplates/client/Client.d.ts +38 -0
- package/api/resources/editTemplates/client/Client.js +137 -0
- package/api/resources/editTemplates/client/index.d.ts +1 -0
- package/api/resources/editTemplates/client/index.js +17 -0
- package/api/resources/editTemplates/client/requests/EditTemplatesRetrieveRequest.d.ts +8 -0
- package/api/resources/editTemplates/client/requests/EditTemplatesRetrieveRequest.js +3 -0
- package/api/resources/editTemplates/client/requests/index.d.ts +1 -0
- package/api/resources/editTemplates/client/requests/index.js +2 -0
- package/api/resources/editTemplates/index.d.ts +1 -0
- package/api/resources/editTemplates/index.js +17 -0
- package/api/resources/index.d.ts +2 -0
- package/api/resources/index.js +3 -1
- package/api/resources/parseRuns/client/Client.d.ts +77 -0
- package/api/resources/parseRuns/client/Client.js +191 -0
- package/api/resources/parseRuns/client/requests/ParseRunsCreateBatchRequest.d.ts +35 -0
- package/api/resources/parseRuns/client/requests/ParseRunsCreateBatchRequest.js +3 -0
- package/api/resources/parseRuns/client/requests/ParseRunsListRequest.d.ts +35 -0
- package/api/resources/parseRuns/client/requests/ParseRunsListRequest.js +3 -0
- package/api/resources/parseRuns/client/requests/index.d.ts +2 -0
- package/api/resources/parseRuns/types/ParseRunsCreateBatchRequestInputsItem.d.ts +6 -0
- package/api/resources/parseRuns/types/ParseRunsCreateBatchRequestInputsItem.js +3 -0
- package/api/resources/parseRuns/types/ParseRunsCreateBatchRequestInputsItemFile.d.ts +5 -0
- package/api/resources/parseRuns/types/ParseRunsCreateBatchRequestInputsItemFile.js +3 -0
- package/api/resources/parseRuns/types/ParseRunsListRequestStatus.d.ts +7 -0
- package/api/resources/parseRuns/types/ParseRunsListRequestStatus.js +10 -0
- package/api/resources/parseRuns/types/ParseRunsListResponse.d.ts +6 -0
- package/api/resources/parseRuns/types/ParseRunsListResponse.js +3 -0
- package/api/resources/parseRuns/types/index.d.ts +4 -0
- package/api/resources/parseRuns/types/index.js +4 -0
- package/api/resources/webhookEndpoints/client/Client.d.ts +1 -1
- package/api/resources/webhookEndpoints/client/Client.js +1 -1
- package/api/resources/webhookEndpoints/client/requests/WebhookEndpointsCreateRequest.d.ts +1 -1
- package/api/types/ApiVersionEnum.d.ts +1 -9
- package/api/types/ApiVersionEnum.js +0 -9
- package/api/types/BatchParseRunCompletedWebhookEvent.d.ts +6 -0
- package/api/types/BatchParseRunCompletedWebhookEvent.js +3 -0
- package/api/types/BatchParseRunFailedWebhookEvent.d.ts +6 -0
- package/api/types/BatchParseRunFailedWebhookEvent.js +3 -0
- package/api/types/BatchRun.d.ts +1 -1
- package/api/types/ClassifyRun.d.ts +2 -4
- package/api/types/ClassifyRunSummary.d.ts +3 -5
- package/api/types/EditConfigAdvancedOptions.d.ts +1 -1
- package/api/types/EditRun.d.ts +1 -1
- package/api/types/EditTemplate.d.ts +26 -0
- package/api/types/EditTemplate.js +3 -0
- package/api/types/ExtractAdvancedOptions.d.ts +2 -0
- package/api/types/ExtractRun.d.ts +2 -2
- package/api/types/ExtractRunSummary.d.ts +3 -3
- package/api/types/ParseRun.d.ts +11 -2
- package/api/types/ParseRunSource.d.ts +20 -0
- package/api/types/ParseRunSource.js +23 -0
- package/api/types/ParseRunStatus.d.ts +6 -0
- package/api/types/ParseRunStatusEnum.d.ts +2 -0
- package/api/types/ParseRunStatusEnum.js +2 -0
- package/api/types/RunUsage.d.ts +14 -1
- package/api/types/RunUsageBreakdownEntry.d.ts +12 -0
- package/api/types/RunUsageBreakdownEntry.js +3 -0
- package/api/types/RunUsageBreakdownEntryObject.d.ts +9 -0
- package/api/types/RunUsageBreakdownEntryObject.js +12 -0
- package/api/types/RunUsageSummary.d.ts +19 -0
- package/api/types/RunUsageSummary.js +3 -0
- package/api/types/SplitRun.d.ts +2 -2
- package/api/types/SplitRunSummary.d.ts +3 -3
- package/api/types/WebhookEndpointEventType.d.ts +2 -0
- package/api/types/WebhookEndpointEventType.js +2 -0
- package/api/types/WebhookEvent.d.ts +7 -1
- package/api/types/WorkflowRun.d.ts +5 -0
- package/api/types/WorkflowRunSummary.d.ts +6 -1
- package/api/types/index.d.ts +7 -0
- package/api/types/index.js +7 -0
- package/package.json +1 -1
- package/reference.md +245 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The source that created the parse run:
|
|
3
|
+
* * `"API"` - Created via API
|
|
4
|
+
* * `"STUDIO"` - Created from Studio
|
|
5
|
+
* * `"WORKFLOW_RUN"` - Created from a workflow run
|
|
6
|
+
* * `"ADMIN"` - Created by admin
|
|
7
|
+
* * `"BATCH_PARSER_RUN"` - Created from a batch parse run (via `POST /parse_runs/batch`)
|
|
8
|
+
* * `"EDIT_RUN"` - Created from an edit run
|
|
9
|
+
* * `"DOCUMENT_PROCESSOR_RUN"` - Created from a document processor run
|
|
10
|
+
*/
|
|
11
|
+
export declare const ParseRunSource: {
|
|
12
|
+
readonly Api: "API";
|
|
13
|
+
readonly Studio: "STUDIO";
|
|
14
|
+
readonly WorkflowRun: "WORKFLOW_RUN";
|
|
15
|
+
readonly Admin: "ADMIN";
|
|
16
|
+
readonly BatchParserRun: "BATCH_PARSER_RUN";
|
|
17
|
+
readonly EditRun: "EDIT_RUN";
|
|
18
|
+
readonly DocumentProcessorRun: "DOCUMENT_PROCESSOR_RUN";
|
|
19
|
+
};
|
|
20
|
+
export type ParseRunSource = (typeof ParseRunSource)[keyof typeof ParseRunSource] | string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ParseRunSource = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* The source that created the parse run:
|
|
7
|
+
* * `"API"` - Created via API
|
|
8
|
+
* * `"STUDIO"` - Created from Studio
|
|
9
|
+
* * `"WORKFLOW_RUN"` - Created from a workflow run
|
|
10
|
+
* * `"ADMIN"` - Created by admin
|
|
11
|
+
* * `"BATCH_PARSER_RUN"` - Created from a batch parse run (via `POST /parse_runs/batch`)
|
|
12
|
+
* * `"EDIT_RUN"` - Created from an edit run
|
|
13
|
+
* * `"DOCUMENT_PROCESSOR_RUN"` - Created from a document processor run
|
|
14
|
+
*/
|
|
15
|
+
exports.ParseRunSource = {
|
|
16
|
+
Api: "API",
|
|
17
|
+
Studio: "STUDIO",
|
|
18
|
+
WorkflowRun: "WORKFLOW_RUN",
|
|
19
|
+
Admin: "ADMIN",
|
|
20
|
+
BatchParserRun: "BATCH_PARSER_RUN",
|
|
21
|
+
EditRun: "EDIT_RUN",
|
|
22
|
+
DocumentProcessorRun: "DOCUMENT_PROCESSOR_RUN",
|
|
23
|
+
};
|
|
@@ -31,4 +31,10 @@ export interface ParseRunStatus {
|
|
|
31
31
|
* **Availability:** Present when `status` is `"FAILED"`.
|
|
32
32
|
*/
|
|
33
33
|
failureMessage?: string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Any metadata that was provided when creating the parse run.
|
|
36
|
+
*
|
|
37
|
+
* **Availability:** Present when metadata was provided during creation.
|
|
38
|
+
*/
|
|
39
|
+
metadata?: Extend.RunMetadata | null;
|
|
34
40
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The status of the parse run:
|
|
3
|
+
* * `"PENDING"` - The run has been created and is waiting to be processed. Only applies to runs created via `POST /parse_runs/batch`.
|
|
3
4
|
* * `"PROCESSING"` - The file is still being processed
|
|
4
5
|
* * `"PROCESSED"` - The file was successfully processed
|
|
5
6
|
* * `"FAILED"` - The processing failed (see `failureReason` for details)
|
|
6
7
|
*/
|
|
7
8
|
export declare const ParseRunStatusEnum: {
|
|
9
|
+
readonly Pending: "PENDING";
|
|
8
10
|
readonly Processing: "PROCESSING";
|
|
9
11
|
readonly Processed: "PROCESSED";
|
|
10
12
|
readonly Failed: "FAILED";
|
|
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.ParseRunStatusEnum = void 0;
|
|
5
5
|
/**
|
|
6
6
|
* The status of the parse run:
|
|
7
|
+
* * `"PENDING"` - The run has been created and is waiting to be processed. Only applies to runs created via `POST /parse_runs/batch`.
|
|
7
8
|
* * `"PROCESSING"` - The file is still being processed
|
|
8
9
|
* * `"PROCESSED"` - The file was successfully processed
|
|
9
10
|
* * `"FAILED"` - The processing failed (see `failureReason` for details)
|
|
10
11
|
*/
|
|
11
12
|
exports.ParseRunStatusEnum = {
|
|
13
|
+
Pending: "PENDING",
|
|
12
14
|
Processing: "PROCESSING",
|
|
13
15
|
Processed: "PROCESSED",
|
|
14
16
|
Failed: "FAILED",
|
package/api/types/RunUsage.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as Extend from "../index";
|
|
1
2
|
/**
|
|
2
3
|
* Usage credits consumed by a run.
|
|
3
4
|
*
|
|
@@ -8,6 +9,18 @@
|
|
|
8
9
|
* For more details on how credits work, see our [Credits Guide](https://docs.extend.ai/2026-02-09/product/general/how-credits-work).
|
|
9
10
|
*/
|
|
10
11
|
export interface RunUsage {
|
|
11
|
-
/** The
|
|
12
|
+
/** The credits consumed by this run. For most run types this is the line item for the run's own work; for `workflow_run` this is the aggregate across all child runs. */
|
|
12
13
|
credits: number;
|
|
14
|
+
/**
|
|
15
|
+
* The total credits accounted for under this run, including any other runs it was responsible for creating. For example, an extract run on a fresh upload triggers a parse run, so `totalCredits` includes both line items. For runs that didn't trigger any other work — like `parse_run`, `edit_run` and `workflow_run` — `totalCredits` equals `credits`.
|
|
16
|
+
*
|
|
17
|
+
* **Availability:** Present on runs persisted on or after May 14, 2026. Runs persisted before that date will omit this field.
|
|
18
|
+
*/
|
|
19
|
+
totalCredits?: number;
|
|
20
|
+
/**
|
|
21
|
+
* The chargeable resources that make up `totalCredits`, including this run itself when it has its own line item. For `workflow_run`, lists every contributing child run sorted by creation time (the workflow itself isn't chargeable and has no line item).
|
|
22
|
+
*
|
|
23
|
+
* **Availability:** Present on runs persisted on or after May 14, 2026. Runs persisted before that date will omit this field.
|
|
24
|
+
*/
|
|
25
|
+
breakdown?: Extend.RunUsageBreakdownEntry[];
|
|
13
26
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as Extend from "../index";
|
|
2
|
+
/**
|
|
3
|
+
* One line item in a run's `usage.breakdown`. Each entry corresponds to a concrete chargeable resource that contributed credits to the parent operation.
|
|
4
|
+
*/
|
|
5
|
+
export interface RunUsageBreakdownEntry {
|
|
6
|
+
/** The public object type of the contributing resource. Mirrors the top-level `object` field on the corresponding endpoint so callers can fetch the underlying resource by id if they want more detail. */
|
|
7
|
+
object: Extend.RunUsageBreakdownEntryObject;
|
|
8
|
+
/** The id of the contributing resource (e.g. `pr_3UZSj69pYZDKHFuuX57ic`). */
|
|
9
|
+
id: string;
|
|
10
|
+
/** Credits charged to the contributing resource. */
|
|
11
|
+
credits: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The public object type of the contributing resource. Mirrors the top-level `object` field on the corresponding endpoint so callers can fetch the underlying resource by id if they want more detail. */
|
|
2
|
+
export declare const RunUsageBreakdownEntryObject: {
|
|
3
|
+
readonly ExtractRun: "extract_run";
|
|
4
|
+
readonly ClassifyRun: "classify_run";
|
|
5
|
+
readonly SplitRun: "split_run";
|
|
6
|
+
readonly ParseRun: "parse_run";
|
|
7
|
+
readonly EditRun: "edit_run";
|
|
8
|
+
};
|
|
9
|
+
export type RunUsageBreakdownEntryObject = (typeof RunUsageBreakdownEntryObject)[keyof typeof RunUsageBreakdownEntryObject] | string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.RunUsageBreakdownEntryObject = void 0;
|
|
5
|
+
/** The public object type of the contributing resource. Mirrors the top-level `object` field on the corresponding endpoint so callers can fetch the underlying resource by id if they want more detail. */
|
|
6
|
+
exports.RunUsageBreakdownEntryObject = {
|
|
7
|
+
ExtractRun: "extract_run",
|
|
8
|
+
ClassifyRun: "classify_run",
|
|
9
|
+
SplitRun: "split_run",
|
|
10
|
+
ParseRun: "parse_run",
|
|
11
|
+
EditRun: "edit_run",
|
|
12
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Usage credits consumed by a run. Omits `breakdown` - fetch the full resource by id when you need the breakdown.
|
|
3
|
+
*
|
|
4
|
+
* **Availability:** This field will not be returned for:
|
|
5
|
+
* * Runs created before October 7, 2025
|
|
6
|
+
* * Customers on legacy billing systems
|
|
7
|
+
*
|
|
8
|
+
* For more details on how credits work, see our [Credits Guide](https://docs.extend.ai/2026-02-09/product/general/how-credits-work).
|
|
9
|
+
*/
|
|
10
|
+
export interface RunUsageSummary {
|
|
11
|
+
/** The credits consumed by this run. For most run types this is the line item for the run's own work; for `workflow_run` this is the aggregate across all child runs. */
|
|
12
|
+
credits: number;
|
|
13
|
+
/**
|
|
14
|
+
* The total credits accounted for under this run, including any other runs it was responsible for creating. For example, an extract run on a fresh upload triggers a parse run, so `totalCredits` includes both line items. For runs that didn't trigger any other work — like `parse_run`, `edit_run`, and `workflow_run` — `totalCredits` equals `credits`.
|
|
15
|
+
*
|
|
16
|
+
* **Availability:** Present on runs persisted on or after May 14, 2026. Runs persisted before that date will omit this field.
|
|
17
|
+
*/
|
|
18
|
+
totalCredits?: number;
|
|
19
|
+
}
|
package/api/types/SplitRun.d.ts
CHANGED
|
@@ -90,9 +90,9 @@ export interface SplitRun {
|
|
|
90
90
|
/** The URL to view the split run in the Extend dashboard. */
|
|
91
91
|
dashboardUrl: string;
|
|
92
92
|
/**
|
|
93
|
-
* Usage credits consumed by this run.
|
|
93
|
+
* Usage credits consumed by this split run.
|
|
94
94
|
*
|
|
95
|
-
* **Availability:** Present when `status` is `"PROCESSED"`.
|
|
95
|
+
* **Availability:** Present when `status` is `"PROCESSED"`. Will not be returned for runs created before October 7, 2025 or for customers on legacy billing systems.
|
|
96
96
|
*/
|
|
97
97
|
usage: Extend.RunUsage | null;
|
|
98
98
|
createdAt: Extend.CreatedAt;
|
|
@@ -53,11 +53,11 @@ export interface SplitRunSummary {
|
|
|
53
53
|
/** The URL to view the split run in the Extend dashboard. */
|
|
54
54
|
dashboardUrl: string;
|
|
55
55
|
/**
|
|
56
|
-
* Usage credits consumed by this run.
|
|
56
|
+
* Usage credits consumed by this split run. Omits `breakdown` — fetch the full split run by id to see the per-line items.
|
|
57
57
|
*
|
|
58
|
-
* **Availability:** Present when `status` is `"PROCESSED"`.
|
|
58
|
+
* **Availability:** Present when `status` is `"PROCESSED"`. Will not be returned for runs created before October 7, 2025 or for customers on legacy billing systems.
|
|
59
59
|
*/
|
|
60
|
-
usage: Extend.
|
|
60
|
+
usage: Extend.RunUsageSummary | null;
|
|
61
61
|
createdAt: Extend.CreatedAt;
|
|
62
62
|
updatedAt: Extend.UpdatedAt;
|
|
63
63
|
}
|
|
@@ -12,6 +12,8 @@ export declare const WebhookEndpointEventType: {
|
|
|
12
12
|
readonly SplitRunFailed: "split_run.failed";
|
|
13
13
|
readonly BatchProcessorRunProcessed: "batch_processor_run.processed";
|
|
14
14
|
readonly BatchProcessorRunFailed: "batch_processor_run.failed";
|
|
15
|
+
readonly BatchParseRunProcessed: "batch_parse_run.processed";
|
|
16
|
+
readonly BatchParseRunFailed: "batch_parse_run.failed";
|
|
15
17
|
readonly ExtractorCreated: "extractor.created";
|
|
16
18
|
readonly ExtractorUpdated: "extractor.updated";
|
|
17
19
|
readonly ExtractorDeleted: "extractor.deleted";
|
|
@@ -16,6 +16,8 @@ exports.WebhookEndpointEventType = {
|
|
|
16
16
|
SplitRunFailed: "split_run.failed",
|
|
17
17
|
BatchProcessorRunProcessed: "batch_processor_run.processed",
|
|
18
18
|
BatchProcessorRunFailed: "batch_processor_run.failed",
|
|
19
|
+
BatchParseRunProcessed: "batch_parse_run.processed",
|
|
20
|
+
BatchParseRunFailed: "batch_parse_run.failed",
|
|
19
21
|
ExtractorCreated: "extractor.created",
|
|
20
22
|
ExtractorUpdated: "extractor.updated",
|
|
21
23
|
ExtractorDeleted: "extractor.deleted",
|
|
@@ -19,7 +19,7 @@ import type * as Extend from "../index";
|
|
|
19
19
|
* }
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
export type WebhookEvent = Extend.WebhookEvent.WorkflowRunCompleted | Extend.WebhookEvent.WorkflowRunFailed | Extend.WebhookEvent.WorkflowRunNeedsReview | Extend.WebhookEvent.WorkflowRunRejected | Extend.WebhookEvent.WorkflowRunCancelled | Extend.WebhookEvent.WorkflowRunStepRunProcessed | Extend.WebhookEvent.ExtractRunProcessed | Extend.WebhookEvent.ExtractRunFailed | Extend.WebhookEvent.ClassifyRunProcessed | Extend.WebhookEvent.ClassifyRunFailed | Extend.WebhookEvent.SplitRunProcessed | Extend.WebhookEvent.SplitRunFailed | Extend.WebhookEvent.BatchProcessorRunProcessed | Extend.WebhookEvent.BatchProcessorRunFailed | Extend.WebhookEvent.ParseRunProcessed | Extend.WebhookEvent.ParseRunFailed | Extend.WebhookEvent.EditRunProcessed | Extend.WebhookEvent.EditRunFailed | Extend.WebhookEvent.WorkflowCreated | Extend.WebhookEvent.WorkflowDeployed | Extend.WebhookEvent.WorkflowDeleted | Extend.WebhookEvent.ExtractorCreated | Extend.WebhookEvent.ExtractorUpdated | Extend.WebhookEvent.ExtractorDeleted | Extend.WebhookEvent.ExtractorDraftUpdated | Extend.WebhookEvent.ExtractorVersionPublished | Extend.WebhookEvent.ClassifierCreated | Extend.WebhookEvent.ClassifierUpdated | Extend.WebhookEvent.ClassifierDeleted | Extend.WebhookEvent.ClassifierDraftUpdated | Extend.WebhookEvent.ClassifierVersionPublished | Extend.WebhookEvent.SplitterCreated | Extend.WebhookEvent.SplitterUpdated | Extend.WebhookEvent.SplitterDeleted | Extend.WebhookEvent.SplitterDraftUpdated | Extend.WebhookEvent.SplitterVersionPublished;
|
|
22
|
+
export type WebhookEvent = Extend.WebhookEvent.WorkflowRunCompleted | Extend.WebhookEvent.WorkflowRunFailed | Extend.WebhookEvent.WorkflowRunNeedsReview | Extend.WebhookEvent.WorkflowRunRejected | Extend.WebhookEvent.WorkflowRunCancelled | Extend.WebhookEvent.WorkflowRunStepRunProcessed | Extend.WebhookEvent.ExtractRunProcessed | Extend.WebhookEvent.ExtractRunFailed | Extend.WebhookEvent.ClassifyRunProcessed | Extend.WebhookEvent.ClassifyRunFailed | Extend.WebhookEvent.SplitRunProcessed | Extend.WebhookEvent.SplitRunFailed | Extend.WebhookEvent.BatchProcessorRunProcessed | Extend.WebhookEvent.BatchProcessorRunFailed | Extend.WebhookEvent.BatchParseRunProcessed | Extend.WebhookEvent.BatchParseRunFailed | Extend.WebhookEvent.ParseRunProcessed | Extend.WebhookEvent.ParseRunFailed | Extend.WebhookEvent.EditRunProcessed | Extend.WebhookEvent.EditRunFailed | Extend.WebhookEvent.WorkflowCreated | Extend.WebhookEvent.WorkflowDeployed | Extend.WebhookEvent.WorkflowDeleted | Extend.WebhookEvent.ExtractorCreated | Extend.WebhookEvent.ExtractorUpdated | Extend.WebhookEvent.ExtractorDeleted | Extend.WebhookEvent.ExtractorDraftUpdated | Extend.WebhookEvent.ExtractorVersionPublished | Extend.WebhookEvent.ClassifierCreated | Extend.WebhookEvent.ClassifierUpdated | Extend.WebhookEvent.ClassifierDeleted | Extend.WebhookEvent.ClassifierDraftUpdated | Extend.WebhookEvent.ClassifierVersionPublished | Extend.WebhookEvent.SplitterCreated | Extend.WebhookEvent.SplitterUpdated | Extend.WebhookEvent.SplitterDeleted | Extend.WebhookEvent.SplitterDraftUpdated | Extend.WebhookEvent.SplitterVersionPublished;
|
|
23
23
|
export declare namespace WebhookEvent {
|
|
24
24
|
interface WorkflowRunCompleted extends Extend.WorkflowRunCompletedWebhookEvent {
|
|
25
25
|
eventType: "workflow_run.completed";
|
|
@@ -63,6 +63,12 @@ export declare namespace WebhookEvent {
|
|
|
63
63
|
interface BatchProcessorRunFailed extends Extend.BatchProcessorRunFailedWebhookEvent {
|
|
64
64
|
eventType: "batch_processor_run.failed";
|
|
65
65
|
}
|
|
66
|
+
interface BatchParseRunProcessed extends Extend.BatchParseRunCompletedWebhookEvent {
|
|
67
|
+
eventType: "batch_parse_run.processed";
|
|
68
|
+
}
|
|
69
|
+
interface BatchParseRunFailed extends Extend.BatchParseRunFailedWebhookEvent {
|
|
70
|
+
eventType: "batch_parse_run.failed";
|
|
71
|
+
}
|
|
66
72
|
interface ParseRunProcessed extends Extend.ParseRunProcessedWebhookEvent {
|
|
67
73
|
eventType: "parse_run.processed";
|
|
68
74
|
}
|
|
@@ -73,5 +73,10 @@ export interface WorkflowRun {
|
|
|
73
73
|
endTime: string | null;
|
|
74
74
|
/** An array of WorkflowStepRun objects. Each WorkflowStepRun represents a single run of a WorkflowStep and contains details about the step's execution and result. */
|
|
75
75
|
stepRuns: Extend.StepRun[];
|
|
76
|
+
/**
|
|
77
|
+
* Usage credits consumed by this workflow run, including a breakdown of every contributing child run.
|
|
78
|
+
*
|
|
79
|
+
* **Availability:** Will not be returned for runs created before October 7, 2025 or for customers on legacy billing systems.
|
|
80
|
+
*/
|
|
76
81
|
usage: Extend.RunUsage | null;
|
|
77
82
|
}
|
|
@@ -61,5 +61,10 @@ export interface WorkflowRunSummary {
|
|
|
61
61
|
rejectionNote: string | null;
|
|
62
62
|
createdAt: Extend.CreatedAt;
|
|
63
63
|
updatedAt: Extend.UpdatedAt;
|
|
64
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Usage credits consumed by this workflow run. Omits `breakdown` — fetch the full workflow run by id to see the per-line items for every contributing child run.
|
|
66
|
+
*
|
|
67
|
+
* **Availability:** Will not be returned for runs created before October 7, 2025 or for customers on legacy billing systems.
|
|
68
|
+
*/
|
|
69
|
+
usage: Extend.RunUsageSummary | null;
|
|
65
70
|
}
|
package/api/types/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export * from "./ApiVersionEnum";
|
|
|
3
3
|
export * from "./ArrayStrategy";
|
|
4
4
|
export * from "./ArrayStrategyType";
|
|
5
5
|
export * from "./BarcodeDetails";
|
|
6
|
+
export * from "./BatchParseRunCompletedWebhookEvent";
|
|
7
|
+
export * from "./BatchParseRunFailedWebhookEvent";
|
|
6
8
|
export * from "./BatchProcessorRunCompletedWebhookEvent";
|
|
7
9
|
export * from "./BatchProcessorRunFailedWebhookEvent";
|
|
8
10
|
export * from "./BatchRun";
|
|
@@ -90,6 +92,7 @@ export * from "./EditSchemaGenerationConfigAdvancedOptions";
|
|
|
90
92
|
export * from "./EditSchemaGenerationMappingMatch";
|
|
91
93
|
export * from "./EditSchemaGenerationMappingResult";
|
|
92
94
|
export * from "./EditSchemaGenerationResponse";
|
|
95
|
+
export * from "./EditTemplate";
|
|
93
96
|
export * from "./EditTextOptions";
|
|
94
97
|
export * from "./EmptyBlockDetails";
|
|
95
98
|
export * from "./Enum";
|
|
@@ -297,6 +300,7 @@ export * from "./ParseRunOutput";
|
|
|
297
300
|
export * from "./ParseRunOutputOcr";
|
|
298
301
|
export * from "./ParseRunOutputOcrWordsItem";
|
|
299
302
|
export * from "./ParseRunProcessedWebhookEvent";
|
|
303
|
+
export * from "./ParseRunSource";
|
|
300
304
|
export * from "./ParseRunStatus";
|
|
301
305
|
export * from "./ParseRunStatusEnum";
|
|
302
306
|
export * from "./ParseRunStatusStatus";
|
|
@@ -329,6 +333,9 @@ export * from "./RunSecrets";
|
|
|
329
333
|
export * from "./RunSource";
|
|
330
334
|
export * from "./RunSourceId";
|
|
331
335
|
export * from "./RunUsage";
|
|
336
|
+
export * from "./RunUsageBreakdownEntry";
|
|
337
|
+
export * from "./RunUsageBreakdownEntryObject";
|
|
338
|
+
export * from "./RunUsageSummary";
|
|
332
339
|
export * from "./SimpleNextEntry";
|
|
333
340
|
export * from "./SortBy";
|
|
334
341
|
export * from "./SortDir";
|
package/api/types/index.js
CHANGED
|
@@ -19,6 +19,8 @@ __exportStar(require("./ApiVersionEnum"), exports);
|
|
|
19
19
|
__exportStar(require("./ArrayStrategy"), exports);
|
|
20
20
|
__exportStar(require("./ArrayStrategyType"), exports);
|
|
21
21
|
__exportStar(require("./BarcodeDetails"), exports);
|
|
22
|
+
__exportStar(require("./BatchParseRunCompletedWebhookEvent"), exports);
|
|
23
|
+
__exportStar(require("./BatchParseRunFailedWebhookEvent"), exports);
|
|
22
24
|
__exportStar(require("./BatchProcessorRunCompletedWebhookEvent"), exports);
|
|
23
25
|
__exportStar(require("./BatchProcessorRunFailedWebhookEvent"), exports);
|
|
24
26
|
__exportStar(require("./BatchRun"), exports);
|
|
@@ -106,6 +108,7 @@ __exportStar(require("./EditSchemaGenerationConfigAdvancedOptions"), exports);
|
|
|
106
108
|
__exportStar(require("./EditSchemaGenerationMappingMatch"), exports);
|
|
107
109
|
__exportStar(require("./EditSchemaGenerationMappingResult"), exports);
|
|
108
110
|
__exportStar(require("./EditSchemaGenerationResponse"), exports);
|
|
111
|
+
__exportStar(require("./EditTemplate"), exports);
|
|
109
112
|
__exportStar(require("./EditTextOptions"), exports);
|
|
110
113
|
__exportStar(require("./EmptyBlockDetails"), exports);
|
|
111
114
|
__exportStar(require("./Enum"), exports);
|
|
@@ -313,6 +316,7 @@ __exportStar(require("./ParseRunOutput"), exports);
|
|
|
313
316
|
__exportStar(require("./ParseRunOutputOcr"), exports);
|
|
314
317
|
__exportStar(require("./ParseRunOutputOcrWordsItem"), exports);
|
|
315
318
|
__exportStar(require("./ParseRunProcessedWebhookEvent"), exports);
|
|
319
|
+
__exportStar(require("./ParseRunSource"), exports);
|
|
316
320
|
__exportStar(require("./ParseRunStatus"), exports);
|
|
317
321
|
__exportStar(require("./ParseRunStatusEnum"), exports);
|
|
318
322
|
__exportStar(require("./ParseRunStatusStatus"), exports);
|
|
@@ -345,6 +349,9 @@ __exportStar(require("./RunSecrets"), exports);
|
|
|
345
349
|
__exportStar(require("./RunSource"), exports);
|
|
346
350
|
__exportStar(require("./RunSourceId"), exports);
|
|
347
351
|
__exportStar(require("./RunUsage"), exports);
|
|
352
|
+
__exportStar(require("./RunUsageBreakdownEntry"), exports);
|
|
353
|
+
__exportStar(require("./RunUsageBreakdownEntryObject"), exports);
|
|
354
|
+
__exportStar(require("./RunUsageSummary"), exports);
|
|
348
355
|
__exportStar(require("./SimpleNextEntry"), exports);
|
|
349
356
|
__exportStar(require("./SortBy"), exports);
|
|
350
357
|
__exportStar(require("./SortDir"), exports);
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -720,6 +720,73 @@ await client.files.upload(createReadStream("path/to/file"), {});
|
|
|
720
720
|
</details>
|
|
721
721
|
|
|
722
722
|
## ParseRuns
|
|
723
|
+
<details><summary><code>client.parseRuns.<a href="/src/api/resources/parseRuns/client/Client.ts">list</a>({ ...params }) -> Extend.ParseRunsListResponse</code></summary>
|
|
724
|
+
<dl>
|
|
725
|
+
<dd>
|
|
726
|
+
|
|
727
|
+
#### 📝 Description
|
|
728
|
+
|
|
729
|
+
<dl>
|
|
730
|
+
<dd>
|
|
731
|
+
|
|
732
|
+
<dl>
|
|
733
|
+
<dd>
|
|
734
|
+
|
|
735
|
+
List parse runs, with optional filters for status, batch ID, source, and file name.
|
|
736
|
+
|
|
737
|
+
Returns a paginated list of parse runs. Use `GET /parse_runs/{id}` to retrieve the full result including output for a specific run.
|
|
738
|
+
</dd>
|
|
739
|
+
</dl>
|
|
740
|
+
</dd>
|
|
741
|
+
</dl>
|
|
742
|
+
|
|
743
|
+
#### 🔌 Usage
|
|
744
|
+
|
|
745
|
+
<dl>
|
|
746
|
+
<dd>
|
|
747
|
+
|
|
748
|
+
<dl>
|
|
749
|
+
<dd>
|
|
750
|
+
|
|
751
|
+
```typescript
|
|
752
|
+
await client.parseRuns.list({
|
|
753
|
+
nextPageToken: "xK9mLPqRtN3vS8wF5hB2cQ==:zWvUxYjM4nKpL7aDgE9HbTcR2mAyX3/Q+CNkfBSw1dZ="
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
```
|
|
757
|
+
</dd>
|
|
758
|
+
</dl>
|
|
759
|
+
</dd>
|
|
760
|
+
</dl>
|
|
761
|
+
|
|
762
|
+
#### ⚙️ Parameters
|
|
763
|
+
|
|
764
|
+
<dl>
|
|
765
|
+
<dd>
|
|
766
|
+
|
|
767
|
+
<dl>
|
|
768
|
+
<dd>
|
|
769
|
+
|
|
770
|
+
**request:** `Extend.ParseRunsListRequest`
|
|
771
|
+
|
|
772
|
+
</dd>
|
|
773
|
+
</dl>
|
|
774
|
+
|
|
775
|
+
<dl>
|
|
776
|
+
<dd>
|
|
777
|
+
|
|
778
|
+
**requestOptions:** `ParseRunsClient.RequestOptions`
|
|
779
|
+
|
|
780
|
+
</dd>
|
|
781
|
+
</dl>
|
|
782
|
+
</dd>
|
|
783
|
+
</dl>
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
</dd>
|
|
787
|
+
</dl>
|
|
788
|
+
</details>
|
|
789
|
+
|
|
723
790
|
<details><summary><code>client.parseRuns.<a href="/src/api/resources/parseRuns/client/Client.ts">create</a>({ ...params }) -> Extend.ParseRun</code></summary>
|
|
724
791
|
<dl>
|
|
725
792
|
<dd>
|
|
@@ -942,6 +1009,102 @@ Example: `"pr_xK9mLPqRtN3vS8wF5hB2cQ"`
|
|
|
942
1009
|
</dl>
|
|
943
1010
|
|
|
944
1011
|
|
|
1012
|
+
</dd>
|
|
1013
|
+
</dl>
|
|
1014
|
+
</details>
|
|
1015
|
+
|
|
1016
|
+
<details><summary><code>client.parseRuns.<a href="/src/api/resources/parseRuns/client/Client.ts">createBatch</a>({ ...params }) -> Extend.BatchRun</code></summary>
|
|
1017
|
+
<dl>
|
|
1018
|
+
<dd>
|
|
1019
|
+
|
|
1020
|
+
#### 📝 Description
|
|
1021
|
+
|
|
1022
|
+
<dl>
|
|
1023
|
+
<dd>
|
|
1024
|
+
|
|
1025
|
+
<dl>
|
|
1026
|
+
<dd>
|
|
1027
|
+
|
|
1028
|
+
Submit up to **1,000 files** for parsing in a single request. Each file is processed as an independent parse run using the same configuration.
|
|
1029
|
+
|
|
1030
|
+
Unlike the single [Parse File (Async)](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/parse/create-parse-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.
|
|
1031
|
+
|
|
1032
|
+
**Monitoring results:**
|
|
1033
|
+
- **Webhooks (recommended):** Subscribe to `batch_parse_run.processed` and `batch_parse_run.failed` events. The webhook payload indicates the batch has finished — fetch individual run results using `GET /parse_runs?batchId={id}`.
|
|
1034
|
+
- **Polling:** Call `GET /batch_runs/{id}` to check the overall batch status, and use `GET /parse_runs?batchId={id}` to retrieve individual run results.
|
|
1035
|
+
|
|
1036
|
+
**Notes:**
|
|
1037
|
+
- `inputs` must contain between 1 and 1,000 items.
|
|
1038
|
+
- File input supports URLs, Extend file IDs, and raw text strings.
|
|
1039
|
+
</dd>
|
|
1040
|
+
</dl>
|
|
1041
|
+
</dd>
|
|
1042
|
+
</dl>
|
|
1043
|
+
|
|
1044
|
+
#### 🔌 Usage
|
|
1045
|
+
|
|
1046
|
+
<dl>
|
|
1047
|
+
<dd>
|
|
1048
|
+
|
|
1049
|
+
<dl>
|
|
1050
|
+
<dd>
|
|
1051
|
+
|
|
1052
|
+
```typescript
|
|
1053
|
+
await client.parseRuns.createBatch({
|
|
1054
|
+
inputs: [{
|
|
1055
|
+
file: {
|
|
1056
|
+
url: "https://example.com/document1.pdf"
|
|
1057
|
+
},
|
|
1058
|
+
metadata: {
|
|
1059
|
+
"customerId": "cust_abc123"
|
|
1060
|
+
}
|
|
1061
|
+
}, {
|
|
1062
|
+
file: {
|
|
1063
|
+
url: "https://example.com/document2.pdf"
|
|
1064
|
+
},
|
|
1065
|
+
metadata: {
|
|
1066
|
+
"customerId": "cust_def456"
|
|
1067
|
+
}
|
|
1068
|
+
}, {
|
|
1069
|
+
file: {
|
|
1070
|
+
text: "This is some raw text to parse."
|
|
1071
|
+
},
|
|
1072
|
+
metadata: {
|
|
1073
|
+
"source": "manual-entry"
|
|
1074
|
+
}
|
|
1075
|
+
}]
|
|
1076
|
+
});
|
|
1077
|
+
|
|
1078
|
+
```
|
|
1079
|
+
</dd>
|
|
1080
|
+
</dl>
|
|
1081
|
+
</dd>
|
|
1082
|
+
</dl>
|
|
1083
|
+
|
|
1084
|
+
#### ⚙️ Parameters
|
|
1085
|
+
|
|
1086
|
+
<dl>
|
|
1087
|
+
<dd>
|
|
1088
|
+
|
|
1089
|
+
<dl>
|
|
1090
|
+
<dd>
|
|
1091
|
+
|
|
1092
|
+
**request:** `Extend.ParseRunsCreateBatchRequest`
|
|
1093
|
+
|
|
1094
|
+
</dd>
|
|
1095
|
+
</dl>
|
|
1096
|
+
|
|
1097
|
+
<dl>
|
|
1098
|
+
<dd>
|
|
1099
|
+
|
|
1100
|
+
**requestOptions:** `ParseRunsClient.RequestOptions`
|
|
1101
|
+
|
|
1102
|
+
</dd>
|
|
1103
|
+
</dl>
|
|
1104
|
+
</dd>
|
|
1105
|
+
</dl>
|
|
1106
|
+
|
|
1107
|
+
|
|
945
1108
|
</dd>
|
|
946
1109
|
</dl>
|
|
947
1110
|
</details>
|
|
@@ -1174,6 +1337,84 @@ Example: `"edr_xK9mLPqRtN3vS8wF5hB2cQ"`
|
|
|
1174
1337
|
</dl>
|
|
1175
1338
|
|
|
1176
1339
|
|
|
1340
|
+
</dd>
|
|
1341
|
+
</dl>
|
|
1342
|
+
</details>
|
|
1343
|
+
|
|
1344
|
+
## EditTemplates
|
|
1345
|
+
<details><summary><code>client.editTemplates.<a href="/src/api/resources/editTemplates/client/Client.ts">retrieve</a>(id, { ...params }) -> Extend.EditTemplate</code></summary>
|
|
1346
|
+
<dl>
|
|
1347
|
+
<dd>
|
|
1348
|
+
|
|
1349
|
+
#### 📝 Description
|
|
1350
|
+
|
|
1351
|
+
<dl>
|
|
1352
|
+
<dd>
|
|
1353
|
+
|
|
1354
|
+
<dl>
|
|
1355
|
+
<dd>
|
|
1356
|
+
|
|
1357
|
+
Retrieve a saved edit template by ID.
|
|
1358
|
+
|
|
1359
|
+
Use this endpoint to inspect the source file, default edit configuration, and optional schema generation configuration saved on an edit template. You can reuse the returned `config` with `POST /edit` or `POST /edit_runs`, and reuse `schemaConfig` with `POST /edit_schemas/generate`.
|
|
1360
|
+
</dd>
|
|
1361
|
+
</dl>
|
|
1362
|
+
</dd>
|
|
1363
|
+
</dl>
|
|
1364
|
+
|
|
1365
|
+
#### 🔌 Usage
|
|
1366
|
+
|
|
1367
|
+
<dl>
|
|
1368
|
+
<dd>
|
|
1369
|
+
|
|
1370
|
+
<dl>
|
|
1371
|
+
<dd>
|
|
1372
|
+
|
|
1373
|
+
```typescript
|
|
1374
|
+
await client.editTemplates.retrieve("edit_template_id_here");
|
|
1375
|
+
|
|
1376
|
+
```
|
|
1377
|
+
</dd>
|
|
1378
|
+
</dl>
|
|
1379
|
+
</dd>
|
|
1380
|
+
</dl>
|
|
1381
|
+
|
|
1382
|
+
#### ⚙️ Parameters
|
|
1383
|
+
|
|
1384
|
+
<dl>
|
|
1385
|
+
<dd>
|
|
1386
|
+
|
|
1387
|
+
<dl>
|
|
1388
|
+
<dd>
|
|
1389
|
+
|
|
1390
|
+
**id:** `string`
|
|
1391
|
+
|
|
1392
|
+
The unique identifier for the edit template.
|
|
1393
|
+
|
|
1394
|
+
Example: `"edt_xK9mLPqRtN3vS8wF5hB2cQ"`
|
|
1395
|
+
|
|
1396
|
+
</dd>
|
|
1397
|
+
</dl>
|
|
1398
|
+
|
|
1399
|
+
<dl>
|
|
1400
|
+
<dd>
|
|
1401
|
+
|
|
1402
|
+
**request:** `Extend.EditTemplatesRetrieveRequest`
|
|
1403
|
+
|
|
1404
|
+
</dd>
|
|
1405
|
+
</dl>
|
|
1406
|
+
|
|
1407
|
+
<dl>
|
|
1408
|
+
<dd>
|
|
1409
|
+
|
|
1410
|
+
**requestOptions:** `EditTemplatesClient.RequestOptions`
|
|
1411
|
+
|
|
1412
|
+
</dd>
|
|
1413
|
+
</dl>
|
|
1414
|
+
</dd>
|
|
1415
|
+
</dl>
|
|
1416
|
+
|
|
1417
|
+
|
|
1177
1418
|
</dd>
|
|
1178
1419
|
</dl>
|
|
1179
1420
|
</details>
|
|
@@ -6269,7 +6510,7 @@ Example: `"bpr_Xj8mK2pL9nR4vT7qY5wZ"`
|
|
|
6269
6510
|
|
|
6270
6511
|
Retrieve the status of a batch run by its ID. The `status` field reflects the aggregate state of the batch.
|
|
6271
6512
|
|
|
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`).
|
|
6513
|
+
This is a unified endpoint that works for batches created via any of the batch submission endpoints (`POST /parse_runs/batch`, `POST /extract_runs/batch`, `POST /classify_runs/batch`, `POST /split_runs/batch`).
|
|
6273
6514
|
|
|
6274
6515
|
| Status | Meaning |
|
|
6275
6516
|
|---|---|
|
|
@@ -6279,7 +6520,8 @@ This is a unified endpoint that works for batches created via any of the batch s
|
|
|
6279
6520
|
| `FAILED` | The batch encountered a fatal error |
|
|
6280
6521
|
| `CANCELLED` | The batch was cancelled |
|
|
6281
6522
|
|
|
6282
|
-
To retrieve individual run results, use the List endpoint for the relevant
|
|
6523
|
+
To retrieve individual run results, use the List endpoint for the relevant type filtered by `batchId`:
|
|
6524
|
+
- `GET /parse_runs?batchId={id}`
|
|
6283
6525
|
- `GET /extract_runs?batchId={id}`
|
|
6284
6526
|
- `GET /classify_runs?batchId={id}`
|
|
6285
6527
|
- `GET /split_runs?batchId={id}`
|
|
@@ -7164,7 +7406,7 @@ await client.webhookEndpoints.create({
|
|
|
7164
7406
|
url: "https://example.com/webhooks",
|
|
7165
7407
|
name: "Production webhook",
|
|
7166
7408
|
enabledEvents: ["extract_run.processed", "workflow.created"],
|
|
7167
|
-
apiVersion: "
|
|
7409
|
+
apiVersion: "apiVersion"
|
|
7168
7410
|
});
|
|
7169
7411
|
|
|
7170
7412
|
```
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.10.0";
|
package/version.js
CHANGED