pulse-ts-sdk 1.0.7 → 1.0.9

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 (150) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +6 -0
  3. package/dist/cjs/Client.js +18 -2
  4. package/dist/cjs/api/client/requests/ExtractAsyncRequest.d.ts +13 -2
  5. package/dist/cjs/api/client/requests/ExtractRequest.d.ts +13 -2
  6. package/dist/cjs/api/errors/GoneError.d.ts +6 -0
  7. package/dist/cjs/api/errors/GoneError.js +54 -0
  8. package/dist/cjs/api/errors/index.d.ts +1 -0
  9. package/dist/cjs/api/errors/index.js +1 -0
  10. package/dist/cjs/api/resources/index.d.ts +4 -0
  11. package/dist/cjs/api/resources/index.js +5 -1
  12. package/dist/cjs/api/resources/largeResults/client/Client.d.ts +35 -0
  13. package/dist/cjs/api/resources/largeResults/client/Client.js +121 -0
  14. package/dist/cjs/api/resources/largeResults/client/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/largeResults/client/index.js +17 -0
  16. package/dist/cjs/api/resources/largeResults/client/requests/GetLargeResultLargeResultsRequest.d.ts +10 -0
  17. package/dist/cjs/api/resources/largeResults/client/requests/GetLargeResultLargeResultsRequest.js +3 -0
  18. package/dist/cjs/api/resources/largeResults/client/requests/index.d.ts +1 -0
  19. package/dist/cjs/api/resources/largeResults/client/requests/index.js +2 -0
  20. package/dist/cjs/api/resources/largeResults/index.d.ts +1 -0
  21. package/dist/cjs/api/resources/largeResults/index.js +17 -0
  22. package/dist/cjs/api/resources/pipeline/client/Client.d.ts +55 -0
  23. package/dist/cjs/api/resources/pipeline/client/Client.js +145 -0
  24. package/dist/cjs/api/resources/pipeline/client/index.d.ts +1 -0
  25. package/dist/cjs/api/resources/pipeline/client/index.js +17 -0
  26. package/dist/cjs/api/resources/pipeline/client/requests/PipelineExecuteInput.d.ts +17 -0
  27. package/dist/cjs/api/resources/pipeline/client/requests/PipelineExecuteInput.js +3 -0
  28. package/dist/cjs/api/resources/pipeline/client/requests/index.d.ts +1 -0
  29. package/dist/cjs/api/resources/pipeline/client/requests/index.js +2 -0
  30. package/dist/cjs/api/resources/pipeline/index.d.ts +1 -0
  31. package/dist/cjs/api/resources/pipeline/index.js +17 -0
  32. package/dist/cjs/api/types/AsyncSubmissionResponse.d.ts +2 -0
  33. package/dist/cjs/api/types/BatchFileUpload.d.ts +6 -0
  34. package/dist/cjs/api/types/BatchFileUpload.js +3 -0
  35. package/dist/cjs/api/types/BatchInputSource.d.ts +4 -3
  36. package/dist/cjs/api/types/ExtractInput.d.ts +13 -2
  37. package/dist/cjs/api/types/ExtractLargeResultResponse.d.ts +25 -0
  38. package/dist/cjs/api/types/ExtractLargeResultResponse.js +3 -0
  39. package/dist/cjs/api/types/ExtractOptions.d.ts +13 -2
  40. package/dist/cjs/api/types/ExtractResponse.d.ts +3 -3
  41. package/dist/cjs/api/types/ExtractResultCore.d.ts +112 -0
  42. package/dist/cjs/api/types/ExtractResultCore.js +3 -0
  43. package/dist/cjs/api/types/GoneErrorBody.d.ts +9 -0
  44. package/dist/cjs/api/types/GoneErrorBody.js +3 -0
  45. package/dist/cjs/api/types/JobStatusResponse.d.ts +1 -1
  46. package/dist/cjs/api/types/PipelineBatchExtractResult.d.ts +13 -0
  47. package/dist/cjs/api/types/PipelineBatchExtractResult.js +3 -0
  48. package/dist/cjs/api/types/PipelineExecuteMultipartInput.d.ts +13 -0
  49. package/dist/cjs/api/types/PipelineExecuteMultipartInput.js +3 -0
  50. package/dist/cjs/api/types/PipelineExecuteResponse.d.ts +21 -0
  51. package/dist/cjs/api/types/PipelineExecuteResponse.js +11 -0
  52. package/dist/cjs/api/types/PipelineExtractResult.d.ts +118 -0
  53. package/dist/cjs/api/types/PipelineExtractResult.js +3 -0
  54. package/dist/cjs/api/types/PipelineResults.d.ts +14 -0
  55. package/dist/cjs/api/types/PipelineResults.js +3 -0
  56. package/dist/cjs/api/types/PipelineSchemaResult.d.ts +14 -0
  57. package/dist/cjs/api/types/PipelineSchemaResult.js +3 -0
  58. package/dist/cjs/api/types/PipelineSplitResult.d.ts +18 -0
  59. package/dist/cjs/api/types/PipelineSplitResult.js +3 -0
  60. package/dist/cjs/api/types/PipelineStepBatchExtractConfig.d.ts +146 -0
  61. package/dist/cjs/api/types/PipelineStepBatchExtractConfig.js +26 -0
  62. package/dist/cjs/api/types/PipelineSteps.d.ts +14 -0
  63. package/dist/cjs/api/types/PipelineSteps.js +3 -0
  64. package/dist/cjs/api/types/SingleSchemaResponse.d.ts +2 -0
  65. package/dist/cjs/api/types/SplitResponse.d.ts +1 -6
  66. package/dist/cjs/api/types/SplitResultCore.d.ts +12 -0
  67. package/dist/cjs/api/types/SplitResultCore.js +3 -0
  68. package/dist/cjs/api/types/SplitSchemaResponse.d.ts +2 -0
  69. package/dist/cjs/api/types/TablesConfig.d.ts +2 -0
  70. package/dist/cjs/api/types/TablesResponse.d.ts +2 -0
  71. package/dist/cjs/api/types/index.d.ts +14 -0
  72. package/dist/cjs/api/types/index.js +14 -0
  73. package/dist/cjs/version.d.ts +1 -1
  74. package/dist/cjs/version.js +1 -1
  75. package/dist/esm/BaseClient.mjs +2 -2
  76. package/dist/esm/Client.d.mts +6 -0
  77. package/dist/esm/Client.mjs +16 -0
  78. package/dist/esm/api/client/requests/ExtractAsyncRequest.d.mts +13 -2
  79. package/dist/esm/api/client/requests/ExtractRequest.d.mts +13 -2
  80. package/dist/esm/api/errors/GoneError.d.mts +6 -0
  81. package/dist/esm/api/errors/GoneError.mjs +17 -0
  82. package/dist/esm/api/errors/index.d.mts +1 -0
  83. package/dist/esm/api/errors/index.mjs +1 -0
  84. package/dist/esm/api/resources/index.d.mts +4 -0
  85. package/dist/esm/api/resources/index.mjs +4 -0
  86. package/dist/esm/api/resources/largeResults/client/Client.d.mts +35 -0
  87. package/dist/esm/api/resources/largeResults/client/Client.mjs +84 -0
  88. package/dist/esm/api/resources/largeResults/client/index.d.mts +1 -0
  89. package/dist/esm/api/resources/largeResults/client/index.mjs +1 -0
  90. package/dist/esm/api/resources/largeResults/client/requests/GetLargeResultLargeResultsRequest.d.mts +10 -0
  91. package/dist/esm/api/resources/largeResults/client/requests/GetLargeResultLargeResultsRequest.mjs +2 -0
  92. package/dist/esm/api/resources/largeResults/client/requests/index.d.mts +1 -0
  93. package/dist/esm/api/resources/largeResults/client/requests/index.mjs +1 -0
  94. package/dist/esm/api/resources/largeResults/index.d.mts +1 -0
  95. package/dist/esm/api/resources/largeResults/index.mjs +1 -0
  96. package/dist/esm/api/resources/pipeline/client/Client.d.mts +55 -0
  97. package/dist/esm/api/resources/pipeline/client/Client.mjs +108 -0
  98. package/dist/esm/api/resources/pipeline/client/index.d.mts +1 -0
  99. package/dist/esm/api/resources/pipeline/client/index.mjs +1 -0
  100. package/dist/esm/api/resources/pipeline/client/requests/PipelineExecuteInput.d.mts +17 -0
  101. package/dist/esm/api/resources/pipeline/client/requests/PipelineExecuteInput.mjs +2 -0
  102. package/dist/esm/api/resources/pipeline/client/requests/index.d.mts +1 -0
  103. package/dist/esm/api/resources/pipeline/client/requests/index.mjs +1 -0
  104. package/dist/esm/api/resources/pipeline/index.d.mts +1 -0
  105. package/dist/esm/api/resources/pipeline/index.mjs +1 -0
  106. package/dist/esm/api/types/AsyncSubmissionResponse.d.mts +2 -0
  107. package/dist/esm/api/types/BatchFileUpload.d.mts +6 -0
  108. package/dist/esm/api/types/BatchFileUpload.mjs +2 -0
  109. package/dist/esm/api/types/BatchInputSource.d.mts +4 -3
  110. package/dist/esm/api/types/ExtractInput.d.mts +13 -2
  111. package/dist/esm/api/types/ExtractLargeResultResponse.d.mts +25 -0
  112. package/dist/esm/api/types/ExtractLargeResultResponse.mjs +2 -0
  113. package/dist/esm/api/types/ExtractOptions.d.mts +13 -2
  114. package/dist/esm/api/types/ExtractResponse.d.mts +3 -3
  115. package/dist/esm/api/types/ExtractResultCore.d.mts +112 -0
  116. package/dist/esm/api/types/ExtractResultCore.mjs +2 -0
  117. package/dist/esm/api/types/GoneErrorBody.d.mts +9 -0
  118. package/dist/esm/api/types/GoneErrorBody.mjs +2 -0
  119. package/dist/esm/api/types/JobStatusResponse.d.mts +1 -1
  120. package/dist/esm/api/types/PipelineBatchExtractResult.d.mts +13 -0
  121. package/dist/esm/api/types/PipelineBatchExtractResult.mjs +2 -0
  122. package/dist/esm/api/types/PipelineExecuteMultipartInput.d.mts +13 -0
  123. package/dist/esm/api/types/PipelineExecuteMultipartInput.mjs +2 -0
  124. package/dist/esm/api/types/PipelineExecuteResponse.d.mts +21 -0
  125. package/dist/esm/api/types/PipelineExecuteResponse.mjs +8 -0
  126. package/dist/esm/api/types/PipelineExtractResult.d.mts +118 -0
  127. package/dist/esm/api/types/PipelineExtractResult.mjs +2 -0
  128. package/dist/esm/api/types/PipelineResults.d.mts +14 -0
  129. package/dist/esm/api/types/PipelineResults.mjs +2 -0
  130. package/dist/esm/api/types/PipelineSchemaResult.d.mts +14 -0
  131. package/dist/esm/api/types/PipelineSchemaResult.mjs +2 -0
  132. package/dist/esm/api/types/PipelineSplitResult.d.mts +18 -0
  133. package/dist/esm/api/types/PipelineSplitResult.mjs +2 -0
  134. package/dist/esm/api/types/PipelineStepBatchExtractConfig.d.mts +146 -0
  135. package/dist/esm/api/types/PipelineStepBatchExtractConfig.mjs +23 -0
  136. package/dist/esm/api/types/PipelineSteps.d.mts +14 -0
  137. package/dist/esm/api/types/PipelineSteps.mjs +2 -0
  138. package/dist/esm/api/types/SingleSchemaResponse.d.mts +2 -0
  139. package/dist/esm/api/types/SplitResponse.d.mts +1 -6
  140. package/dist/esm/api/types/SplitResultCore.d.mts +12 -0
  141. package/dist/esm/api/types/SplitResultCore.mjs +2 -0
  142. package/dist/esm/api/types/SplitSchemaResponse.d.mts +2 -0
  143. package/dist/esm/api/types/TablesConfig.d.mts +2 -0
  144. package/dist/esm/api/types/TablesResponse.d.mts +2 -0
  145. package/dist/esm/api/types/index.d.mts +14 -0
  146. package/dist/esm/api/types/index.mjs +14 -0
  147. package/dist/esm/version.d.mts +1 -1
  148. package/dist/esm/version.mjs +1 -1
  149. package/package.json +1 -1
  150. package/reference.md +161 -0
@@ -16,6 +16,8 @@ export interface ExtractAsyncRequest {
16
16
  figureProcessing?: ExtractAsyncRequest.FigureProcessing;
17
17
  /** Settings that enable additional processing passes or alternate output formats. Each enabled extension produces a corresponding output field under `response.extensions.*`. */
18
18
  extensions?: ExtractAsyncRequest.Extensions;
19
+ /** Settings for Excel/spreadsheet extraction. Controls handling of hidden rows, columns, and sheets. Only applies to `.xlsx` and `.xls` files. Accepts both camelCase and snake_case field names. */
20
+ spreadsheet?: ExtractAsyncRequest.Spreadsheet;
19
21
  /** Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created. */
20
22
  storage?: ExtractAsyncRequest.Storage;
21
23
  /** If true, returns immediately with a job_id for polling via GET /job/{jobId}. Otherwise processes synchronously. */
@@ -62,8 +64,6 @@ export declare namespace ExtractAsyncRequest {
62
64
  * Settings that enable additional processing passes or alternate output formats. Each enabled extension produces a corresponding output field under `response.extensions.*`.
63
65
  */
64
66
  interface Extensions {
65
- /** Merge tables that span multiple pages into a single table. */
66
- mergeTables?: boolean;
67
67
  /** Link footnote markers to their corresponding footnote text. */
68
68
  footnoteReferences?: boolean;
69
69
  /** Chunking configuration. When provided, the document is split into chunks using the specified strategies. Results appear in `response.extensions.chunking`. */
@@ -105,6 +105,17 @@ export declare namespace ExtractAsyncRequest {
105
105
  returnXml?: boolean;
106
106
  }
107
107
  }
108
+ /**
109
+ * Settings for Excel/spreadsheet extraction. Controls handling of hidden rows, columns, and sheets. Only applies to `.xlsx` and `.xls` files. Accepts both camelCase and snake_case field names.
110
+ */
111
+ interface Spreadsheet {
112
+ /** Include rows that are hidden in the Excel workbook. */
113
+ includeHiddenRows?: boolean;
114
+ /** Include columns that are hidden in the Excel workbook. */
115
+ includeHiddenCols?: boolean;
116
+ /** Include sheets that are hidden in the Excel workbook. */
117
+ includeHiddenSheets?: boolean;
118
+ }
108
119
  /**
109
120
  * Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created.
110
121
  */
@@ -16,6 +16,8 @@ export interface ExtractRequest {
16
16
  figureProcessing?: ExtractRequest.FigureProcessing;
17
17
  /** Settings that enable additional processing passes or alternate output formats. Each enabled extension produces a corresponding output field under `response.extensions.*`. */
18
18
  extensions?: ExtractRequest.Extensions;
19
+ /** Settings for Excel/spreadsheet extraction. Controls handling of hidden rows, columns, and sheets. Only applies to `.xlsx` and `.xls` files. Accepts both camelCase and snake_case field names. */
20
+ spreadsheet?: ExtractRequest.Spreadsheet;
19
21
  /** Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created. */
20
22
  storage?: ExtractRequest.Storage;
21
23
  /** If true, returns immediately with a job_id for polling via GET /job/{jobId}. Otherwise processes synchronously. */
@@ -62,8 +64,6 @@ export declare namespace ExtractRequest {
62
64
  * Settings that enable additional processing passes or alternate output formats. Each enabled extension produces a corresponding output field under `response.extensions.*`.
63
65
  */
64
66
  interface Extensions {
65
- /** Merge tables that span multiple pages into a single table. */
66
- mergeTables?: boolean;
67
67
  /** Link footnote markers to their corresponding footnote text. */
68
68
  footnoteReferences?: boolean;
69
69
  /** Chunking configuration. When provided, the document is split into chunks using the specified strategies. Results appear in `response.extensions.chunking`. */
@@ -105,6 +105,17 @@ export declare namespace ExtractRequest {
105
105
  returnXml?: boolean;
106
106
  }
107
107
  }
108
+ /**
109
+ * Settings for Excel/spreadsheet extraction. Controls handling of hidden rows, columns, and sheets. Only applies to `.xlsx` and `.xls` files. Accepts both camelCase and snake_case field names.
110
+ */
111
+ interface Spreadsheet {
112
+ /** Include rows that are hidden in the Excel workbook. */
113
+ includeHiddenRows?: boolean;
114
+ /** Include columns that are hidden in the Excel workbook. */
115
+ includeHiddenCols?: boolean;
116
+ /** Include sheets that are hidden in the Excel workbook. */
117
+ includeHiddenSheets?: boolean;
118
+ }
108
119
  /**
109
120
  * Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created.
110
121
  */
@@ -0,0 +1,6 @@
1
+ import type * as core from "../../core/index.mjs";
2
+ import * as errors from "../../errors/index.mjs";
3
+ import type * as Pulse from "../index.mjs";
4
+ export declare class GoneError extends errors.PulseError {
5
+ constructor(body: Pulse.GoneErrorBody, rawResponse?: core.RawResponse);
6
+ }
@@ -0,0 +1,17 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as errors from "../../errors/index.mjs";
3
+ export class GoneError extends errors.PulseError {
4
+ constructor(body, rawResponse) {
5
+ super({
6
+ message: "GoneError",
7
+ statusCode: 410,
8
+ body: body,
9
+ rawResponse: rawResponse,
10
+ });
11
+ Object.setPrototypeOf(this, new.target.prototype);
12
+ if (Error.captureStackTrace) {
13
+ Error.captureStackTrace(this, this.constructor);
14
+ }
15
+ this.name = this.constructor.name;
16
+ }
17
+ }
@@ -1,5 +1,6 @@
1
1
  export * from "./BadRequestError.mjs";
2
2
  export * from "./ForbiddenError.mjs";
3
+ export * from "./GoneError.mjs";
3
4
  export * from "./InternalServerError.mjs";
4
5
  export * from "./NotFoundError.mjs";
5
6
  export * from "./TooManyRequestsError.mjs";
@@ -1,5 +1,6 @@
1
1
  export * from "./BadRequestError.mjs";
2
2
  export * from "./ForbiddenError.mjs";
3
+ export * from "./GoneError.mjs";
3
4
  export * from "./InternalServerError.mjs";
4
5
  export * from "./NotFoundError.mjs";
5
6
  export * from "./TooManyRequestsError.mjs";
@@ -2,5 +2,9 @@ export * from "./batch/client/requests/index.mjs";
2
2
  export * as batch from "./batch/index.mjs";
3
3
  export * from "./jobs/client/requests/index.mjs";
4
4
  export * as jobs from "./jobs/index.mjs";
5
+ export * from "./largeResults/client/requests/index.mjs";
6
+ export * as largeResults from "./largeResults/index.mjs";
7
+ export * from "./pipeline/client/requests/index.mjs";
8
+ export * as pipeline from "./pipeline/index.mjs";
5
9
  export * as webhooks from "./webhooks/index.mjs";
6
10
  export * from "./webhooks/types/index.mjs";
@@ -2,5 +2,9 @@ export * from "./batch/client/requests/index.mjs";
2
2
  export * as batch from "./batch/index.mjs";
3
3
  export * from "./jobs/client/requests/index.mjs";
4
4
  export * as jobs from "./jobs/index.mjs";
5
+ export * from "./largeResults/client/requests/index.mjs";
6
+ export * as largeResults from "./largeResults/index.mjs";
7
+ export * from "./pipeline/client/requests/index.mjs";
8
+ export * as pipeline from "./pipeline/index.mjs";
5
9
  export * as webhooks from "./webhooks/index.mjs";
6
10
  export * from "./webhooks/types/index.mjs";
@@ -0,0 +1,35 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
3
+ import * as core from "../../../../core/index.mjs";
4
+ import * as Pulse from "../../../index.mjs";
5
+ export declare namespace LargeResultsClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class LargeResultsClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<LargeResultsClient.Options>;
12
+ constructor(options?: LargeResultsClient.Options);
13
+ /**
14
+ * Download the full result for a large extraction (70+ pages).
15
+ *
16
+ * When `/extract` or `GET /job/{jobId}` returns `is_url: true`, fetch
17
+ * the complete result from the URL provided. The URL is single-use:
18
+ * after a successful download the resource is deleted and subsequent
19
+ * requests return 410 Gone.
20
+ *
21
+ * @param {Pulse.GetLargeResultLargeResultsRequest} request
22
+ * @param {LargeResultsClient.RequestOptions} requestOptions - Request-specific configuration.
23
+ *
24
+ * @throws {@link Pulse.NotFoundError}
25
+ * @throws {@link Pulse.GoneError}
26
+ * @throws {@link Pulse.InternalServerError}
27
+ *
28
+ * @example
29
+ * await client.largeResults.getLargeResult({
30
+ * jobId: "jobId"
31
+ * })
32
+ */
33
+ getLargeResult(request: Pulse.GetLargeResultLargeResultsRequest, requestOptions?: LargeResultsClient.RequestOptions): core.HttpResponsePromise<Pulse.ExtractResultCore>;
34
+ private __getLargeResult;
35
+ }
@@ -0,0 +1,84 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../core/headers.mjs";
13
+ import * as core from "../../../../core/index.mjs";
14
+ import * as environments from "../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../errors/index.mjs";
17
+ import * as Pulse from "../../../index.mjs";
18
+ export class LargeResultsClient {
19
+ constructor(options = {}) {
20
+ this._options = normalizeClientOptionsWithAuth(options);
21
+ }
22
+ /**
23
+ * Download the full result for a large extraction (70+ pages).
24
+ *
25
+ * When `/extract` or `GET /job/{jobId}` returns `is_url: true`, fetch
26
+ * the complete result from the URL provided. The URL is single-use:
27
+ * after a successful download the resource is deleted and subsequent
28
+ * requests return 410 Gone.
29
+ *
30
+ * @param {Pulse.GetLargeResultLargeResultsRequest} request
31
+ * @param {LargeResultsClient.RequestOptions} requestOptions - Request-specific configuration.
32
+ *
33
+ * @throws {@link Pulse.NotFoundError}
34
+ * @throws {@link Pulse.GoneError}
35
+ * @throws {@link Pulse.InternalServerError}
36
+ *
37
+ * @example
38
+ * await client.largeResults.getLargeResult({
39
+ * jobId: "jobId"
40
+ * })
41
+ */
42
+ getLargeResult(request, requestOptions) {
43
+ return core.HttpResponsePromise.fromPromise(this.__getLargeResult(request, requestOptions));
44
+ }
45
+ __getLargeResult(request, requestOptions) {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
48
+ const { jobId } = request;
49
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
50
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
51
+ const _response = yield core.fetcher({
52
+ url: core.url.join((_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.PulseEnvironment.Default, `large_results/${core.url.encodePathParam(jobId)}`),
53
+ method: "GET",
54
+ headers: _headers,
55
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
56
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
57
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
58
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
59
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
60
+ logging: this._options.logging,
61
+ });
62
+ if (_response.ok) {
63
+ return { data: _response.body, rawResponse: _response.rawResponse };
64
+ }
65
+ if (_response.error.reason === "status-code") {
66
+ switch (_response.error.statusCode) {
67
+ case 404:
68
+ throw new Pulse.NotFoundError(_response.error.body, _response.rawResponse);
69
+ case 410:
70
+ throw new Pulse.GoneError(_response.error.body, _response.rawResponse);
71
+ case 500:
72
+ throw new Pulse.InternalServerError(_response.error.body, _response.rawResponse);
73
+ default:
74
+ throw new errors.PulseError({
75
+ statusCode: _response.error.statusCode,
76
+ body: _response.error.body,
77
+ rawResponse: _response.rawResponse,
78
+ });
79
+ }
80
+ }
81
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/large_results/{jobId}");
82
+ });
83
+ }
84
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * jobId: "jobId"
5
+ * }
6
+ */
7
+ export interface GetLargeResultLargeResultsRequest {
8
+ /** Job identifier from the extraction response. */
9
+ jobId: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type { GetLargeResultLargeResultsRequest } from "./GetLargeResultLargeResultsRequest.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1,55 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
3
+ import * as core from "../../../../core/index.mjs";
4
+ import * as Pulse from "../../../index.mjs";
5
+ export declare namespace PipelineClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class PipelineClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<PipelineClient.Options>;
12
+ constructor(options?: PipelineClient.Options);
13
+ /**
14
+ * Chain multiple processing steps (extract, schema, split) into a single
15
+ * request with inline configurations. No saved pipeline required.
16
+ *
17
+ * The `steps` object defines what to run and in what order. Outputs flow
18
+ * forward automatically — you never need to pass extraction IDs between
19
+ * steps.
20
+ *
21
+ * **Supported step combinations:**
22
+ * - `extract` — extract a single document
23
+ * - `extract` → `schema` — extract then apply structured schema
24
+ * - `extract` → `split` — extract then split into topics
25
+ * - `batch_extract` → `schema` — extract multiple files, combine into one schema output
26
+ *
27
+ * **Document input:**
28
+ * - Single file: provide `fileUrl` in JSON or `file` via multipart
29
+ * - Multiple files (batch_extract): provide `fileUrls` in JSON or multiple `file` fields via multipart
30
+ *
31
+ * Set `async: true` to return immediately with a `job_id` for polling via
32
+ * `GET /job/{jobId}`.
33
+ *
34
+ * Set `autoDelete: true` for zero-retention mode — all stored artifacts
35
+ * are deleted immediately after you receive the results. Requires
36
+ * `save_extractions` to be disabled for your organization.
37
+ *
38
+ * Requires the `enable_adhoc_pipeline` feature flag.
39
+ *
40
+ * @param {Pulse.PipelineExecuteInput} request
41
+ * @param {PipelineClient.RequestOptions} requestOptions - Request-specific configuration.
42
+ *
43
+ * @throws {@link Pulse.BadRequestError}
44
+ * @throws {@link Pulse.UnauthorizedError}
45
+ * @throws {@link Pulse.ForbiddenError}
46
+ * @throws {@link Pulse.TooManyRequestsError}
47
+ *
48
+ * @example
49
+ * await client.pipeline.execute({
50
+ * steps: {}
51
+ * })
52
+ */
53
+ execute(request: Pulse.PipelineExecuteInput, requestOptions?: PipelineClient.RequestOptions): core.HttpResponsePromise<Pulse.PipelineExecuteResponse>;
54
+ private __execute;
55
+ }
@@ -0,0 +1,108 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../core/headers.mjs";
13
+ import * as core from "../../../../core/index.mjs";
14
+ import * as environments from "../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../errors/index.mjs";
17
+ import * as Pulse from "../../../index.mjs";
18
+ export class PipelineClient {
19
+ constructor(options = {}) {
20
+ this._options = normalizeClientOptionsWithAuth(options);
21
+ }
22
+ /**
23
+ * Chain multiple processing steps (extract, schema, split) into a single
24
+ * request with inline configurations. No saved pipeline required.
25
+ *
26
+ * The `steps` object defines what to run and in what order. Outputs flow
27
+ * forward automatically — you never need to pass extraction IDs between
28
+ * steps.
29
+ *
30
+ * **Supported step combinations:**
31
+ * - `extract` — extract a single document
32
+ * - `extract` → `schema` — extract then apply structured schema
33
+ * - `extract` → `split` — extract then split into topics
34
+ * - `batch_extract` → `schema` — extract multiple files, combine into one schema output
35
+ *
36
+ * **Document input:**
37
+ * - Single file: provide `fileUrl` in JSON or `file` via multipart
38
+ * - Multiple files (batch_extract): provide `fileUrls` in JSON or multiple `file` fields via multipart
39
+ *
40
+ * Set `async: true` to return immediately with a `job_id` for polling via
41
+ * `GET /job/{jobId}`.
42
+ *
43
+ * Set `autoDelete: true` for zero-retention mode — all stored artifacts
44
+ * are deleted immediately after you receive the results. Requires
45
+ * `save_extractions` to be disabled for your organization.
46
+ *
47
+ * Requires the `enable_adhoc_pipeline` feature flag.
48
+ *
49
+ * @param {Pulse.PipelineExecuteInput} request
50
+ * @param {PipelineClient.RequestOptions} requestOptions - Request-specific configuration.
51
+ *
52
+ * @throws {@link Pulse.BadRequestError}
53
+ * @throws {@link Pulse.UnauthorizedError}
54
+ * @throws {@link Pulse.ForbiddenError}
55
+ * @throws {@link Pulse.TooManyRequestsError}
56
+ *
57
+ * @example
58
+ * await client.pipeline.execute({
59
+ * steps: {}
60
+ * })
61
+ */
62
+ execute(request, requestOptions) {
63
+ return core.HttpResponsePromise.fromPromise(this.__execute(request, requestOptions));
64
+ }
65
+ __execute(request, requestOptions) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
68
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
69
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
70
+ const _response = yield core.fetcher({
71
+ url: core.url.join((_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.PulseEnvironment.Default, "pipeline/execute"),
72
+ method: "POST",
73
+ headers: _headers,
74
+ contentType: "application/json",
75
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
76
+ requestType: "json",
77
+ body: request,
78
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
79
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
80
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
81
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
82
+ logging: this._options.logging,
83
+ });
84
+ if (_response.ok) {
85
+ return { data: _response.body, rawResponse: _response.rawResponse };
86
+ }
87
+ if (_response.error.reason === "status-code") {
88
+ switch (_response.error.statusCode) {
89
+ case 400:
90
+ throw new Pulse.BadRequestError(_response.error.body, _response.rawResponse);
91
+ case 401:
92
+ throw new Pulse.UnauthorizedError(_response.error.body, _response.rawResponse);
93
+ case 403:
94
+ throw new Pulse.ForbiddenError(_response.error.body, _response.rawResponse);
95
+ case 429:
96
+ throw new Pulse.TooManyRequestsError(_response.error.body, _response.rawResponse);
97
+ default:
98
+ throw new errors.PulseError({
99
+ statusCode: _response.error.statusCode,
100
+ body: _response.error.body,
101
+ rawResponse: _response.rawResponse,
102
+ });
103
+ }
104
+ }
105
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/pipeline/execute");
106
+ });
107
+ }
108
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,17 @@
1
+ import type * as Pulse from "../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {
5
+ * steps: {}
6
+ * }
7
+ */
8
+ export interface PipelineExecuteInput {
9
+ /** URL of the document to process. Use with `extract` step. */
10
+ file_url?: string;
11
+ /** Ordered step definitions. Key order determines execution order. */
12
+ steps: Pulse.PipelineSteps;
13
+ /** If true, returns immediately with a `job_id` for polling via `GET /job/{jobId}`. */
14
+ async?: boolean;
15
+ /** If true, all stored artifacts are deleted immediately after you receive the results. The inline data in the response is unaffected. Requires `save_extractions` to be disabled for your organization. */
16
+ auto_delete?: boolean;
17
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type { PipelineExecuteInput } from "./PipelineExecuteInput.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -10,6 +10,8 @@ export interface AsyncSubmissionResponse {
10
10
  message?: string;
11
11
  /** **Deprecated** — Timestamp indicating when the job was accepted. Retained for backward compatibility. Use `GET /job/{jobId}` for timing details. */
12
12
  queuedAt?: string;
13
+ /** Number of credits consumed by this request. Only present when the organization has the credit billing system enabled. */
14
+ credits_used?: number | null;
13
15
  }
14
16
  export declare namespace AsyncSubmissionResponse {
15
17
  /** Initial status reported by the server. */
@@ -0,0 +1,6 @@
1
+ export interface BatchFileUpload {
2
+ /** Original filename including extension (e.g. `report.pdf`). */
3
+ filename: string;
4
+ /** Base64-encoded file content. */
5
+ content: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,12 +1,13 @@
1
+ import type * as Pulse from "../index.mjs";
1
2
  /**
2
3
  * Input source for batch file enumeration. Provide exactly one of
3
- * `s3_prefix`, `local_path`, or `file_urls`.
4
+ * `s3_prefix`, `file_urls`, or `files`.
4
5
  */
5
6
  export interface BatchInputSource {
6
7
  /** S3 URI prefix (e.g. `s3://bucket/folder/`). All supported files under this prefix will be processed. */
7
8
  s3_prefix?: string;
8
- /** Absolute path to a local directory. All supported files in the directory will be processed. */
9
- local_path?: string;
10
9
  /** Explicit list of file URLs to download and process. */
11
10
  file_urls?: string[];
11
+ /** Inline file uploads. Each entry contains a filename and base64-encoded file content. Use this when the client has local files that need to be sent to a remote API server. */
12
+ files?: Pulse.BatchFileUpload[];
12
13
  }
@@ -14,6 +14,8 @@ export interface ExtractInput {
14
14
  figureProcessing?: ExtractInput.FigureProcessing;
15
15
  /** Settings that enable additional processing passes or alternate output formats. Each enabled extension produces a corresponding output field under `response.extensions.*`. */
16
16
  extensions?: ExtractInput.Extensions;
17
+ /** Settings for Excel/spreadsheet extraction. Controls handling of hidden rows, columns, and sheets. Only applies to `.xlsx` and `.xls` files. Accepts both camelCase and snake_case field names. */
18
+ spreadsheet?: ExtractInput.Spreadsheet;
17
19
  /** Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created. */
18
20
  storage?: ExtractInput.Storage;
19
21
  /** If true, returns immediately with a job_id for polling via GET /job/{jobId}. Otherwise processes synchronously. */
@@ -60,8 +62,6 @@ export declare namespace ExtractInput {
60
62
  * Settings that enable additional processing passes or alternate output formats. Each enabled extension produces a corresponding output field under `response.extensions.*`.
61
63
  */
62
64
  interface Extensions {
63
- /** Merge tables that span multiple pages into a single table. */
64
- mergeTables?: boolean;
65
65
  /** Link footnote markers to their corresponding footnote text. */
66
66
  footnoteReferences?: boolean;
67
67
  /** Chunking configuration. When provided, the document is split into chunks using the specified strategies. Results appear in `response.extensions.chunking`. */
@@ -103,6 +103,17 @@ export declare namespace ExtractInput {
103
103
  returnXml?: boolean;
104
104
  }
105
105
  }
106
+ /**
107
+ * Settings for Excel/spreadsheet extraction. Controls handling of hidden rows, columns, and sheets. Only applies to `.xlsx` and `.xls` files. Accepts both camelCase and snake_case field names.
108
+ */
109
+ interface Spreadsheet {
110
+ /** Include rows that are hidden in the Excel workbook. */
111
+ includeHiddenRows?: boolean;
112
+ /** Include columns that are hidden in the Excel workbook. */
113
+ includeHiddenCols?: boolean;
114
+ /** Include sheets that are hidden in the Excel workbook. */
115
+ includeHiddenSheets?: boolean;
116
+ }
106
117
  /**
107
118
  * Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created.
108
119
  */
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Returned instead of the full extraction result when the document has 70 or more pages. The `url` field is a single-use download link; fetch it once to retrieve the complete `ExtractResultCore` payload. Subsequent requests to the same URL return 410 Gone.
3
+ */
4
+ export interface ExtractLargeResultResponse {
5
+ /** Always `true` for large document responses. */
6
+ is_url: boolean;
7
+ /** Single-use URL to download the full extraction result. After one successful download the resource is deleted and further requests return 410 Gone. */
8
+ url: string;
9
+ /** Extraction identifier (when storage is enabled). */
10
+ extraction_id?: string;
11
+ /** Number of pages in the document. */
12
+ page_count?: number;
13
+ /** Billing tier and usage information. */
14
+ plan_info?: ExtractLargeResultResponse.PlanInfo;
15
+ }
16
+ export declare namespace ExtractLargeResultResponse {
17
+ /**
18
+ * Billing tier and usage information.
19
+ */
20
+ interface PlanInfo {
21
+ tier?: string;
22
+ pages_used?: number;
23
+ note?: string;
24
+ }
25
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};