extend-ai 1.9.0 → 1.11.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 (78) hide show
  1. package/.gitattributes +1 -0
  2. package/BaseClient.js +2 -2
  3. package/Client.d.ts +3 -0
  4. package/Client.js +43 -38
  5. package/api/resources/editTemplates/client/Client.d.ts +38 -0
  6. package/api/resources/editTemplates/client/Client.js +137 -0
  7. package/api/resources/editTemplates/client/index.d.ts +1 -0
  8. package/api/resources/editTemplates/client/index.js +17 -0
  9. package/api/resources/editTemplates/client/requests/EditTemplatesRetrieveRequest.d.ts +8 -0
  10. package/api/resources/editTemplates/client/requests/EditTemplatesRetrieveRequest.js +3 -0
  11. package/api/resources/editTemplates/client/requests/index.d.ts +1 -0
  12. package/api/resources/editTemplates/client/requests/index.js +2 -0
  13. package/api/resources/editTemplates/index.d.ts +1 -0
  14. package/api/resources/editTemplates/index.js +17 -0
  15. package/api/resources/evaluationSetRuns/client/Client.d.ts +34 -0
  16. package/api/resources/evaluationSetRuns/client/Client.js +101 -0
  17. package/api/resources/evaluationSetRuns/client/requests/EvaluationSetRunsCreateRequest.d.ts +27 -0
  18. package/api/resources/evaluationSetRuns/client/requests/EvaluationSetRunsCreateRequest.js +3 -0
  19. package/api/resources/evaluationSetRuns/client/requests/index.d.ts +1 -0
  20. package/api/resources/evaluationSetRuns/index.d.ts +1 -0
  21. package/api/resources/evaluationSetRuns/index.js +1 -0
  22. package/api/resources/evaluationSetRuns/types/EvaluationSetRunsCreateRequestEntity.d.ts +9 -0
  23. package/api/resources/evaluationSetRuns/types/EvaluationSetRunsCreateRequestEntity.js +3 -0
  24. package/api/resources/evaluationSetRuns/types/index.d.ts +1 -0
  25. package/api/resources/evaluationSetRuns/types/index.js +17 -0
  26. package/api/resources/extractors/client/Client.d.ts +25 -3
  27. package/api/resources/extractors/client/Client.js +25 -3
  28. package/api/resources/extractors/client/requests/ExtractorsCreateRequest.d.ts +31 -5
  29. package/api/resources/extractors/types/ExtractorsCreateRequestGenerate.d.ts +12 -0
  30. package/api/resources/extractors/types/ExtractorsCreateRequestGenerate.js +3 -0
  31. package/api/resources/extractors/types/ExtractorsCreateRequestGenerateFilesItem.d.ts +2 -0
  32. package/api/resources/extractors/types/ExtractorsCreateRequestGenerateFilesItem.js +3 -0
  33. package/api/resources/extractors/types/index.d.ts +2 -0
  34. package/api/resources/extractors/types/index.js +2 -0
  35. package/api/resources/index.d.ts +3 -0
  36. package/api/resources/index.js +4 -1
  37. package/api/resources/parseRuns/client/Client.d.ts +1 -1
  38. package/api/resources/parseRuns/client/Client.js +4 -2
  39. package/api/resources/parseRuns/client/requests/ParseRunsListRequest.d.ts +8 -0
  40. package/api/resources/webhookEndpoints/client/Client.d.ts +1 -1
  41. package/api/resources/webhookEndpoints/client/Client.js +1 -1
  42. package/api/resources/webhookEndpoints/client/requests/WebhookEndpointsCreateRequest.d.ts +1 -1
  43. package/api/types/ApiVersionEnum.d.ts +1 -9
  44. package/api/types/ApiVersionEnum.js +0 -9
  45. package/api/types/ClassifyAdvancedOptions.d.ts +2 -0
  46. package/api/types/ClassifyRun.d.ts +9 -11
  47. package/api/types/ClassifyRunSummary.d.ts +3 -5
  48. package/api/types/EditConfigAdvancedOptions.d.ts +1 -1
  49. package/api/types/EditRun.d.ts +1 -1
  50. package/api/types/EditTemplate.d.ts +26 -0
  51. package/api/types/EditTemplate.js +3 -0
  52. package/api/types/ExtractAdvancedOptions.d.ts +9 -0
  53. package/api/types/ExtractAdvancedOptionsCitationMode.d.ts +12 -0
  54. package/api/types/ExtractAdvancedOptionsCitationMode.js +15 -0
  55. package/api/types/ExtractRun.d.ts +14 -14
  56. package/api/types/ExtractRunSummary.d.ts +3 -3
  57. package/api/types/ParseRun.d.ts +1 -1
  58. package/api/types/ParseRunSource.d.ts +20 -0
  59. package/api/types/ParseRunSource.js +23 -0
  60. package/api/types/ParseRunStatus.d.ts +6 -0
  61. package/api/types/RunUsage.d.ts +14 -1
  62. package/api/types/RunUsageBreakdownEntry.d.ts +12 -0
  63. package/api/types/RunUsageBreakdownEntry.js +3 -0
  64. package/api/types/RunUsageBreakdownEntryObject.d.ts +9 -0
  65. package/api/types/RunUsageBreakdownEntryObject.js +12 -0
  66. package/api/types/RunUsageSummary.d.ts +19 -0
  67. package/api/types/RunUsageSummary.js +3 -0
  68. package/api/types/SplitRun.d.ts +9 -9
  69. package/api/types/SplitRunSummary.d.ts +3 -3
  70. package/api/types/StepRun.d.ts +28 -2
  71. package/api/types/WorkflowRun.d.ts +5 -0
  72. package/api/types/WorkflowRunSummary.d.ts +6 -1
  73. package/api/types/index.d.ts +6 -0
  74. package/api/types/index.js +6 -0
  75. package/package.json +1 -1
  76. package/reference.md +165 -5
  77. package/version.d.ts +1 -1
  78. package/version.js +1 -1
package/.gitattributes ADDED
@@ -0,0 +1 @@
1
+ .fern/replay.lock linguist-generated=true
package/BaseClient.js CHANGED
@@ -44,8 +44,8 @@ function normalizeClientOptions(options) {
44
44
  const headers = (0, headers_1.mergeHeaders)({
45
45
  "X-Fern-Language": "JavaScript",
46
46
  "X-Fern-SDK-Name": "extend-ai",
47
- "X-Fern-SDK-Version": "1.9.0",
48
- "User-Agent": "extend-ai/1.9.0",
47
+ "X-Fern-SDK-Version": "1.11.0",
48
+ "User-Agent": "extend-ai/1.11.0",
49
49
  "X-Fern-Runtime": core.RUNTIME.type,
50
50
  "X-Fern-Runtime-Version": core.RUNTIME.version,
51
51
  "x-extend-api-version": (_a = options === null || options === void 0 ? void 0 : options.extendApiVersion) !== null && _a !== void 0 ? _a : "2026-02-09",
package/Client.d.ts CHANGED
@@ -6,6 +6,7 @@ import { ClassifierVersionsClient } from "./api/resources/classifierVersions/cli
6
6
  import { ClassifyRunsClient } from "./api/resources/classifyRuns/client/Client";
7
7
  import { EditRunsClient } from "./api/resources/editRuns/client/Client";
8
8
  import { EditSchemasClient } from "./api/resources/editSchemas/client/Client";
9
+ import { EditTemplatesClient } from "./api/resources/editTemplates/client/Client";
9
10
  import { EvaluationSetItemsClient } from "./api/resources/evaluationSetItems/client/Client";
10
11
  import { EvaluationSetRunsClient } from "./api/resources/evaluationSetRuns/client/Client";
11
12
  import { EvaluationSetsClient } from "./api/resources/evaluationSets/client/Client";
@@ -38,6 +39,7 @@ export declare class ExtendClient {
38
39
  protected _files: FilesClient | undefined;
39
40
  protected _parseRuns: ParseRunsClient | undefined;
40
41
  protected _editRuns: EditRunsClient | undefined;
42
+ protected _editTemplates: EditTemplatesClient | undefined;
41
43
  protected _editSchemas: EditSchemasClient | undefined;
42
44
  protected _extractRuns: ExtractRunsClient | undefined;
43
45
  protected _extractors: ExtractorsClient | undefined;
@@ -65,6 +67,7 @@ export declare class ExtendClient {
65
67
  get files(): FilesClient;
66
68
  get parseRuns(): ParseRunsClient;
67
69
  get editRuns(): EditRunsClient;
70
+ get editTemplates(): EditTemplatesClient;
68
71
  get editSchemas(): EditSchemasClient;
69
72
  get extractRuns(): ExtractRunsClient;
70
73
  get extractors(): ExtractorsClient;
package/Client.js CHANGED
@@ -63,25 +63,26 @@ const Client_4 = require("./api/resources/classifierVersions/client/Client");
63
63
  const Client_5 = require("./api/resources/classifyRuns/client/Client");
64
64
  const Client_6 = require("./api/resources/editRuns/client/Client");
65
65
  const Client_7 = require("./api/resources/editSchemas/client/Client");
66
- const Client_8 = require("./api/resources/evaluationSetItems/client/Client");
67
- const Client_9 = require("./api/resources/evaluationSetRuns/client/Client");
68
- const Client_10 = require("./api/resources/evaluationSets/client/Client");
69
- const Client_11 = require("./api/resources/extractors/client/Client");
70
- const Client_12 = require("./api/resources/extractorVersions/client/Client");
71
- const Client_13 = require("./api/resources/extractRuns/client/Client");
72
- const Client_14 = require("./api/resources/files/client/Client");
73
- const Client_15 = require("./api/resources/parseRuns/client/Client");
74
- const Client_16 = require("./api/resources/processor/client/Client");
75
- const Client_17 = require("./api/resources/processorRun/client/Client");
76
- const Client_18 = require("./api/resources/processorVersion/client/Client");
77
- const Client_19 = require("./api/resources/splitRuns/client/Client");
78
- const Client_20 = require("./api/resources/splitters/client/Client");
79
- const Client_21 = require("./api/resources/splitterVersions/client/Client");
80
- const Client_22 = require("./api/resources/webhookEndpoints/client/Client");
81
- const Client_23 = require("./api/resources/webhookSubscriptions/client/Client");
82
- const Client_24 = require("./api/resources/workflowRuns/client/Client");
83
- const Client_25 = require("./api/resources/workflows/client/Client");
84
- const Client_26 = require("./api/resources/workflowVersions/client/Client");
66
+ const Client_8 = require("./api/resources/editTemplates/client/Client");
67
+ const Client_9 = require("./api/resources/evaluationSetItems/client/Client");
68
+ const Client_10 = require("./api/resources/evaluationSetRuns/client/Client");
69
+ const Client_11 = require("./api/resources/evaluationSets/client/Client");
70
+ const Client_12 = require("./api/resources/extractors/client/Client");
71
+ const Client_13 = require("./api/resources/extractorVersions/client/Client");
72
+ const Client_14 = require("./api/resources/extractRuns/client/Client");
73
+ const Client_15 = require("./api/resources/files/client/Client");
74
+ const Client_16 = require("./api/resources/parseRuns/client/Client");
75
+ const Client_17 = require("./api/resources/processor/client/Client");
76
+ const Client_18 = require("./api/resources/processorRun/client/Client");
77
+ const Client_19 = require("./api/resources/processorVersion/client/Client");
78
+ const Client_20 = require("./api/resources/splitRuns/client/Client");
79
+ const Client_21 = require("./api/resources/splitters/client/Client");
80
+ const Client_22 = require("./api/resources/splitterVersions/client/Client");
81
+ const Client_23 = require("./api/resources/webhookEndpoints/client/Client");
82
+ const Client_24 = require("./api/resources/webhookSubscriptions/client/Client");
83
+ const Client_25 = require("./api/resources/workflowRuns/client/Client");
84
+ const Client_26 = require("./api/resources/workflows/client/Client");
85
+ const Client_27 = require("./api/resources/workflowVersions/client/Client");
85
86
  const BaseClient_1 = require("./BaseClient");
86
87
  const core = __importStar(require("./core"));
87
88
  const headers_1 = require("./core/headers");
@@ -94,31 +95,35 @@ class ExtendClient {
94
95
  }
95
96
  get files() {
96
97
  var _a;
97
- return ((_a = this._files) !== null && _a !== void 0 ? _a : (this._files = new Client_14.FilesClient(this._options)));
98
+ return ((_a = this._files) !== null && _a !== void 0 ? _a : (this._files = new Client_15.FilesClient(this._options)));
98
99
  }
99
100
  get parseRuns() {
100
101
  var _a;
101
- return ((_a = this._parseRuns) !== null && _a !== void 0 ? _a : (this._parseRuns = new Client_15.ParseRunsClient(this._options)));
102
+ return ((_a = this._parseRuns) !== null && _a !== void 0 ? _a : (this._parseRuns = new Client_16.ParseRunsClient(this._options)));
102
103
  }
103
104
  get editRuns() {
104
105
  var _a;
105
106
  return ((_a = this._editRuns) !== null && _a !== void 0 ? _a : (this._editRuns = new Client_6.EditRunsClient(this._options)));
106
107
  }
108
+ get editTemplates() {
109
+ var _a;
110
+ return ((_a = this._editTemplates) !== null && _a !== void 0 ? _a : (this._editTemplates = new Client_8.EditTemplatesClient(this._options)));
111
+ }
107
112
  get editSchemas() {
108
113
  var _a;
109
114
  return ((_a = this._editSchemas) !== null && _a !== void 0 ? _a : (this._editSchemas = new Client_7.EditSchemasClient(this._options)));
110
115
  }
111
116
  get extractRuns() {
112
117
  var _a;
113
- return ((_a = this._extractRuns) !== null && _a !== void 0 ? _a : (this._extractRuns = new Client_13.ExtractRunsClient(this._options)));
118
+ return ((_a = this._extractRuns) !== null && _a !== void 0 ? _a : (this._extractRuns = new Client_14.ExtractRunsClient(this._options)));
114
119
  }
115
120
  get extractors() {
116
121
  var _a;
117
- return ((_a = this._extractors) !== null && _a !== void 0 ? _a : (this._extractors = new Client_11.ExtractorsClient(this._options)));
122
+ return ((_a = this._extractors) !== null && _a !== void 0 ? _a : (this._extractors = new Client_12.ExtractorsClient(this._options)));
118
123
  }
119
124
  get extractorVersions() {
120
125
  var _a;
121
- return ((_a = this._extractorVersions) !== null && _a !== void 0 ? _a : (this._extractorVersions = new Client_12.ExtractorVersionsClient(this._options)));
126
+ return ((_a = this._extractorVersions) !== null && _a !== void 0 ? _a : (this._extractorVersions = new Client_13.ExtractorVersionsClient(this._options)));
122
127
  }
123
128
  get classifyRuns() {
124
129
  var _a;
@@ -134,39 +139,39 @@ class ExtendClient {
134
139
  }
135
140
  get splitRuns() {
136
141
  var _a;
137
- return ((_a = this._splitRuns) !== null && _a !== void 0 ? _a : (this._splitRuns = new Client_19.SplitRunsClient(this._options)));
142
+ return ((_a = this._splitRuns) !== null && _a !== void 0 ? _a : (this._splitRuns = new Client_20.SplitRunsClient(this._options)));
138
143
  }
139
144
  get splitters() {
140
145
  var _a;
141
- return ((_a = this._splitters) !== null && _a !== void 0 ? _a : (this._splitters = new Client_20.SplittersClient(this._options)));
146
+ return ((_a = this._splitters) !== null && _a !== void 0 ? _a : (this._splitters = new Client_21.SplittersClient(this._options)));
142
147
  }
143
148
  get splitterVersions() {
144
149
  var _a;
145
- return ((_a = this._splitterVersions) !== null && _a !== void 0 ? _a : (this._splitterVersions = new Client_21.SplitterVersionsClient(this._options)));
150
+ return ((_a = this._splitterVersions) !== null && _a !== void 0 ? _a : (this._splitterVersions = new Client_22.SplitterVersionsClient(this._options)));
146
151
  }
147
152
  get workflows() {
148
153
  var _a;
149
- return ((_a = this._workflows) !== null && _a !== void 0 ? _a : (this._workflows = new Client_25.WorkflowsClient(this._options)));
154
+ return ((_a = this._workflows) !== null && _a !== void 0 ? _a : (this._workflows = new Client_26.WorkflowsClient(this._options)));
150
155
  }
151
156
  get workflowVersions() {
152
157
  var _a;
153
- return ((_a = this._workflowVersions) !== null && _a !== void 0 ? _a : (this._workflowVersions = new Client_26.WorkflowVersionsClient(this._options)));
158
+ return ((_a = this._workflowVersions) !== null && _a !== void 0 ? _a : (this._workflowVersions = new Client_27.WorkflowVersionsClient(this._options)));
154
159
  }
155
160
  get workflowRuns() {
156
161
  var _a;
157
- return ((_a = this._workflowRuns) !== null && _a !== void 0 ? _a : (this._workflowRuns = new Client_24.WorkflowRunsClient(this._options)));
162
+ return ((_a = this._workflowRuns) !== null && _a !== void 0 ? _a : (this._workflowRuns = new Client_25.WorkflowRunsClient(this._options)));
158
163
  }
159
164
  get processorRun() {
160
165
  var _a;
161
- return ((_a = this._processorRun) !== null && _a !== void 0 ? _a : (this._processorRun = new Client_17.ProcessorRunClient(this._options)));
166
+ return ((_a = this._processorRun) !== null && _a !== void 0 ? _a : (this._processorRun = new Client_18.ProcessorRunClient(this._options)));
162
167
  }
163
168
  get processor() {
164
169
  var _a;
165
- return ((_a = this._processor) !== null && _a !== void 0 ? _a : (this._processor = new Client_16.ProcessorClient(this._options)));
170
+ return ((_a = this._processor) !== null && _a !== void 0 ? _a : (this._processor = new Client_17.ProcessorClient(this._options)));
166
171
  }
167
172
  get processorVersion() {
168
173
  var _a;
169
- return ((_a = this._processorVersion) !== null && _a !== void 0 ? _a : (this._processorVersion = new Client_18.ProcessorVersionClient(this._options)));
174
+ return ((_a = this._processorVersion) !== null && _a !== void 0 ? _a : (this._processorVersion = new Client_19.ProcessorVersionClient(this._options)));
170
175
  }
171
176
  get batchProcessorRun() {
172
177
  var _a;
@@ -178,23 +183,23 @@ class ExtendClient {
178
183
  }
179
184
  get evaluationSets() {
180
185
  var _a;
181
- return ((_a = this._evaluationSets) !== null && _a !== void 0 ? _a : (this._evaluationSets = new Client_10.EvaluationSetsClient(this._options)));
186
+ return ((_a = this._evaluationSets) !== null && _a !== void 0 ? _a : (this._evaluationSets = new Client_11.EvaluationSetsClient(this._options)));
182
187
  }
183
188
  get evaluationSetItems() {
184
189
  var _a;
185
- return ((_a = this._evaluationSetItems) !== null && _a !== void 0 ? _a : (this._evaluationSetItems = new Client_8.EvaluationSetItemsClient(this._options)));
190
+ return ((_a = this._evaluationSetItems) !== null && _a !== void 0 ? _a : (this._evaluationSetItems = new Client_9.EvaluationSetItemsClient(this._options)));
186
191
  }
187
192
  get evaluationSetRuns() {
188
193
  var _a;
189
- return ((_a = this._evaluationSetRuns) !== null && _a !== void 0 ? _a : (this._evaluationSetRuns = new Client_9.EvaluationSetRunsClient(this._options)));
194
+ return ((_a = this._evaluationSetRuns) !== null && _a !== void 0 ? _a : (this._evaluationSetRuns = new Client_10.EvaluationSetRunsClient(this._options)));
190
195
  }
191
196
  get webhookEndpoints() {
192
197
  var _a;
193
- return ((_a = this._webhookEndpoints) !== null && _a !== void 0 ? _a : (this._webhookEndpoints = new Client_22.WebhookEndpointsClient(this._options)));
198
+ return ((_a = this._webhookEndpoints) !== null && _a !== void 0 ? _a : (this._webhookEndpoints = new Client_23.WebhookEndpointsClient(this._options)));
194
199
  }
195
200
  get webhookSubscriptions() {
196
201
  var _a;
197
- return ((_a = this._webhookSubscriptions) !== null && _a !== void 0 ? _a : (this._webhookSubscriptions = new Client_23.WebhookSubscriptionsClient(this._options)));
202
+ return ((_a = this._webhookSubscriptions) !== null && _a !== void 0 ? _a : (this._webhookSubscriptions = new Client_24.WebhookSubscriptionsClient(this._options)));
198
203
  }
199
204
  /**
200
205
  * Parse a file synchronously, waiting for the result before returning. This endpoint has a **5-minute timeout** — if processing takes longer, the request will fail.
@@ -0,0 +1,38 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient";
3
+ import * as core from "../../../../core";
4
+ import * as Extend from "../../../index";
5
+ export declare namespace EditTemplatesClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class EditTemplatesClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<EditTemplatesClient.Options>;
12
+ constructor(options: EditTemplatesClient.Options);
13
+ /**
14
+ * Retrieve a saved edit template by ID.
15
+ *
16
+ * 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`.
17
+ *
18
+ * @param {string} id - The unique identifier for the edit template.
19
+ *
20
+ * Example: `"edt_xK9mLPqRtN3vS8wF5hB2cQ"`
21
+ * @param {Extend.EditTemplatesRetrieveRequest} request
22
+ * @param {EditTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
23
+ *
24
+ * @throws {@link Extend.BadRequestError}
25
+ * @throws {@link Extend.UnauthorizedError}
26
+ * @throws {@link Extend.PaymentRequiredError}
27
+ * @throws {@link Extend.ForbiddenError}
28
+ * @throws {@link Extend.NotFoundError}
29
+ * @throws {@link Extend.UnprocessableEntityError}
30
+ * @throws {@link Extend.TooManyRequestsError}
31
+ * @throws {@link Extend.InternalServerError}
32
+ *
33
+ * @example
34
+ * await client.editTemplates.retrieve("edit_template_id_here")
35
+ */
36
+ retrieve(id: string, request?: Extend.EditTemplatesRetrieveRequest, requestOptions?: EditTemplatesClient.RequestOptions): core.HttpResponsePromise<Extend.EditTemplate>;
37
+ private __retrieve;
38
+ }
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.EditTemplatesClient = void 0;
47
+ const BaseClient_1 = require("../../../../BaseClient");
48
+ const core = __importStar(require("../../../../core"));
49
+ const headers_1 = require("../../../../core/headers");
50
+ const environments = __importStar(require("../../../../environments"));
51
+ const handleNonStatusCodeError_1 = require("../../../../errors/handleNonStatusCodeError");
52
+ const errors = __importStar(require("../../../../errors/index"));
53
+ const Extend = __importStar(require("../../../index"));
54
+ class EditTemplatesClient {
55
+ constructor(options) {
56
+ this._options = (0, BaseClient_1.normalizeClientOptionsWithAuth)(options);
57
+ }
58
+ /**
59
+ * Retrieve a saved edit template by ID.
60
+ *
61
+ * 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`.
62
+ *
63
+ * @param {string} id - The unique identifier for the edit template.
64
+ *
65
+ * Example: `"edt_xK9mLPqRtN3vS8wF5hB2cQ"`
66
+ * @param {Extend.EditTemplatesRetrieveRequest} request
67
+ * @param {EditTemplatesClient.RequestOptions} requestOptions - Request-specific configuration.
68
+ *
69
+ * @throws {@link Extend.BadRequestError}
70
+ * @throws {@link Extend.UnauthorizedError}
71
+ * @throws {@link Extend.PaymentRequiredError}
72
+ * @throws {@link Extend.ForbiddenError}
73
+ * @throws {@link Extend.NotFoundError}
74
+ * @throws {@link Extend.UnprocessableEntityError}
75
+ * @throws {@link Extend.TooManyRequestsError}
76
+ * @throws {@link Extend.InternalServerError}
77
+ *
78
+ * @example
79
+ * await client.editTemplates.retrieve("edit_template_id_here")
80
+ */
81
+ retrieve(id, request = {}, requestOptions) {
82
+ return core.HttpResponsePromise.fromPromise(this.__retrieve(id, request, requestOptions));
83
+ }
84
+ __retrieve(id_1) {
85
+ return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
86
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
87
+ const { "x-extend-workspace-id": extendWorkspaceId } = request;
88
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
89
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
90
+ "x-extend-workspace-id": extendWorkspaceId,
91
+ "x-extend-api-version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _b !== void 0 ? _b : "2026-02-09",
92
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
93
+ const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
94
+ 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, `edit_templates/${core.url.encodePathParam(id)}`),
95
+ method: "GET",
96
+ headers: _headers,
97
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
98
+ 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,
99
+ 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,
100
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
101
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
102
+ logging: this._options.logging,
103
+ });
104
+ if (_response.ok) {
105
+ return { data: _response.body, rawResponse: _response.rawResponse };
106
+ }
107
+ if (_response.error.reason === "status-code") {
108
+ switch (_response.error.statusCode) {
109
+ case 400:
110
+ throw new Extend.BadRequestError(_response.error.body, _response.rawResponse);
111
+ case 401:
112
+ throw new Extend.UnauthorizedError(_response.error.body, _response.rawResponse);
113
+ case 402:
114
+ throw new Extend.PaymentRequiredError(_response.error.body, _response.rawResponse);
115
+ case 403:
116
+ throw new Extend.ForbiddenError(_response.error.body, _response.rawResponse);
117
+ case 404:
118
+ throw new Extend.NotFoundError(_response.error.body, _response.rawResponse);
119
+ case 422:
120
+ throw new Extend.UnprocessableEntityError(_response.error.body, _response.rawResponse);
121
+ case 429:
122
+ throw new Extend.TooManyRequestsError(_response.error.body, _response.rawResponse);
123
+ case 500:
124
+ throw new Extend.InternalServerError(_response.error.body, _response.rawResponse);
125
+ default:
126
+ throw new errors.ExtendError({
127
+ statusCode: _response.error.statusCode,
128
+ body: _response.error.body,
129
+ rawResponse: _response.rawResponse,
130
+ });
131
+ }
132
+ }
133
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/edit_templates/{id}");
134
+ });
135
+ }
136
+ }
137
+ exports.EditTemplatesClient = EditTemplatesClient;
@@ -0,0 +1 @@
1
+ export * from "./requests";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests"), exports);
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface EditTemplatesRetrieveRequest {
6
+ /** 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. */
7
+ "x-extend-workspace-id"?: string;
8
+ }
@@ -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 @@
1
+ export type { EditTemplatesRetrieveRequest } from "./EditTemplatesRetrieveRequest";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client"), exports);
@@ -10,6 +10,40 @@ export declare namespace EvaluationSetRunsClient {
10
10
  export declare class EvaluationSetRunsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<EvaluationSetRunsClient.Options>;
12
12
  constructor(options: EvaluationSetRunsClient.Options);
13
+ /**
14
+ * Create and start an async evaluation set run. The response returns the evaluation set run object with its initial status; use `GET /evaluation_set_runs/{id}` to poll for completion.
15
+ *
16
+ * Evaluation set runs are currently supported for document processor evaluation sets.
17
+ *
18
+ * @param {Extend.EvaluationSetRunsCreateRequest} request
19
+ * @param {EvaluationSetRunsClient.RequestOptions} requestOptions - Request-specific configuration.
20
+ *
21
+ * @throws {@link Extend.BadRequestError}
22
+ * @throws {@link Extend.UnauthorizedError}
23
+ * @throws {@link Extend.PaymentRequiredError}
24
+ * @throws {@link Extend.ForbiddenError}
25
+ * @throws {@link Extend.NotFoundError}
26
+ * @throws {@link Extend.UnprocessableEntityError}
27
+ * @throws {@link Extend.TooManyRequestsError}
28
+ * @throws {@link Extend.InternalServerError}
29
+ *
30
+ * @example
31
+ * await client.evaluationSetRuns.create({
32
+ * evaluationSetId: "ev_2LcgeY_mp2T5yPaEuq5Lw",
33
+ * entity: {
34
+ * id: "ex_Xj8mK2pL9nR4vT7qY5wZ",
35
+ * version: "1.0"
36
+ * }
37
+ * })
38
+ *
39
+ * @example
40
+ * await client.evaluationSetRuns.create({
41
+ * evaluationSetId: "ev_2LcgeY_mp2T5yPaEuq5Lw",
42
+ * evaluationSetItemIds: ["evi_kR9mNP12Qw4yTv8BdR3H"]
43
+ * })
44
+ */
45
+ create(request: Extend.EvaluationSetRunsCreateRequest, requestOptions?: EvaluationSetRunsClient.RequestOptions): core.HttpResponsePromise<Extend.EvaluationSetRun>;
46
+ private __create;
13
47
  /**
14
48
  * Get details of an evaluation set run.
15
49
  *
@@ -42,6 +42,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
42
42
  step((generator = generator.apply(thisArg, _arguments || [])).next());
43
43
  });
44
44
  };
45
+ var __rest = (this && this.__rest) || function (s, e) {
46
+ var t = {};
47
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
48
+ t[p] = s[p];
49
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
50
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
51
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
52
+ t[p[i]] = s[p[i]];
53
+ }
54
+ return t;
55
+ };
45
56
  Object.defineProperty(exports, "__esModule", { value: true });
46
57
  exports.EvaluationSetRunsClient = void 0;
47
58
  const BaseClient_1 = require("../../../../BaseClient");
@@ -55,6 +66,96 @@ class EvaluationSetRunsClient {
55
66
  constructor(options) {
56
67
  this._options = (0, BaseClient_1.normalizeClientOptionsWithAuth)(options);
57
68
  }
69
+ /**
70
+ * Create and start an async evaluation set run. The response returns the evaluation set run object with its initial status; use `GET /evaluation_set_runs/{id}` to poll for completion.
71
+ *
72
+ * Evaluation set runs are currently supported for document processor evaluation sets.
73
+ *
74
+ * @param {Extend.EvaluationSetRunsCreateRequest} request
75
+ * @param {EvaluationSetRunsClient.RequestOptions} requestOptions - Request-specific configuration.
76
+ *
77
+ * @throws {@link Extend.BadRequestError}
78
+ * @throws {@link Extend.UnauthorizedError}
79
+ * @throws {@link Extend.PaymentRequiredError}
80
+ * @throws {@link Extend.ForbiddenError}
81
+ * @throws {@link Extend.NotFoundError}
82
+ * @throws {@link Extend.UnprocessableEntityError}
83
+ * @throws {@link Extend.TooManyRequestsError}
84
+ * @throws {@link Extend.InternalServerError}
85
+ *
86
+ * @example
87
+ * await client.evaluationSetRuns.create({
88
+ * evaluationSetId: "ev_2LcgeY_mp2T5yPaEuq5Lw",
89
+ * entity: {
90
+ * id: "ex_Xj8mK2pL9nR4vT7qY5wZ",
91
+ * version: "1.0"
92
+ * }
93
+ * })
94
+ *
95
+ * @example
96
+ * await client.evaluationSetRuns.create({
97
+ * evaluationSetId: "ev_2LcgeY_mp2T5yPaEuq5Lw",
98
+ * evaluationSetItemIds: ["evi_kR9mNP12Qw4yTv8BdR3H"]
99
+ * })
100
+ */
101
+ create(request, requestOptions) {
102
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
103
+ }
104
+ __create(request, requestOptions) {
105
+ return __awaiter(this, void 0, void 0, function* () {
106
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
107
+ const { "x-extend-workspace-id": extendWorkspaceId } = request, _body = __rest(request, ["x-extend-workspace-id"]);
108
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
109
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
110
+ "x-extend-workspace-id": extendWorkspaceId,
111
+ "x-extend-api-version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _b !== void 0 ? _b : "2026-02-09",
112
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
113
+ const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
114
+ 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, "evaluation_set_runs"),
115
+ method: "POST",
116
+ headers: _headers,
117
+ contentType: "application/json",
118
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
119
+ requestType: "json",
120
+ body: _body,
121
+ 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,
122
+ 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,
123
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
124
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
125
+ logging: this._options.logging,
126
+ });
127
+ if (_response.ok) {
128
+ return { data: _response.body, rawResponse: _response.rawResponse };
129
+ }
130
+ if (_response.error.reason === "status-code") {
131
+ switch (_response.error.statusCode) {
132
+ case 400:
133
+ throw new Extend.BadRequestError(_response.error.body, _response.rawResponse);
134
+ case 401:
135
+ throw new Extend.UnauthorizedError(_response.error.body, _response.rawResponse);
136
+ case 402:
137
+ throw new Extend.PaymentRequiredError(_response.error.body, _response.rawResponse);
138
+ case 403:
139
+ throw new Extend.ForbiddenError(_response.error.body, _response.rawResponse);
140
+ case 404:
141
+ throw new Extend.NotFoundError(_response.error.body, _response.rawResponse);
142
+ case 422:
143
+ throw new Extend.UnprocessableEntityError(_response.error.body, _response.rawResponse);
144
+ case 429:
145
+ throw new Extend.TooManyRequestsError(_response.error.body, _response.rawResponse);
146
+ case 500:
147
+ throw new Extend.InternalServerError(_response.error.body, _response.rawResponse);
148
+ default:
149
+ throw new errors.ExtendError({
150
+ statusCode: _response.error.statusCode,
151
+ body: _response.error.body,
152
+ rawResponse: _response.rawResponse,
153
+ });
154
+ }
155
+ }
156
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/evaluation_set_runs");
157
+ });
158
+ }
58
159
  /**
59
160
  * Get details of an evaluation set run.
60
161
  *
@@ -0,0 +1,27 @@
1
+ import type * as Extend from "../../../../index";
2
+ /**
3
+ * @example
4
+ * {
5
+ * evaluationSetId: "ev_2LcgeY_mp2T5yPaEuq5Lw",
6
+ * entity: {
7
+ * id: "ex_Xj8mK2pL9nR4vT7qY5wZ",
8
+ * version: "1.0"
9
+ * }
10
+ * }
11
+ *
12
+ * @example
13
+ * {
14
+ * evaluationSetId: "ev_2LcgeY_mp2T5yPaEuq5Lw",
15
+ * evaluationSetItemIds: ["evi_kR9mNP12Qw4yTv8BdR3H"]
16
+ * }
17
+ */
18
+ export interface EvaluationSetRunsCreateRequest {
19
+ /** 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. */
20
+ "x-extend-workspace-id"?: string;
21
+ /** The ID of the evaluation set to run. */
22
+ evaluationSetId: string;
23
+ /** Optional processor and version to run against the evaluation set. If omitted, the evaluation set's processor is run at its draft version. */
24
+ entity?: Extend.EvaluationSetRunsCreateRequestEntity;
25
+ /** Optional list of evaluation set item IDs to run. If omitted, all items in the evaluation set are run. */
26
+ evaluationSetItemIds?: string[];
27
+ }
@@ -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 });