extend-ai 0.0.3 → 0.0.4

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 (204) hide show
  1. package/Client.d.ts +30 -1
  2. package/Client.js +111 -14
  3. package/api/client/requests/ParseAsyncRequest.d.ts +15 -0
  4. package/api/client/requests/ParseRequest.d.ts +6 -0
  5. package/api/client/requests/index.d.ts +1 -0
  6. package/api/errors/InternalServerError.d.ts +9 -0
  7. package/api/errors/InternalServerError.js +52 -0
  8. package/api/errors/NotFoundError.d.ts +1 -2
  9. package/api/errors/TooManyRequestsError.d.ts +9 -0
  10. package/api/errors/TooManyRequestsError.js +52 -0
  11. package/api/errors/index.d.ts +2 -0
  12. package/api/errors/index.js +2 -0
  13. package/api/resources/batchProcessorRun/client/Client.js +1 -1
  14. package/api/resources/batchWorkflowRun/client/Client.d.ts +2 -0
  15. package/api/resources/batchWorkflowRun/client/Client.js +3 -1
  16. package/api/resources/evaluationSet/client/Client.js +3 -3
  17. package/api/resources/evaluationSetItem/client/Client.js +4 -4
  18. package/api/resources/file/client/Client.d.ts +18 -0
  19. package/api/resources/file/client/Client.js +69 -3
  20. package/api/resources/file/types/FileDeleteResponse.d.ts +10 -0
  21. package/api/resources/file/types/index.d.ts +1 -0
  22. package/api/resources/file/types/index.js +1 -0
  23. package/api/resources/index.d.ts +3 -0
  24. package/api/resources/index.js +4 -1
  25. package/api/resources/parserRun/client/Client.d.ts +74 -0
  26. package/api/resources/parserRun/client/Client.js +211 -0
  27. package/api/resources/parserRun/client/index.d.ts +1 -0
  28. package/api/resources/parserRun/client/index.js +17 -0
  29. package/api/resources/parserRun/client/requests/ParserRunGetRequest.d.ts +16 -0
  30. package/api/resources/parserRun/client/requests/index.d.ts +1 -0
  31. package/api/resources/parserRun/client/requests/index.js +2 -0
  32. package/api/resources/parserRun/index.d.ts +2 -0
  33. package/api/resources/parserRun/index.js +18 -0
  34. package/api/resources/parserRun/types/ParserRunDeleteResponse.d.ts +10 -0
  35. package/api/resources/parserRun/types/ParserRunGetRequestResponseType.d.ts +8 -0
  36. package/api/resources/parserRun/types/ParserRunGetRequestResponseType.js +10 -0
  37. package/api/resources/parserRun/types/ParserRunGetResponse.d.ts +10 -0
  38. package/api/resources/parserRun/types/ParserRunGetResponse.js +5 -0
  39. package/api/resources/parserRun/types/ParserRunGetResponseParserRun.d.ts +13 -0
  40. package/api/resources/parserRun/types/ParserRunGetResponseParserRun.js +5 -0
  41. package/api/resources/parserRun/types/index.d.ts +4 -0
  42. package/api/resources/parserRun/types/index.js +20 -0
  43. package/api/resources/processor/client/Client.js +2 -2
  44. package/api/resources/processorRun/client/Client.d.ts +25 -7
  45. package/api/resources/processorRun/client/Client.js +78 -10
  46. package/api/resources/processorRun/client/requests/ProcessorRunCreateRequest.d.ts +6 -0
  47. package/api/resources/processorRun/types/ProcessorRunDeleteResponse.d.ts +10 -0
  48. package/api/resources/processorRun/types/ProcessorRunDeleteResponse.js +5 -0
  49. package/api/resources/processorRun/types/index.d.ts +1 -0
  50. package/api/resources/processorRun/types/index.js +1 -0
  51. package/api/resources/processorVersion/client/Client.js +3 -3
  52. package/api/resources/workflow/client/Client.js +1 -1
  53. package/api/resources/workflowRun/client/Client.d.ts +18 -0
  54. package/api/resources/workflowRun/client/Client.js +70 -4
  55. package/api/resources/workflowRun/client/requests/WorkflowRunCreateRequest.d.ts +1 -1
  56. package/api/resources/workflowRun/types/WorkflowRunDeleteResponse.d.ts +10 -0
  57. package/api/resources/workflowRun/types/WorkflowRunDeleteResponse.js +5 -0
  58. package/api/resources/workflowRun/types/index.d.ts +1 -0
  59. package/api/resources/workflowRun/types/index.js +1 -0
  60. package/api/resources/workflowRunOutput/client/Client.js +1 -1
  61. package/api/types/ClassificationAdvancedOptions.d.ts +2 -0
  62. package/api/types/ClassificationAdvancedOptionsPageRangesItem.d.ts +9 -0
  63. package/api/types/ClassificationAdvancedOptionsPageRangesItem.js +5 -0
  64. package/api/types/ClassificationConfig.d.ts +2 -0
  65. package/api/types/ExtendError.d.ts +13 -0
  66. package/api/types/ExtendError.js +5 -0
  67. package/api/types/ExtractionAdvancedOptions.d.ts +2 -0
  68. package/api/types/ExtractionAdvancedOptionsPageRangesItem.d.ts +9 -0
  69. package/api/types/ExtractionAdvancedOptionsPageRangesItem.js +5 -0
  70. package/api/types/ExtractionConfig.d.ts +2 -0
  71. package/api/types/ParseAsyncRequestFile.d.ts +18 -0
  72. package/api/types/ParseAsyncRequestFile.js +5 -0
  73. package/api/types/ParseRequestResponseType.d.ts +8 -0
  74. package/api/types/ParseRequestResponseType.js +10 -0
  75. package/api/types/{ParseResponse.d.ts → ParserRun.d.ts} +7 -6
  76. package/api/types/ParserRun.js +5 -0
  77. package/api/types/{ParseResponseMetrics.d.ts → ParserRunMetrics.d.ts} +1 -1
  78. package/api/types/ParserRunMetrics.js +5 -0
  79. package/api/types/ParserRunStatus.d.ts +19 -0
  80. package/api/types/ParserRunStatus.js +5 -0
  81. package/api/types/{ParseResponseStatus.d.ts → ParserRunStatusEnum.d.ts} +2 -2
  82. package/api/types/{ParseResponseStatus.js → ParserRunStatusEnum.js} +2 -2
  83. package/api/types/ParserRunStatusStatus.d.ts +12 -0
  84. package/api/types/ParserRunStatusStatus.js +11 -0
  85. package/api/types/SplitterAdvancedOptions.d.ts +2 -0
  86. package/api/types/SplitterAdvancedOptionsPageRangesItem.d.ts +9 -0
  87. package/api/types/SplitterAdvancedOptionsPageRangesItem.js +5 -0
  88. package/api/types/SplitterConfig.d.ts +2 -0
  89. package/api/types/TooManyRequestsErrorBody.d.ts +6 -0
  90. package/api/types/TooManyRequestsErrorBody.js +5 -0
  91. package/api/types/WebhookEventEventType.d.ts +3 -1
  92. package/api/types/WebhookEventEventType.js +2 -0
  93. package/api/types/WebhookEventPayload.d.ts +1 -1
  94. package/api/types/index.d.ts +12 -3
  95. package/api/types/index.js +12 -3
  96. package/dist/Client.d.ts +30 -1
  97. package/dist/Client.js +111 -14
  98. package/dist/api/client/requests/ParseAsyncRequest.d.ts +15 -0
  99. package/dist/api/client/requests/ParseAsyncRequest.js +5 -0
  100. package/dist/api/client/requests/ParseRequest.d.ts +6 -0
  101. package/dist/api/client/requests/index.d.ts +1 -0
  102. package/dist/api/errors/InternalServerError.d.ts +9 -0
  103. package/dist/api/errors/InternalServerError.js +52 -0
  104. package/dist/api/errors/NotFoundError.d.ts +1 -2
  105. package/dist/api/errors/TooManyRequestsError.d.ts +9 -0
  106. package/dist/api/errors/TooManyRequestsError.js +52 -0
  107. package/dist/api/errors/index.d.ts +2 -0
  108. package/dist/api/errors/index.js +2 -0
  109. package/dist/api/resources/batchProcessorRun/client/Client.js +1 -1
  110. package/dist/api/resources/batchWorkflowRun/client/Client.d.ts +2 -0
  111. package/dist/api/resources/batchWorkflowRun/client/Client.js +3 -1
  112. package/dist/api/resources/evaluationSet/client/Client.js +3 -3
  113. package/dist/api/resources/evaluationSetItem/client/Client.js +4 -4
  114. package/dist/api/resources/file/client/Client.d.ts +18 -0
  115. package/dist/api/resources/file/client/Client.js +69 -3
  116. package/dist/api/resources/file/types/FileDeleteResponse.d.ts +10 -0
  117. package/dist/api/resources/file/types/FileDeleteResponse.js +5 -0
  118. package/dist/api/resources/file/types/index.d.ts +1 -0
  119. package/dist/api/resources/file/types/index.js +1 -0
  120. package/dist/api/resources/index.d.ts +3 -0
  121. package/dist/api/resources/index.js +4 -1
  122. package/dist/api/resources/parserRun/client/Client.d.ts +74 -0
  123. package/dist/api/resources/parserRun/client/Client.js +211 -0
  124. package/dist/api/resources/parserRun/client/index.d.ts +1 -0
  125. package/dist/api/resources/parserRun/client/index.js +17 -0
  126. package/dist/api/resources/parserRun/client/requests/ParserRunGetRequest.d.ts +16 -0
  127. package/dist/api/resources/parserRun/client/requests/ParserRunGetRequest.js +5 -0
  128. package/dist/api/resources/parserRun/client/requests/index.d.ts +1 -0
  129. package/dist/api/resources/parserRun/client/requests/index.js +2 -0
  130. package/dist/api/resources/parserRun/index.d.ts +2 -0
  131. package/dist/api/resources/parserRun/index.js +18 -0
  132. package/dist/api/resources/parserRun/types/ParserRunDeleteResponse.d.ts +10 -0
  133. package/dist/api/resources/parserRun/types/ParserRunDeleteResponse.js +5 -0
  134. package/dist/api/resources/parserRun/types/ParserRunGetRequestResponseType.d.ts +8 -0
  135. package/dist/api/resources/parserRun/types/ParserRunGetRequestResponseType.js +10 -0
  136. package/dist/api/resources/parserRun/types/ParserRunGetResponse.d.ts +10 -0
  137. package/dist/api/resources/parserRun/types/ParserRunGetResponse.js +5 -0
  138. package/dist/api/resources/parserRun/types/ParserRunGetResponseParserRun.d.ts +13 -0
  139. package/dist/api/resources/parserRun/types/ParserRunGetResponseParserRun.js +5 -0
  140. package/dist/api/resources/parserRun/types/index.d.ts +4 -0
  141. package/dist/api/resources/parserRun/types/index.js +20 -0
  142. package/dist/api/resources/processor/client/Client.js +2 -2
  143. package/dist/api/resources/processorRun/client/Client.d.ts +25 -7
  144. package/dist/api/resources/processorRun/client/Client.js +78 -10
  145. package/dist/api/resources/processorRun/client/requests/ProcessorRunCreateRequest.d.ts +6 -0
  146. package/dist/api/resources/processorRun/types/ProcessorRunDeleteResponse.d.ts +10 -0
  147. package/dist/api/resources/processorRun/types/ProcessorRunDeleteResponse.js +5 -0
  148. package/dist/api/resources/processorRun/types/index.d.ts +1 -0
  149. package/dist/api/resources/processorRun/types/index.js +1 -0
  150. package/dist/api/resources/processorVersion/client/Client.js +3 -3
  151. package/dist/api/resources/workflow/client/Client.js +1 -1
  152. package/dist/api/resources/workflowRun/client/Client.d.ts +18 -0
  153. package/dist/api/resources/workflowRun/client/Client.js +70 -4
  154. package/dist/api/resources/workflowRun/client/requests/WorkflowRunCreateRequest.d.ts +1 -1
  155. package/dist/api/resources/workflowRun/types/WorkflowRunDeleteResponse.d.ts +10 -0
  156. package/dist/api/resources/workflowRun/types/WorkflowRunDeleteResponse.js +5 -0
  157. package/dist/api/resources/workflowRun/types/index.d.ts +1 -0
  158. package/dist/api/resources/workflowRun/types/index.js +1 -0
  159. package/dist/api/resources/workflowRunOutput/client/Client.js +1 -1
  160. package/dist/api/types/ClassificationAdvancedOptions.d.ts +2 -0
  161. package/dist/api/types/ClassificationAdvancedOptionsPageRangesItem.d.ts +9 -0
  162. package/dist/api/types/ClassificationAdvancedOptionsPageRangesItem.js +5 -0
  163. package/dist/api/types/ClassificationConfig.d.ts +2 -0
  164. package/dist/api/types/ExtendError.d.ts +13 -0
  165. package/dist/api/types/ExtendError.js +5 -0
  166. package/dist/api/types/ExtractionAdvancedOptions.d.ts +2 -0
  167. package/dist/api/types/ExtractionAdvancedOptionsPageRangesItem.d.ts +9 -0
  168. package/dist/api/types/ExtractionAdvancedOptionsPageRangesItem.js +5 -0
  169. package/dist/api/types/ExtractionConfig.d.ts +2 -0
  170. package/dist/api/types/ParseAsyncRequestFile.d.ts +18 -0
  171. package/dist/api/types/ParseAsyncRequestFile.js +5 -0
  172. package/dist/api/types/ParseRequestResponseType.d.ts +8 -0
  173. package/dist/api/types/ParseRequestResponseType.js +10 -0
  174. package/dist/api/types/{ParseResponse.d.ts → ParserRun.d.ts} +7 -6
  175. package/dist/api/types/ParserRun.js +5 -0
  176. package/dist/api/types/{ParseResponseMetrics.d.ts → ParserRunMetrics.d.ts} +1 -1
  177. package/dist/api/types/ParserRunMetrics.js +5 -0
  178. package/dist/api/types/ParserRunStatus.d.ts +19 -0
  179. package/dist/api/types/ParserRunStatus.js +5 -0
  180. package/dist/api/types/{ParseResponseStatus.d.ts → ParserRunStatusEnum.d.ts} +2 -2
  181. package/dist/api/types/{ParseResponseStatus.js → ParserRunStatusEnum.js} +2 -2
  182. package/dist/api/types/ParserRunStatusStatus.d.ts +12 -0
  183. package/dist/api/types/ParserRunStatusStatus.js +11 -0
  184. package/dist/api/types/SplitterAdvancedOptions.d.ts +2 -0
  185. package/dist/api/types/SplitterAdvancedOptionsPageRangesItem.d.ts +9 -0
  186. package/dist/api/types/SplitterAdvancedOptionsPageRangesItem.js +5 -0
  187. package/dist/api/types/SplitterConfig.d.ts +2 -0
  188. package/dist/api/types/TooManyRequestsErrorBody.d.ts +6 -0
  189. package/dist/api/types/TooManyRequestsErrorBody.js +5 -0
  190. package/dist/api/types/WebhookEventEventType.d.ts +3 -1
  191. package/dist/api/types/WebhookEventEventType.js +2 -0
  192. package/dist/api/types/WebhookEventPayload.d.ts +1 -1
  193. package/dist/api/types/index.d.ts +12 -3
  194. package/dist/api/types/index.js +12 -3
  195. package/dist/version.d.ts +1 -1
  196. package/dist/version.js +1 -1
  197. package/package.json +1 -1
  198. package/reference.md +380 -17
  199. package/version.d.ts +1 -1
  200. package/version.js +1 -1
  201. /package/api/{types/ParseResponse.js → client/requests/ParseAsyncRequest.js} +0 -0
  202. /package/api/{types/ParseResponseMetrics.js → resources/file/types/FileDeleteResponse.js} +0 -0
  203. /package/{dist/api/types/ParseResponse.js → api/resources/parserRun/client/requests/ParserRunGetRequest.js} +0 -0
  204. /package/{dist/api/types/ParseResponseMetrics.js → api/resources/parserRun/types/ParserRunDeleteResponse.js} +0 -0
package/Client.d.ts CHANGED
@@ -9,6 +9,7 @@ import { BatchWorkflowRun } from "./api/resources/batchWorkflowRun/client/Client
9
9
  import { ProcessorRun } from "./api/resources/processorRun/client/Client";
10
10
  import { Processor } from "./api/resources/processor/client/Client";
11
11
  import { ProcessorVersion } from "./api/resources/processorVersion/client/Client";
12
+ import { ParserRun } from "./api/resources/parserRun/client/Client";
12
13
  import { File_ } from "./api/resources/file/client/Client";
13
14
  import { EvaluationSet } from "./api/resources/evaluationSet/client/Client";
14
15
  import { EvaluationSetItem } from "./api/resources/evaluationSetItem/client/Client";
@@ -45,6 +46,7 @@ export declare class ExtendClient {
45
46
  protected _processorRun: ProcessorRun | undefined;
46
47
  protected _processor: Processor | undefined;
47
48
  protected _processorVersion: ProcessorVersion | undefined;
49
+ protected _parserRun: ParserRun | undefined;
48
50
  protected _file: File_ | undefined;
49
51
  protected _evaluationSet: EvaluationSet | undefined;
50
52
  protected _evaluationSetItem: EvaluationSetItem | undefined;
@@ -57,6 +59,7 @@ export declare class ExtendClient {
57
59
  get processorRun(): ProcessorRun;
58
60
  get processor(): Processor;
59
61
  get processorVersion(): ProcessorVersion;
62
+ get parserRun(): ParserRun;
60
63
  get file(): File_;
61
64
  get evaluationSet(): EvaluationSet;
62
65
  get evaluationSetItem(): EvaluationSetItem;
@@ -84,7 +87,33 @@ export declare class ExtendClient {
84
87
  * file: {}
85
88
  * })
86
89
  */
87
- parse(request: Extend.ParseRequest, requestOptions?: ExtendClient.RequestOptions): core.HttpResponsePromise<Extend.ParseResponse>;
90
+ parse(request: Extend.ParseRequest, requestOptions?: ExtendClient.RequestOptions): core.HttpResponsePromise<Extend.ParserRun>;
88
91
  private __parse;
92
+ /**
93
+ * Parse files **asynchronously** to get cleaned, chunked target content (e.g. markdown).
94
+ *
95
+ * The Parse Async endpoint allows you to convert documents into structured, machine-readable formats with fine-grained control over the parsing process. This endpoint is ideal for extracting cleaned document content to be used as context for downstream processing, e.g. RAG pipelines, custom ingestion pipelines, embeddings classification, etc.
96
+ *
97
+ * Parse files asynchronously and get a parser run ID that can be used to check status and retrieve results with the [Get Parser Run](https://docs.extend.ai/2025-04-21/developers/api-reference/parse-endpoints/get-parser-run) endpoint.
98
+ *
99
+ * This is useful for:
100
+ * * Large files that may take longer to process
101
+ * * Avoiding timeout issues with synchronous parsing.
102
+ *
103
+ * For more details, see the [Parse File guide](https://docs.extend.ai/2025-04-21/developers/guides/parse).
104
+ *
105
+ * @param {Extend.ParseAsyncRequest} request
106
+ * @param {ExtendClient.RequestOptions} requestOptions - Request-specific configuration.
107
+ *
108
+ * @throws {@link Extend.BadRequestError}
109
+ * @throws {@link Extend.UnauthorizedError}
110
+ *
111
+ * @example
112
+ * await client.parseAsync({
113
+ * file: {}
114
+ * })
115
+ */
116
+ parseAsync(request: Extend.ParseAsyncRequest, requestOptions?: ExtendClient.RequestOptions): core.HttpResponsePromise<Extend.ParserRunStatus>;
117
+ private __parseAsync;
89
118
  protected _getAuthorizationHeader(): Promise<string>;
90
119
  }
package/Client.js CHANGED
@@ -44,6 +44,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
44
44
  step((generator = generator.apply(thisArg, _arguments || [])).next());
45
45
  });
46
46
  };
47
+ var __rest = (this && this.__rest) || function (s, e) {
48
+ var t = {};
49
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
+ t[p] = s[p];
51
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
+ t[p[i]] = s[p[i]];
55
+ }
56
+ return t;
57
+ };
47
58
  var __importDefault = (this && this.__importDefault) || function (mod) {
48
59
  return (mod && mod.__esModule) ? mod : { "default": mod };
49
60
  };
@@ -59,12 +70,13 @@ const Client_2 = require("./api/resources/batchWorkflowRun/client/Client");
59
70
  const Client_3 = require("./api/resources/processorRun/client/Client");
60
71
  const Client_4 = require("./api/resources/processor/client/Client");
61
72
  const Client_5 = require("./api/resources/processorVersion/client/Client");
62
- const Client_6 = require("./api/resources/file/client/Client");
63
- const Client_7 = require("./api/resources/evaluationSet/client/Client");
64
- const Client_8 = require("./api/resources/evaluationSetItem/client/Client");
65
- const Client_9 = require("./api/resources/workflowRunOutput/client/Client");
66
- const Client_10 = require("./api/resources/batchProcessorRun/client/Client");
67
- const Client_11 = require("./api/resources/workflow/client/Client");
73
+ const Client_6 = require("./api/resources/parserRun/client/Client");
74
+ const Client_7 = require("./api/resources/file/client/Client");
75
+ const Client_8 = require("./api/resources/evaluationSet/client/Client");
76
+ const Client_9 = require("./api/resources/evaluationSetItem/client/Client");
77
+ const Client_10 = require("./api/resources/workflowRunOutput/client/Client");
78
+ const Client_11 = require("./api/resources/batchProcessorRun/client/Client");
79
+ const Client_12 = require("./api/resources/workflow/client/Client");
68
80
  class ExtendClient {
69
81
  constructor(_options) {
70
82
  this._options = _options;
@@ -89,29 +101,33 @@ class ExtendClient {
89
101
  var _a;
90
102
  return ((_a = this._processorVersion) !== null && _a !== void 0 ? _a : (this._processorVersion = new Client_5.ProcessorVersion(this._options)));
91
103
  }
104
+ get parserRun() {
105
+ var _a;
106
+ return ((_a = this._parserRun) !== null && _a !== void 0 ? _a : (this._parserRun = new Client_6.ParserRun(this._options)));
107
+ }
92
108
  get file() {
93
109
  var _a;
94
- return ((_a = this._file) !== null && _a !== void 0 ? _a : (this._file = new Client_6.File_(this._options)));
110
+ return ((_a = this._file) !== null && _a !== void 0 ? _a : (this._file = new Client_7.File_(this._options)));
95
111
  }
96
112
  get evaluationSet() {
97
113
  var _a;
98
- return ((_a = this._evaluationSet) !== null && _a !== void 0 ? _a : (this._evaluationSet = new Client_7.EvaluationSet(this._options)));
114
+ return ((_a = this._evaluationSet) !== null && _a !== void 0 ? _a : (this._evaluationSet = new Client_8.EvaluationSet(this._options)));
99
115
  }
100
116
  get evaluationSetItem() {
101
117
  var _a;
102
- return ((_a = this._evaluationSetItem) !== null && _a !== void 0 ? _a : (this._evaluationSetItem = new Client_8.EvaluationSetItem(this._options)));
118
+ return ((_a = this._evaluationSetItem) !== null && _a !== void 0 ? _a : (this._evaluationSetItem = new Client_9.EvaluationSetItem(this._options)));
103
119
  }
104
120
  get workflowRunOutput() {
105
121
  var _a;
106
- return ((_a = this._workflowRunOutput) !== null && _a !== void 0 ? _a : (this._workflowRunOutput = new Client_9.WorkflowRunOutput(this._options)));
122
+ return ((_a = this._workflowRunOutput) !== null && _a !== void 0 ? _a : (this._workflowRunOutput = new Client_10.WorkflowRunOutput(this._options)));
107
123
  }
108
124
  get batchProcessorRun() {
109
125
  var _a;
110
- return ((_a = this._batchProcessorRun) !== null && _a !== void 0 ? _a : (this._batchProcessorRun = new Client_10.BatchProcessorRun(this._options)));
126
+ return ((_a = this._batchProcessorRun) !== null && _a !== void 0 ? _a : (this._batchProcessorRun = new Client_11.BatchProcessorRun(this._options)));
111
127
  }
112
128
  get workflow() {
113
129
  var _a;
114
- return ((_a = this._workflow) !== null && _a !== void 0 ? _a : (this._workflow = new Client_11.Workflow(this._options)));
130
+ return ((_a = this._workflow) !== null && _a !== void 0 ? _a : (this._workflow = new Client_12.Workflow(this._options)));
115
131
  }
116
132
  /**
117
133
  * Parse files to get cleaned, chunked target content (e.g. markdown).
@@ -140,13 +156,19 @@ class ExtendClient {
140
156
  __parse(request, requestOptions) {
141
157
  return __awaiter(this, void 0, void 0, function* () {
142
158
  var _a, _b, _c, _d, _e, _f;
159
+ const { responseType } = request, _body = __rest(request, ["responseType"]);
160
+ const _queryParams = {};
161
+ if (responseType != null) {
162
+ _queryParams["responseType"] = responseType;
163
+ }
143
164
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
144
165
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ExtendEnvironment.Production, "parse"),
145
166
  method: "POST",
146
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.3", "User-Agent": "extend-ai/0.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
167
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.4", "User-Agent": "extend-ai/0.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
147
168
  contentType: "application/json",
169
+ queryParameters: _queryParams,
148
170
  requestType: "json",
149
- body: request,
171
+ body: _body,
150
172
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
151
173
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
152
174
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -187,6 +209,81 @@ class ExtendClient {
187
209
  }
188
210
  });
189
211
  }
212
+ /**
213
+ * Parse files **asynchronously** to get cleaned, chunked target content (e.g. markdown).
214
+ *
215
+ * The Parse Async endpoint allows you to convert documents into structured, machine-readable formats with fine-grained control over the parsing process. This endpoint is ideal for extracting cleaned document content to be used as context for downstream processing, e.g. RAG pipelines, custom ingestion pipelines, embeddings classification, etc.
216
+ *
217
+ * Parse files asynchronously and get a parser run ID that can be used to check status and retrieve results with the [Get Parser Run](https://docs.extend.ai/2025-04-21/developers/api-reference/parse-endpoints/get-parser-run) endpoint.
218
+ *
219
+ * This is useful for:
220
+ * * Large files that may take longer to process
221
+ * * Avoiding timeout issues with synchronous parsing.
222
+ *
223
+ * For more details, see the [Parse File guide](https://docs.extend.ai/2025-04-21/developers/guides/parse).
224
+ *
225
+ * @param {Extend.ParseAsyncRequest} request
226
+ * @param {ExtendClient.RequestOptions} requestOptions - Request-specific configuration.
227
+ *
228
+ * @throws {@link Extend.BadRequestError}
229
+ * @throws {@link Extend.UnauthorizedError}
230
+ *
231
+ * @example
232
+ * await client.parseAsync({
233
+ * file: {}
234
+ * })
235
+ */
236
+ parseAsync(request, requestOptions) {
237
+ return core.HttpResponsePromise.fromPromise(this.__parseAsync(request, requestOptions));
238
+ }
239
+ __parseAsync(request, requestOptions) {
240
+ return __awaiter(this, void 0, void 0, function* () {
241
+ var _a, _b, _c, _d, _e, _f;
242
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
243
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ExtendEnvironment.Production, "parse/async"),
244
+ method: "POST",
245
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.4", "User-Agent": "extend-ai/0.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
246
+ contentType: "application/json",
247
+ requestType: "json",
248
+ body: request,
249
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
250
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
251
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
252
+ });
253
+ if (_response.ok) {
254
+ return { data: _response.body, rawResponse: _response.rawResponse };
255
+ }
256
+ if (_response.error.reason === "status-code") {
257
+ switch (_response.error.statusCode) {
258
+ case 400:
259
+ throw new Extend.BadRequestError(_response.error.body, _response.rawResponse);
260
+ case 401:
261
+ throw new Extend.UnauthorizedError(_response.error.body, _response.rawResponse);
262
+ default:
263
+ throw new errors.ExtendError({
264
+ statusCode: _response.error.statusCode,
265
+ body: _response.error.body,
266
+ rawResponse: _response.rawResponse,
267
+ });
268
+ }
269
+ }
270
+ switch (_response.error.reason) {
271
+ case "non-json":
272
+ throw new errors.ExtendError({
273
+ statusCode: _response.error.statusCode,
274
+ body: _response.error.rawBody,
275
+ rawResponse: _response.rawResponse,
276
+ });
277
+ case "timeout":
278
+ throw new errors.ExtendTimeoutError("Timeout exceeded when calling POST /parse/async.");
279
+ case "unknown":
280
+ throw new errors.ExtendError({
281
+ message: _response.error.errorMessage,
282
+ rawResponse: _response.rawResponse,
283
+ });
284
+ }
285
+ });
286
+ }
190
287
  _getAuthorizationHeader() {
191
288
  return __awaiter(this, void 0, void 0, function* () {
192
289
  return `Bearer ${yield core.Supplier.get(this._options.token)}`;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Extend from "../../index";
5
+ /**
6
+ * @example
7
+ * {
8
+ * file: {}
9
+ * }
10
+ */
11
+ export interface ParseAsyncRequest {
12
+ /** A file object containing either a URL or a fileId. */
13
+ file: Extend.ParseAsyncRequestFile;
14
+ config?: Extend.ParseConfig;
15
+ }
@@ -9,6 +9,12 @@ import * as Extend from "../../index";
9
9
  * }
10
10
  */
11
11
  export interface ParseRequest {
12
+ /**
13
+ * Controls the format of the response chunks. Defaults to `json` if not specified.
14
+ * * `json` - Returns parsed outputs in the response body
15
+ * * `url` - Return a presigned URL to the parsed content in the response body
16
+ */
17
+ responseType?: Extend.ParseRequestResponseType;
12
18
  /** A file object containing either a URL or a fileId. */
13
19
  file: Extend.ParseRequestFile;
14
20
  config?: Extend.ParseConfig;
@@ -1 +1,2 @@
1
1
  export { type ParseRequest } from "./ParseRequest";
2
+ export { type ParseAsyncRequest } from "./ParseAsyncRequest";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as errors from "../../errors/index";
5
+ import * as Extend from "../index";
6
+ import * as core from "../../core";
7
+ export declare class InternalServerError extends errors.ExtendError {
8
+ constructor(body: Extend.ExtendError, rawResponse?: core.RawResponse);
9
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.InternalServerError = void 0;
40
+ const errors = __importStar(require("../../errors/index"));
41
+ class InternalServerError extends errors.ExtendError {
42
+ constructor(body, rawResponse) {
43
+ super({
44
+ message: "InternalServerError",
45
+ statusCode: 500,
46
+ body: body,
47
+ rawResponse: rawResponse,
48
+ });
49
+ Object.setPrototypeOf(this, InternalServerError.prototype);
50
+ }
51
+ }
52
+ exports.InternalServerError = InternalServerError;
@@ -2,8 +2,7 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as errors from "../../errors/index";
5
- import * as Extend from "../index";
6
5
  import * as core from "../../core";
7
6
  export declare class NotFoundError extends errors.ExtendError {
8
- constructor(body: Extend.Error_, rawResponse?: core.RawResponse);
7
+ constructor(body?: unknown, rawResponse?: core.RawResponse);
9
8
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as errors from "../../errors/index";
5
+ import * as Extend from "../index";
6
+ import * as core from "../../core";
7
+ export declare class TooManyRequestsError extends errors.ExtendError {
8
+ constructor(body: Extend.TooManyRequestsErrorBody, rawResponse?: core.RawResponse);
9
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.TooManyRequestsError = void 0;
40
+ const errors = __importStar(require("../../errors/index"));
41
+ class TooManyRequestsError extends errors.ExtendError {
42
+ constructor(body, rawResponse) {
43
+ super({
44
+ message: "TooManyRequestsError",
45
+ statusCode: 429,
46
+ body: body,
47
+ rawResponse: rawResponse,
48
+ });
49
+ Object.setPrototypeOf(this, TooManyRequestsError.prototype);
50
+ }
51
+ }
52
+ exports.TooManyRequestsError = TooManyRequestsError;
@@ -1,4 +1,6 @@
1
1
  export * from "./BadRequestError";
2
2
  export * from "./UnauthorizedError";
3
3
  export * from "./NotFoundError";
4
+ export * from "./InternalServerError";
5
+ export * from "./TooManyRequestsError";
4
6
  export * from "./UnprocessableEntityError";
@@ -17,4 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./BadRequestError"), exports);
18
18
  __exportStar(require("./UnauthorizedError"), exports);
19
19
  __exportStar(require("./NotFoundError"), exports);
20
+ __exportStar(require("./InternalServerError"), exports);
21
+ __exportStar(require("./TooManyRequestsError"), exports);
20
22
  __exportStar(require("./UnprocessableEntityError"), exports);
@@ -82,7 +82,7 @@ class BatchProcessorRun {
82
82
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
83
83
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ExtendEnvironment.Production, `batch_processor_runs/${encodeURIComponent(id)}`),
84
84
  method: "GET",
85
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.3", "User-Agent": "extend-ai/0.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
85
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.4", "User-Agent": "extend-ai/0.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
86
86
  contentType: "application/json",
87
87
  requestType: "json",
88
88
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
@@ -37,6 +37,8 @@ export declare class BatchWorkflowRun {
37
37
  *
38
38
  * Our recommended usage pattern is to integrate with [Webhooks](https://docs.extend.ai/2025-04-21/developers/webhooks/configuration) for consuming results, using the `metadata` and `batchId` to match up results to the original inputs in your downstream systems. However, you can integrate in a polling mechanism by using a combination of the [List Workflow Runs](https://docs.extend.ai/2025-04-21/developers/api-reference/workflow-endpoints/list-workflow-runs) endpoint to fetch all runs via a batch, and then [Get Workflow Run](https://docs.extend.ai/2025-04-21/developers/api-reference/workflow-endpoints/get-workflow-run) to fetch the full outputs each run.
39
39
  *
40
+ * **Priority:** All workflow runs created through this batch endpoint are automatically assigned a priority of 90.
41
+ *
40
42
  * **Processing and Monitoring:**
41
43
  * Upon successful submission, the endpoint returns a `batchId`. The individual workflow runs are then queued for processing.
42
44
  *
@@ -65,6 +65,8 @@ class BatchWorkflowRun {
65
65
  *
66
66
  * Our recommended usage pattern is to integrate with [Webhooks](https://docs.extend.ai/2025-04-21/developers/webhooks/configuration) for consuming results, using the `metadata` and `batchId` to match up results to the original inputs in your downstream systems. However, you can integrate in a polling mechanism by using a combination of the [List Workflow Runs](https://docs.extend.ai/2025-04-21/developers/api-reference/workflow-endpoints/list-workflow-runs) endpoint to fetch all runs via a batch, and then [Get Workflow Run](https://docs.extend.ai/2025-04-21/developers/api-reference/workflow-endpoints/get-workflow-run) to fetch the full outputs each run.
67
67
  *
68
+ * **Priority:** All workflow runs created through this batch endpoint are automatically assigned a priority of 90.
69
+ *
68
70
  * **Processing and Monitoring:**
69
71
  * Upon successful submission, the endpoint returns a `batchId`. The individual workflow runs are then queued for processing.
70
72
  *
@@ -93,7 +95,7 @@ class BatchWorkflowRun {
93
95
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
94
96
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ExtendEnvironment.Production, "workflow_runs/batch"),
95
97
  method: "POST",
96
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.3", "User-Agent": "extend-ai/0.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
98
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.4", "User-Agent": "extend-ai/0.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
97
99
  contentType: "application/json",
98
100
  requestType: "json",
99
101
  body: request,
@@ -101,7 +101,7 @@ class EvaluationSet {
101
101
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
102
102
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ExtendEnvironment.Production, "evaluation_sets"),
103
103
  method: "GET",
104
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.3", "User-Agent": "extend-ai/0.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
104
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.4", "User-Agent": "extend-ai/0.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
105
105
  contentType: "application/json",
106
106
  queryParameters: _queryParams,
107
107
  requestType: "json",
@@ -170,7 +170,7 @@ class EvaluationSet {
170
170
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
171
171
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ExtendEnvironment.Production, "evaluation_sets"),
172
172
  method: "POST",
173
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.3", "User-Agent": "extend-ai/0.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
173
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.4", "User-Agent": "extend-ai/0.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
174
174
  contentType: "application/json",
175
175
  requestType: "json",
176
176
  body: request,
@@ -236,7 +236,7 @@ class EvaluationSet {
236
236
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
237
237
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ExtendEnvironment.Production, `evaluation_sets/${encodeURIComponent(id)}`),
238
238
  method: "GET",
239
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.3", "User-Agent": "extend-ai/0.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
239
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.4", "User-Agent": "extend-ai/0.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
240
240
  contentType: "application/json",
241
241
  requestType: "json",
242
242
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 300000,
@@ -101,7 +101,7 @@ class EvaluationSetItem {
101
101
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
102
102
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ExtendEnvironment.Production, `evaluation_sets/${encodeURIComponent(id)}/items`),
103
103
  method: "GET",
104
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.3", "User-Agent": "extend-ai/0.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
104
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.4", "User-Agent": "extend-ai/0.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
105
105
  contentType: "application/json",
106
106
  queryParameters: _queryParams,
107
107
  requestType: "json",
@@ -187,7 +187,7 @@ class EvaluationSetItem {
187
187
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
188
188
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ExtendEnvironment.Production, "evaluation_set_items"),
189
189
  method: "POST",
190
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.3", "User-Agent": "extend-ai/0.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
190
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.4", "User-Agent": "extend-ai/0.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
191
191
  contentType: "application/json",
192
192
  requestType: "json",
193
193
  body: request,
@@ -263,7 +263,7 @@ class EvaluationSetItem {
263
263
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
264
264
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ExtendEnvironment.Production, `evaluation_set_items/${encodeURIComponent(id)}`),
265
265
  method: "POST",
266
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.3", "User-Agent": "extend-ai/0.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
266
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.4", "User-Agent": "extend-ai/0.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
267
267
  contentType: "application/json",
268
268
  requestType: "json",
269
269
  body: request,
@@ -343,7 +343,7 @@ class EvaluationSetItem {
343
343
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
344
344
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ExtendEnvironment.Production, "evaluation_set_items/bulk"),
345
345
  method: "POST",
346
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.3", "User-Agent": "extend-ai/0.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
346
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-extend-api-version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.extendApiVersion) !== null && _f !== void 0 ? _f : "2025-04-21", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "extend-ai", "X-Fern-SDK-Version": "0.0.4", "User-Agent": "extend-ai/0.0.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
347
347
  contentType: "application/json",
348
348
  requestType: "json",
349
349
  body: request,
@@ -65,6 +65,24 @@ export declare class File_ {
65
65
  */
66
66
  get(id: string, request?: Extend.FileGetRequest, requestOptions?: File_.RequestOptions): core.HttpResponsePromise<Extend.FileGetResponse>;
67
67
  private __get;
68
+ /**
69
+ * Delete a file and all associated data from Extend. This operation is permanent and cannot be undone.
70
+ *
71
+ * This endpoint can be used if you'd like to manage data retention on your own rather than automated data retention policies. Or make one-off deletions for your downstream customers.
72
+ *
73
+ * @param {string} id - The ID of the file to delete.
74
+ *
75
+ * Example: `"file_xK9mLPqRtN3vS8wF5hB2cQ"`
76
+ * @param {File_.RequestOptions} requestOptions - Request-specific configuration.
77
+ *
78
+ * @throws {@link Extend.NotFoundError}
79
+ * @throws {@link Extend.InternalServerError}
80
+ *
81
+ * @example
82
+ * await client.file.delete("file_id_here")
83
+ */
84
+ delete(id: string, requestOptions?: File_.RequestOptions): core.HttpResponsePromise<Extend.FileDeleteResponse>;
85
+ private __delete;
68
86
  /**
69
87
  * Upload and create a new file in Extend.
70
88
  *