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.
Files changed (79) hide show
  1. package/BaseClient.js +2 -2
  2. package/Client.d.ts +3 -0
  3. package/Client.js +43 -38
  4. package/api/resources/batchRuns/client/Client.d.ts +3 -2
  5. package/api/resources/batchRuns/client/Client.js +3 -2
  6. package/api/resources/editTemplates/client/Client.d.ts +38 -0
  7. package/api/resources/editTemplates/client/Client.js +137 -0
  8. package/api/resources/editTemplates/client/index.d.ts +1 -0
  9. package/api/resources/editTemplates/client/index.js +17 -0
  10. package/api/resources/editTemplates/client/requests/EditTemplatesRetrieveRequest.d.ts +8 -0
  11. package/api/resources/editTemplates/client/requests/EditTemplatesRetrieveRequest.js +3 -0
  12. package/api/resources/editTemplates/client/requests/index.d.ts +1 -0
  13. package/api/resources/editTemplates/client/requests/index.js +2 -0
  14. package/api/resources/editTemplates/index.d.ts +1 -0
  15. package/api/resources/editTemplates/index.js +17 -0
  16. package/api/resources/index.d.ts +2 -0
  17. package/api/resources/index.js +3 -1
  18. package/api/resources/parseRuns/client/Client.d.ts +77 -0
  19. package/api/resources/parseRuns/client/Client.js +191 -0
  20. package/api/resources/parseRuns/client/requests/ParseRunsCreateBatchRequest.d.ts +35 -0
  21. package/api/resources/parseRuns/client/requests/ParseRunsCreateBatchRequest.js +3 -0
  22. package/api/resources/parseRuns/client/requests/ParseRunsListRequest.d.ts +35 -0
  23. package/api/resources/parseRuns/client/requests/ParseRunsListRequest.js +3 -0
  24. package/api/resources/parseRuns/client/requests/index.d.ts +2 -0
  25. package/api/resources/parseRuns/types/ParseRunsCreateBatchRequestInputsItem.d.ts +6 -0
  26. package/api/resources/parseRuns/types/ParseRunsCreateBatchRequestInputsItem.js +3 -0
  27. package/api/resources/parseRuns/types/ParseRunsCreateBatchRequestInputsItemFile.d.ts +5 -0
  28. package/api/resources/parseRuns/types/ParseRunsCreateBatchRequestInputsItemFile.js +3 -0
  29. package/api/resources/parseRuns/types/ParseRunsListRequestStatus.d.ts +7 -0
  30. package/api/resources/parseRuns/types/ParseRunsListRequestStatus.js +10 -0
  31. package/api/resources/parseRuns/types/ParseRunsListResponse.d.ts +6 -0
  32. package/api/resources/parseRuns/types/ParseRunsListResponse.js +3 -0
  33. package/api/resources/parseRuns/types/index.d.ts +4 -0
  34. package/api/resources/parseRuns/types/index.js +4 -0
  35. package/api/resources/webhookEndpoints/client/Client.d.ts +1 -1
  36. package/api/resources/webhookEndpoints/client/Client.js +1 -1
  37. package/api/resources/webhookEndpoints/client/requests/WebhookEndpointsCreateRequest.d.ts +1 -1
  38. package/api/types/ApiVersionEnum.d.ts +1 -9
  39. package/api/types/ApiVersionEnum.js +0 -9
  40. package/api/types/BatchParseRunCompletedWebhookEvent.d.ts +6 -0
  41. package/api/types/BatchParseRunCompletedWebhookEvent.js +3 -0
  42. package/api/types/BatchParseRunFailedWebhookEvent.d.ts +6 -0
  43. package/api/types/BatchParseRunFailedWebhookEvent.js +3 -0
  44. package/api/types/BatchRun.d.ts +1 -1
  45. package/api/types/ClassifyRun.d.ts +2 -4
  46. package/api/types/ClassifyRunSummary.d.ts +3 -5
  47. package/api/types/EditConfigAdvancedOptions.d.ts +1 -1
  48. package/api/types/EditRun.d.ts +1 -1
  49. package/api/types/EditTemplate.d.ts +26 -0
  50. package/api/types/EditTemplate.js +3 -0
  51. package/api/types/ExtractAdvancedOptions.d.ts +2 -0
  52. package/api/types/ExtractRun.d.ts +2 -2
  53. package/api/types/ExtractRunSummary.d.ts +3 -3
  54. package/api/types/ParseRun.d.ts +11 -2
  55. package/api/types/ParseRunSource.d.ts +20 -0
  56. package/api/types/ParseRunSource.js +23 -0
  57. package/api/types/ParseRunStatus.d.ts +6 -0
  58. package/api/types/ParseRunStatusEnum.d.ts +2 -0
  59. package/api/types/ParseRunStatusEnum.js +2 -0
  60. package/api/types/RunUsage.d.ts +14 -1
  61. package/api/types/RunUsageBreakdownEntry.d.ts +12 -0
  62. package/api/types/RunUsageBreakdownEntry.js +3 -0
  63. package/api/types/RunUsageBreakdownEntryObject.d.ts +9 -0
  64. package/api/types/RunUsageBreakdownEntryObject.js +12 -0
  65. package/api/types/RunUsageSummary.d.ts +19 -0
  66. package/api/types/RunUsageSummary.js +3 -0
  67. package/api/types/SplitRun.d.ts +2 -2
  68. package/api/types/SplitRunSummary.d.ts +3 -3
  69. package/api/types/WebhookEndpointEventType.d.ts +2 -0
  70. package/api/types/WebhookEndpointEventType.js +2 -0
  71. package/api/types/WebhookEvent.d.ts +7 -1
  72. package/api/types/WorkflowRun.d.ts +5 -0
  73. package/api/types/WorkflowRunSummary.d.ts +6 -1
  74. package/api/types/index.d.ts +7 -0
  75. package/api/types/index.js +7 -0
  76. package/package.json +1 -1
  77. package/reference.md +245 -3
  78. package/version.d.ts +1 -1
  79. package/version.js +1 -1
@@ -55,6 +55,92 @@ class ParseRunsClient {
55
55
  constructor(options) {
56
56
  this._options = (0, BaseClient_1.normalizeClientOptionsWithAuth)(options);
57
57
  }
58
+ /**
59
+ * List parse runs, with optional filters for status, batch ID, source, and file name.
60
+ *
61
+ * Returns a paginated list of parse runs. Use `GET /parse_runs/{id}` to retrieve the full result including output for a specific run.
62
+ *
63
+ * @param {Extend.ParseRunsListRequest} request
64
+ * @param {ParseRunsClient.RequestOptions} requestOptions - Request-specific configuration.
65
+ *
66
+ * @throws {@link Extend.BadRequestError}
67
+ * @throws {@link Extend.UnauthorizedError}
68
+ * @throws {@link Extend.PaymentRequiredError}
69
+ * @throws {@link Extend.ForbiddenError}
70
+ * @throws {@link Extend.NotFoundError}
71
+ * @throws {@link Extend.UnprocessableEntityError}
72
+ * @throws {@link Extend.TooManyRequestsError}
73
+ * @throws {@link Extend.InternalServerError}
74
+ *
75
+ * @example
76
+ * await client.parseRuns.list({
77
+ * nextPageToken: "xK9mLPqRtN3vS8wF5hB2cQ==:zWvUxYjM4nKpL7aDgE9HbTcR2mAyX3/Q+CNkfBSw1dZ="
78
+ * })
79
+ */
80
+ list(request = {}, requestOptions) {
81
+ return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
82
+ }
83
+ __list() {
84
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
85
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
86
+ const { status, batchId, source, sourceId, fileNameContains, nextPageToken, maxPageSize, "x-extend-workspace-id": extendWorkspaceId, } = request;
87
+ const _queryParams = {
88
+ status: status != null ? status : undefined,
89
+ batchId,
90
+ source: source != null ? source : undefined,
91
+ sourceId,
92
+ fileNameContains,
93
+ nextPageToken,
94
+ maxPageSize,
95
+ };
96
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
97
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
98
+ "x-extend-workspace-id": extendWorkspaceId,
99
+ "x-extend-api-version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _b !== void 0 ? _b : "2026-02-09",
100
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
101
+ const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
102
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ExtendEnvironment.Production, "parse_runs"),
103
+ method: "GET",
104
+ headers: _headers,
105
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
106
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 300) * 1000,
107
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
108
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
109
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
110
+ logging: this._options.logging,
111
+ });
112
+ if (_response.ok) {
113
+ return { data: _response.body, rawResponse: _response.rawResponse };
114
+ }
115
+ if (_response.error.reason === "status-code") {
116
+ switch (_response.error.statusCode) {
117
+ case 400:
118
+ throw new Extend.BadRequestError(_response.error.body, _response.rawResponse);
119
+ case 401:
120
+ throw new Extend.UnauthorizedError(_response.error.body, _response.rawResponse);
121
+ case 402:
122
+ throw new Extend.PaymentRequiredError(_response.error.body, _response.rawResponse);
123
+ case 403:
124
+ throw new Extend.ForbiddenError(_response.error.body, _response.rawResponse);
125
+ case 404:
126
+ throw new Extend.NotFoundError(_response.error.body, _response.rawResponse);
127
+ case 422:
128
+ throw new Extend.UnprocessableEntityError(_response.error.body, _response.rawResponse);
129
+ case 429:
130
+ throw new Extend.TooManyRequestsError(_response.error.body, _response.rawResponse);
131
+ case 500:
132
+ throw new Extend.InternalServerError(_response.error.body, _response.rawResponse);
133
+ default:
134
+ throw new errors.ExtendError({
135
+ statusCode: _response.error.statusCode,
136
+ body: _response.error.body,
137
+ rawResponse: _response.rawResponse,
138
+ });
139
+ }
140
+ }
141
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/parse_runs");
142
+ });
143
+ }
58
144
  /**
59
145
  * Parse files to get cleaned, chunked target content (e.g. markdown).
60
146
  *
@@ -295,5 +381,110 @@ class ParseRunsClient {
295
381
  return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/parse_runs/{id}");
296
382
  });
297
383
  }
384
+ /**
385
+ * 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.
386
+ *
387
+ * 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.
388
+ *
389
+ * **Monitoring results:**
390
+ * - **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}`.
391
+ * - **Polling:** Call `GET /batch_runs/{id}` to check the overall batch status, and use `GET /parse_runs?batchId={id}` to retrieve individual run results.
392
+ *
393
+ * **Notes:**
394
+ * - `inputs` must contain between 1 and 1,000 items.
395
+ * - File input supports URLs, Extend file IDs, and raw text strings.
396
+ *
397
+ * @param {Extend.ParseRunsCreateBatchRequest} request
398
+ * @param {ParseRunsClient.RequestOptions} requestOptions - Request-specific configuration.
399
+ *
400
+ * @throws {@link Extend.BadRequestError}
401
+ * @throws {@link Extend.UnauthorizedError}
402
+ * @throws {@link Extend.PaymentRequiredError}
403
+ * @throws {@link Extend.ForbiddenError}
404
+ * @throws {@link Extend.NotFoundError}
405
+ * @throws {@link Extend.UnprocessableEntityError}
406
+ * @throws {@link Extend.TooManyRequestsError}
407
+ * @throws {@link Extend.InternalServerError}
408
+ *
409
+ * @example
410
+ * await client.parseRuns.createBatch({
411
+ * inputs: [{
412
+ * file: {
413
+ * url: "https://example.com/document1.pdf"
414
+ * },
415
+ * metadata: {
416
+ * "customerId": "cust_abc123"
417
+ * }
418
+ * }, {
419
+ * file: {
420
+ * url: "https://example.com/document2.pdf"
421
+ * },
422
+ * metadata: {
423
+ * "customerId": "cust_def456"
424
+ * }
425
+ * }, {
426
+ * file: {
427
+ * text: "This is some raw text to parse."
428
+ * },
429
+ * metadata: {
430
+ * "source": "manual-entry"
431
+ * }
432
+ * }]
433
+ * })
434
+ */
435
+ createBatch(request, requestOptions) {
436
+ return core.HttpResponsePromise.fromPromise(this.__createBatch(request, requestOptions));
437
+ }
438
+ __createBatch(request, requestOptions) {
439
+ return __awaiter(this, void 0, void 0, function* () {
440
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
441
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
442
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "x-extend-api-version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _b !== void 0 ? _b : "2026-02-09" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
443
+ const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
444
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ExtendEnvironment.Production, "parse_runs/batch"),
445
+ method: "POST",
446
+ headers: _headers,
447
+ contentType: "application/json",
448
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
449
+ requestType: "json",
450
+ body: request,
451
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 300) * 1000,
452
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
453
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
454
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
455
+ logging: this._options.logging,
456
+ });
457
+ if (_response.ok) {
458
+ return { data: _response.body, rawResponse: _response.rawResponse };
459
+ }
460
+ if (_response.error.reason === "status-code") {
461
+ switch (_response.error.statusCode) {
462
+ case 400:
463
+ throw new Extend.BadRequestError(_response.error.body, _response.rawResponse);
464
+ case 401:
465
+ throw new Extend.UnauthorizedError(_response.error.body, _response.rawResponse);
466
+ case 402:
467
+ throw new Extend.PaymentRequiredError(_response.error.body, _response.rawResponse);
468
+ case 403:
469
+ throw new Extend.ForbiddenError(_response.error.body, _response.rawResponse);
470
+ case 404:
471
+ throw new Extend.NotFoundError(_response.error.body, _response.rawResponse);
472
+ case 422:
473
+ throw new Extend.UnprocessableEntityError(_response.error.body, _response.rawResponse);
474
+ case 429:
475
+ throw new Extend.TooManyRequestsError(_response.error.body, _response.rawResponse);
476
+ case 500:
477
+ throw new Extend.InternalServerError(_response.error.body, _response.rawResponse);
478
+ default:
479
+ throw new errors.ExtendError({
480
+ statusCode: _response.error.statusCode,
481
+ body: _response.error.body,
482
+ rawResponse: _response.rawResponse,
483
+ });
484
+ }
485
+ }
486
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/parse_runs/batch");
487
+ });
488
+ }
298
489
  }
299
490
  exports.ParseRunsClient = ParseRunsClient;
@@ -0,0 +1,35 @@
1
+ import type * as Extend from "../../../../index";
2
+ /**
3
+ * @example
4
+ * {
5
+ * inputs: [{
6
+ * file: {
7
+ * url: "https://example.com/document1.pdf"
8
+ * },
9
+ * metadata: {
10
+ * "customerId": "cust_abc123"
11
+ * }
12
+ * }, {
13
+ * file: {
14
+ * url: "https://example.com/document2.pdf"
15
+ * },
16
+ * metadata: {
17
+ * "customerId": "cust_def456"
18
+ * }
19
+ * }, {
20
+ * file: {
21
+ * text: "This is some raw text to parse."
22
+ * },
23
+ * metadata: {
24
+ * "source": "manual-entry"
25
+ * }
26
+ * }]
27
+ * }
28
+ */
29
+ export interface ParseRunsCreateBatchRequest {
30
+ /** An array of inputs to parse. Each item produces one parse run. Must contain between 1 and 1,000 items. */
31
+ inputs: Extend.ParseRunsCreateBatchRequestInputsItem[];
32
+ /** Optional parsing configuration applied to every run in this batch. If omitted, default parse settings are used. */
33
+ config?: Extend.ParseConfig;
34
+ priority?: Extend.RunPriority;
35
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,35 @@
1
+ import type * as Extend from "../../../../index";
2
+ /**
3
+ * @example
4
+ * {
5
+ * nextPageToken: "xK9mLPqRtN3vS8wF5hB2cQ==:zWvUxYjM4nKpL7aDgE9HbTcR2mAyX3/Q+CNkfBSw1dZ="
6
+ * }
7
+ */
8
+ export interface ParseRunsListRequest {
9
+ /** Filter parse runs by status. */
10
+ status?: Extend.ParseRunsListRequestStatus;
11
+ /**
12
+ * Filter parse runs by the batch they belong to. Use this after submitting a batch via `POST /parse_runs/batch` to retrieve individual run results.
13
+ *
14
+ * Example: `"bpar_Xj8mK2pL9nR4vT7qY5wZ"`
15
+ */
16
+ batchId?: string;
17
+ /**
18
+ * Filters parse runs by the source that created them. If not provided, runs from all sources are returned.
19
+ *
20
+ * **Note:** When `batchId` is provided, it takes precedence and this filter is ignored.
21
+ */
22
+ source?: Extend.ParseRunSource;
23
+ /** Filters runs by the source ID. */
24
+ sourceId?: Extend.RunSourceId;
25
+ /**
26
+ * Filters runs by the name of the file. Only returns runs where the file name contains this string.
27
+ *
28
+ * Example: `"invoice"`
29
+ */
30
+ fileNameContains?: string;
31
+ nextPageToken?: Extend.NextPageToken;
32
+ maxPageSize?: Extend.MaxPageSize;
33
+ /** The workspace ID to target. **Required** when using an organization-scoped API key; optional for workspace-scoped keys (the key is already tied to a workspace). See [Authentication](https://docs.extend.ai/2026-02-09/developers/authentication) for details on API key scopes. */
34
+ "x-extend-workspace-id"?: string;
35
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,5 @@
1
+ export type { ParseRunsCreateBatchRequest } from "./ParseRunsCreateBatchRequest";
1
2
  export type { ParseRunsCreateRequest } from "./ParseRunsCreateRequest";
2
3
  export type { ParseRunsDeleteRequest } from "./ParseRunsDeleteRequest";
4
+ export type { ParseRunsListRequest } from "./ParseRunsListRequest";
3
5
  export type { ParseRunsRetrieveRequest } from "./ParseRunsRetrieveRequest";
@@ -0,0 +1,6 @@
1
+ import type * as Extend from "../../../index";
2
+ export interface ParseRunsCreateBatchRequestInputsItem {
3
+ /** The file to parse. Can be a URL, an Extend file ID, or raw text. */
4
+ file: Extend.ParseRunsCreateBatchRequestInputsItemFile;
5
+ metadata?: Extend.RunMetadata;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import type * as Extend from "../../../index";
2
+ /**
3
+ * The file to parse. Can be a URL, an Extend file ID, or raw text.
4
+ */
5
+ export type ParseRunsCreateBatchRequestInputsItemFile = Extend.FileFromUrl | Extend.FileFromId | Extend.FileFromText;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export declare const ParseRunsListRequestStatus: {
2
+ readonly Pending: "PENDING";
3
+ readonly Processing: "PROCESSING";
4
+ readonly Processed: "PROCESSED";
5
+ readonly Failed: "FAILED";
6
+ };
7
+ export type ParseRunsListRequestStatus = (typeof ParseRunsListRequestStatus)[keyof typeof ParseRunsListRequestStatus] | string;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ParseRunsListRequestStatus = void 0;
5
+ exports.ParseRunsListRequestStatus = {
6
+ Pending: "PENDING",
7
+ Processing: "PROCESSING",
8
+ Processed: "PROCESSED",
9
+ Failed: "FAILED",
10
+ };
@@ -0,0 +1,6 @@
1
+ import type * as Extend from "../../../index";
2
+ export interface ParseRunsListResponse {
3
+ object: "list";
4
+ data: Extend.ParseRun[];
5
+ nextPageToken?: Extend.NextPageToken;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,7 @@
1
+ export * from "./ParseRunsCreateBatchRequestInputsItem";
2
+ export * from "./ParseRunsCreateBatchRequestInputsItemFile";
1
3
  export * from "./ParseRunsCreateRequestFile";
2
4
  export * from "./ParseRunsDeleteResponse";
5
+ export * from "./ParseRunsListRequestStatus";
6
+ export * from "./ParseRunsListResponse";
3
7
  export * from "./ParseRunsRetrieveRequestResponseType";
@@ -14,6 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ParseRunsCreateBatchRequestInputsItem"), exports);
18
+ __exportStar(require("./ParseRunsCreateBatchRequestInputsItemFile"), exports);
17
19
  __exportStar(require("./ParseRunsCreateRequestFile"), exports);
18
20
  __exportStar(require("./ParseRunsDeleteResponse"), exports);
21
+ __exportStar(require("./ParseRunsListRequestStatus"), exports);
22
+ __exportStar(require("./ParseRunsListResponse"), exports);
19
23
  __exportStar(require("./ParseRunsRetrieveRequestResponseType"), exports);
@@ -56,7 +56,7 @@ export declare class WebhookEndpointsClient {
56
56
  * url: "https://example.com/webhooks",
57
57
  * name: "Production webhook",
58
58
  * enabledEvents: ["extract_run.processed", "workflow.created"],
59
- * apiVersion: "2026-02-09"
59
+ * apiVersion: "apiVersion"
60
60
  * })
61
61
  */
62
62
  create(request: Extend.WebhookEndpointsCreateRequest, requestOptions?: WebhookEndpointsClient.RequestOptions): core.HttpResponsePromise<Extend.WebhookEndpointCreate>;
@@ -171,7 +171,7 @@ class WebhookEndpointsClient {
171
171
  * url: "https://example.com/webhooks",
172
172
  * name: "Production webhook",
173
173
  * enabledEvents: ["extract_run.processed", "workflow.created"],
174
- * apiVersion: "2026-02-09"
174
+ * apiVersion: "apiVersion"
175
175
  * })
176
176
  */
177
177
  create(request, requestOptions) {
@@ -5,7 +5,7 @@ import type * as Extend from "../../../../index";
5
5
  * url: "https://example.com/webhooks",
6
6
  * name: "Production webhook",
7
7
  * enabledEvents: ["extract_run.processed", "workflow.created"],
8
- * apiVersion: "2026-02-09"
8
+ * apiVersion: "apiVersion"
9
9
  * }
10
10
  */
11
11
  export interface WebhookEndpointsCreateRequest {
@@ -1,9 +1 @@
1
- export declare const ApiVersionEnum: {
2
- readonly TwoThousandTwentySix0209: "2026-02-09";
3
- readonly TwoThousandTwentyFive0421: "2025-04-21";
4
- readonly TwoThousandTwentyFour1223: "2024-12-23";
5
- readonly TwoThousandTwentyFour1114: "2024-11-14";
6
- readonly TwoThousandTwentyFour0730: "2024-07-30";
7
- readonly TwoThousandTwentyFour0201: "2024-02-01";
8
- };
9
- export type ApiVersionEnum = (typeof ApiVersionEnum)[keyof typeof ApiVersionEnum] | string;
1
+ export type ApiVersionEnum = string;
@@ -1,12 +1,3 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.ApiVersionEnum = void 0;
5
- exports.ApiVersionEnum = {
6
- TwoThousandTwentySix0209: "2026-02-09",
7
- TwoThousandTwentyFive0421: "2025-04-21",
8
- TwoThousandTwentyFour1223: "2024-12-23",
9
- TwoThousandTwentyFour1114: "2024-11-14",
10
- TwoThousandTwentyFour0730: "2024-07-30",
11
- TwoThousandTwentyFour0201: "2024-02-01",
12
- };
@@ -0,0 +1,6 @@
1
+ import type * as Extend from "../index";
2
+ export interface BatchParseRunCompletedWebhookEvent {
3
+ /** Unique identifier for the event */
4
+ eventId: string;
5
+ payload: Extend.BatchRun;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import type * as Extend from "../index";
2
+ export interface BatchParseRunFailedWebhookEvent {
3
+ /** Unique identifier for the event */
4
+ eventId: string;
5
+ payload: Extend.BatchRun;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,6 @@
1
1
  import type * as Extend from "../index";
2
2
  /**
3
- * A batch run represents a batch of files submitted for processing via one of the batch endpoints (`POST /extract_runs/batch`, `POST /classify_runs/batch`, or `POST /split_runs/batch`). Use `GET /batch_runs/{id}` to poll the status.
3
+ * A batch run represents a batch of files submitted for processing via one of the batch endpoints (`POST /parse_runs/batch`, `POST /extract_runs/batch`, `POST /classify_runs/batch`, or `POST /split_runs/batch`). Use `GET /batch_runs/{id}` to poll the status.
4
4
  *
5
5
  * **Note:** This object is not used for workflow batch runs. See `POST /workflow_runs/batch` for workflow batching.
6
6
  */
@@ -90,11 +90,9 @@ export interface ClassifyRun {
90
90
  /** The URL to view the classify run in the Extend dashboard. */
91
91
  dashboardUrl: string;
92
92
  /**
93
- * Usage credits consumed by this run.
93
+ * Usage credits consumed by this classify run.
94
94
  *
95
- * **Availability:** This field will not be returned for:
96
- * * Runs created before October 7, 2025
97
- * * Customers on legacy billing systems
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.
98
96
  */
99
97
  usage: Extend.RunUsage | null;
100
98
  createdAt: Extend.CreatedAt;
@@ -53,13 +53,11 @@ export interface ClassifyRunSummary {
53
53
  /** The URL to view the classify run in the Extend dashboard. */
54
54
  dashboardUrl: string;
55
55
  /**
56
- * Usage credits consumed by this run.
56
+ * Usage credits consumed by this classify run. Omits `breakdown` — fetch the full classify run by id to see the per-line items.
57
57
  *
58
- * **Availability:** This field will not be returned for:
59
- * * Runs created before October 7, 2025
60
- * * Customers on legacy billing systems
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.
61
59
  */
62
- usage: Extend.RunUsage | null;
60
+ usage: Extend.RunUsageSummary | null;
63
61
  createdAt: Extend.CreatedAt;
64
62
  updatedAt: Extend.UpdatedAt;
65
63
  }
@@ -4,7 +4,7 @@
4
4
  export interface EditConfigAdvancedOptions {
5
5
  /** Whether to parse table regions as arrays of objects. Defaults to `false`. */
6
6
  tableParsingEnabled?: boolean;
7
- /** Whether to flatten the PDF (form widgets will not be editable with a PDF edit). Defaults to `true`. */
7
+ /** Whether to flatten PDF forms after editing (makes form fields non-editable). Defaults to `true`. */
8
8
  flattenPdf?: boolean;
9
9
  /** Whether to model radio fields as enums. This ensures only one radio widget is filled. Defaults to false. */
10
10
  radioEnumsEnabled?: boolean;
@@ -62,7 +62,7 @@ export interface EditRun {
62
62
  */
63
63
  metrics: Extend.EditRunMetrics | null;
64
64
  /**
65
- * Usage credits consumed by this run.
65
+ * Usage credits consumed by this edit run.
66
66
  *
67
67
  * **Availability:** Present when `status` is `"PROCESSED"`, the run was created after October 7, 2025, and the customer is on the current billing system.
68
68
  */
@@ -0,0 +1,26 @@
1
+ import type * as Extend from "../index";
2
+ /**
3
+ * A saved edit template. Edit templates contain a source file, default edit configuration, and optional schema generation configuration that can be reused for edit runs.
4
+ */
5
+ export interface EditTemplate {
6
+ /** The type of object. Will always be `"edit_template"`. */
7
+ object: "edit_template";
8
+ /**
9
+ * A unique identifier for the edit template.
10
+ *
11
+ * Example: `"edt_xK9mLPqRtN3vS8wF5hB2cQ"`
12
+ */
13
+ id: string;
14
+ /** The name of the edit template. */
15
+ name: string;
16
+ /** The description of the edit template, if one was provided. */
17
+ description: string | null;
18
+ /** The source file associated with this edit template. */
19
+ file: Extend.FileSummary;
20
+ /** Default edit configuration saved on the template. Empty when no edit configuration was saved. */
21
+ config: Extend.EditConfig;
22
+ /** Optional schema generation configuration saved on the template. */
23
+ schemaConfig: Extend.EditSchemaGenerationConfig | null;
24
+ createdAt: Extend.CreatedAt;
25
+ updatedAt: Extend.UpdatedAt;
26
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -6,6 +6,8 @@ export interface ExtractAdvancedOptions {
6
6
  advancedMultimodalEnabled?: boolean;
7
7
  /** Whether to enable citations in the output. */
8
8
  citationsEnabled?: boolean;
9
+ /** Whether to include the current date as context for the model during extraction. Defaults to `false`. */
10
+ currentDateEnabled?: boolean;
9
11
  /** Granularity for array citations. This requires citationsEnabled=true and a base processor version that supports property-level array citations (extraction_performance ≥ 4.4.0). */
10
12
  arrayCitationStrategy?: Extend.ExtractAdvancedOptionsArrayCitationStrategy;
11
13
  /** Strategy for handling large arrays in documents. */
@@ -104,9 +104,9 @@ export interface ExtractRun {
104
104
  /** The URL to view the extract run in the Extend dashboard. */
105
105
  dashboardUrl: string;
106
106
  /**
107
- * Usage credits consumed by this run.
107
+ * Usage credits consumed by this extract run.
108
108
  *
109
- * **Availability:** Present when `status` is `"PROCESSED"`.
109
+ * **Availability:** Present when `status` is `"PROCESSED"`. Will not be returned for runs created before October 7, 2025 or for customers on legacy billing systems.
110
110
  */
111
111
  usage: Extend.RunUsage | null;
112
112
  createdAt: Extend.CreatedAt;
@@ -53,11 +53,11 @@ export interface ExtractRunSummary {
53
53
  /** The URL to view the extract run in the Extend dashboard. */
54
54
  dashboardUrl: string;
55
55
  /**
56
- * Usage credits consumed by this run.
56
+ * Usage credits consumed by this extract run. Omits `breakdown` — fetch the full extract 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.RunUsage | null;
60
+ usage: Extend.RunUsageSummary | null;
61
61
  createdAt: Extend.CreatedAt;
62
62
  updatedAt: Extend.UpdatedAt;
63
63
  }
@@ -11,10 +11,19 @@ export interface ParseRun {
11
11
  * Example: `"pr_xK9mLPqRtN3vS8wF5hB2cQ"`
12
12
  */
13
13
  id: string;
14
- /** The file that was parsed. This file can be used as a parameter for other Extend endpoints, such as `POST /workflow_runs`. */
14
+ /**
15
+ * The ID of the batch this run belongs to, if created via `POST /parse_runs/batch`.
16
+ *
17
+ * **Availability:** Present when the run was submitted as part of a batch.
18
+ *
19
+ * Example: `"bpar_Xj8mK2pL9nR4vT7qY5wZ"`
20
+ */
21
+ batchId?: string | null;
22
+ /** The file that was parsed. This file can be used as a parameter for other Extend endpoints, such as `POST /workflow_runs`. May be `null` for batch parse runs where file ingestion failed. */
15
23
  file: Extend.FileSummary;
16
24
  /**
17
25
  * The status of the parse run:
26
+ * * `"PENDING"` - The run has been created and is waiting to be processed. Only applies to runs created via `POST /parse_runs/batch`.
18
27
  * * `"PROCESSING"` - The file is still being processed
19
28
  * * `"PROCESSED"` - The file was successfully processed
20
29
  * * `"FAILED"` - The processing failed (see `failureReason` for details)
@@ -70,7 +79,7 @@ export interface ParseRun {
70
79
  /** The configuration used for the parsing process, including any default values that were applied. */
71
80
  config: Extend.ParseConfig;
72
81
  /**
73
- * Usage credits consumed by this run.
82
+ * Usage credits consumed by this parse run.
74
83
  *
75
84
  * **Availability:** Present when `status` is `"PROCESSED"`, the run was created after October 7, 2025, and the customer is on the current billing system.
76
85
  */