pulse-ts-sdk 1.0.15 → 1.0.16

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 (76) hide show
  1. package/dist/cjs/api/client/requests/ExtractAsyncRequest.d.ts +6 -6
  2. package/dist/cjs/api/client/requests/ExtractRequest.d.ts +6 -6
  3. package/dist/cjs/api/resources/results/client/Client.d.ts +28 -0
  4. package/dist/cjs/api/resources/results/client/Client.js +77 -0
  5. package/dist/cjs/api/resources/results/client/requests/GetImageResultsRequest.d.ts +13 -0
  6. package/dist/cjs/api/resources/results/client/requests/GetImageResultsRequest.js +3 -0
  7. package/dist/cjs/api/resources/results/client/requests/index.d.ts +1 -0
  8. package/dist/cjs/api/types/BoundingBoxImage.d.ts +54 -0
  9. package/dist/cjs/api/types/BoundingBoxImage.js +3 -0
  10. package/dist/cjs/api/types/BoundingBoxItem.d.ts +23 -0
  11. package/dist/cjs/api/types/BoundingBoxItem.js +3 -0
  12. package/dist/cjs/api/types/BoundingBoxTable.d.ts +32 -0
  13. package/dist/cjs/api/types/BoundingBoxTable.js +3 -0
  14. package/dist/cjs/api/types/BoundingBoxes.d.ts +20 -0
  15. package/dist/cjs/api/types/BoundingBoxes.js +3 -0
  16. package/dist/cjs/api/types/ExtractInput.d.ts +6 -6
  17. package/dist/cjs/api/types/ExtractLargeResultResponse.d.ts +3 -12
  18. package/dist/cjs/api/types/ExtractOptions.d.ts +6 -6
  19. package/dist/cjs/api/types/ExtractResponse.d.ts +4 -15
  20. package/dist/cjs/api/types/ExtractResultCore.d.ts +5 -15
  21. package/dist/cjs/api/types/FormPlanInfo.d.ts +3 -9
  22. package/dist/cjs/api/types/FormResult.d.ts +2 -1
  23. package/dist/cjs/api/types/PipelineExtractResult.d.ts +5 -15
  24. package/dist/cjs/api/types/PipelineSplitResult.d.ts +2 -0
  25. package/dist/cjs/api/types/PipelineStepBatchExtractConfig.d.ts +6 -6
  26. package/dist/cjs/api/types/PlanInfo.d.ts +13 -0
  27. package/dist/cjs/api/types/PlanInfo.js +3 -0
  28. package/dist/cjs/api/types/SingleSchemaResponse.d.ts +2 -0
  29. package/dist/cjs/api/types/SplitResultCore.d.ts +2 -0
  30. package/dist/cjs/api/types/SplitSchemaResponse.d.ts +2 -0
  31. package/dist/cjs/api/types/TablesResponse.d.ts +3 -0
  32. package/dist/cjs/api/types/VisualType.d.ts +6 -0
  33. package/dist/cjs/api/types/VisualType.js +9 -0
  34. package/dist/cjs/api/types/index.d.ts +6 -0
  35. package/dist/cjs/api/types/index.js +6 -0
  36. package/dist/cjs/version.d.ts +1 -1
  37. package/dist/cjs/version.js +1 -1
  38. package/dist/esm/api/client/requests/ExtractAsyncRequest.d.mts +6 -6
  39. package/dist/esm/api/client/requests/ExtractRequest.d.mts +6 -6
  40. package/dist/esm/api/resources/results/client/Client.d.mts +28 -0
  41. package/dist/esm/api/resources/results/client/Client.mjs +77 -0
  42. package/dist/esm/api/resources/results/client/requests/GetImageResultsRequest.d.mts +13 -0
  43. package/dist/esm/api/resources/results/client/requests/GetImageResultsRequest.mjs +2 -0
  44. package/dist/esm/api/resources/results/client/requests/index.d.mts +1 -0
  45. package/dist/esm/api/types/BoundingBoxImage.d.mts +54 -0
  46. package/dist/esm/api/types/BoundingBoxImage.mjs +2 -0
  47. package/dist/esm/api/types/BoundingBoxItem.d.mts +23 -0
  48. package/dist/esm/api/types/BoundingBoxItem.mjs +2 -0
  49. package/dist/esm/api/types/BoundingBoxTable.d.mts +32 -0
  50. package/dist/esm/api/types/BoundingBoxTable.mjs +2 -0
  51. package/dist/esm/api/types/BoundingBoxes.d.mts +20 -0
  52. package/dist/esm/api/types/BoundingBoxes.mjs +2 -0
  53. package/dist/esm/api/types/ExtractInput.d.mts +6 -6
  54. package/dist/esm/api/types/ExtractLargeResultResponse.d.mts +3 -12
  55. package/dist/esm/api/types/ExtractOptions.d.mts +6 -6
  56. package/dist/esm/api/types/ExtractResponse.d.mts +4 -15
  57. package/dist/esm/api/types/ExtractResultCore.d.mts +5 -15
  58. package/dist/esm/api/types/FormPlanInfo.d.mts +3 -9
  59. package/dist/esm/api/types/FormResult.d.mts +2 -1
  60. package/dist/esm/api/types/PipelineExtractResult.d.mts +5 -15
  61. package/dist/esm/api/types/PipelineSplitResult.d.mts +2 -0
  62. package/dist/esm/api/types/PipelineStepBatchExtractConfig.d.mts +6 -6
  63. package/dist/esm/api/types/PlanInfo.d.mts +13 -0
  64. package/dist/esm/api/types/PlanInfo.mjs +2 -0
  65. package/dist/esm/api/types/SingleSchemaResponse.d.mts +2 -0
  66. package/dist/esm/api/types/SplitResultCore.d.mts +2 -0
  67. package/dist/esm/api/types/SplitSchemaResponse.d.mts +2 -0
  68. package/dist/esm/api/types/TablesResponse.d.mts +3 -0
  69. package/dist/esm/api/types/VisualType.d.mts +6 -0
  70. package/dist/esm/api/types/VisualType.mjs +6 -0
  71. package/dist/esm/api/types/index.d.mts +6 -0
  72. package/dist/esm/api/types/index.mjs +6 -0
  73. package/dist/esm/version.d.mts +1 -1
  74. package/dist/esm/version.mjs +1 -1
  75. package/package.json +1 -1
  76. package/reference.md +84 -0
@@ -14,11 +14,11 @@ export interface ExtractAsyncRequest {
14
14
  extractionConfigId?: string;
15
15
  /** Page range filter supporting segments such as `1-2` or mixed ranges like `1-2,5`. */
16
16
  pages?: string;
17
- /** Settings that control how figures in the document are processed. These affect the markdown output directly (e.g. figure descriptions, chart-to-table conversion, image embedding) and do not produce additional output fields in the response. */
17
+ /** Settings that control how figures and embedded visuals are processed. Applies to both PDFs/images (where figures are detected from layout) and spreadsheets (where charts and embedded images are read directly from the workbook). These options affect the markdown output and the `bounding_boxes.Images[]` array; they do not produce additional output fields elsewhere in the response. */
18
18
  figureProcessing?: ExtractAsyncRequest.FigureProcessing;
19
19
  /** Settings that enable additional processing passes or alternate output formats. Each enabled extension produces a corresponding output field under `response.extensions.*`. */
20
20
  extensions?: ExtractAsyncRequest.Extensions;
21
- /** 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. */
21
+ /** Settings for Excel/spreadsheet extraction. Controls handling of hidden rows, columns, and sheets. Applies to `.xlsx`, `.xlsm`, and `.xls` files. Accepts both camelCase and snake_case field names. */
22
22
  spreadsheet?: ExtractAsyncRequest.Spreadsheet;
23
23
  /** Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created. */
24
24
  storage?: ExtractAsyncRequest.Storage;
@@ -55,12 +55,12 @@ export declare namespace ExtractAsyncRequest {
55
55
  };
56
56
  type Model = (typeof Model)[keyof typeof Model];
57
57
  /**
58
- * Settings that control how figures in the document are processed. These affect the markdown output directly (e.g. figure descriptions, chart-to-table conversion, image embedding) and do not produce additional output fields in the response.
58
+ * Settings that control how figures and embedded visuals are processed. Applies to both PDFs/images (where figures are detected from layout) and spreadsheets (where charts and embedded images are read directly from the workbook). These options affect the markdown output and the `bounding_boxes.Images[]` array; they do not produce additional output fields elsewhere in the response.
59
59
  */
60
60
  interface FigureProcessing {
61
- /** Generate descriptive captions for extracted figures. */
61
+ /** Generate descriptive captions for extracted visuals. When `true`, applies to both detected charts and non-chart images. Captions appear under `bounding_boxes.Images[].description` and inline in the markdown output where applicable. */
62
62
  description?: boolean;
63
- /** Embed base64-encoded images inline in figure tags in the output. Increases response size. */
63
+ /** Return image URLs for extracted visuals. When `true`, applies to both charts and non-chart images. URLs are emitted under `bounding_boxes.Images[].image_url` — typically a Pulse-hosted proxy URL served from `GET /results/{jobId}/images/{filename}`. Spreadsheet charts and embedded images are read directly from the workbook; PDF/image inputs use detected figure regions. */
64
64
  showImages?: boolean;
65
65
  }
66
66
  /**
@@ -109,7 +109,7 @@ export declare namespace ExtractAsyncRequest {
109
109
  }
110
110
  }
111
111
  /**
112
- * 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.
112
+ * Settings for Excel/spreadsheet extraction. Controls handling of hidden rows, columns, and sheets. Applies to `.xlsx`, `.xlsm`, and `.xls` files. Accepts both camelCase and snake_case field names.
113
113
  */
114
114
  interface Spreadsheet {
115
115
  /** Include rows that are hidden in the Excel workbook. */
@@ -14,11 +14,11 @@ export interface ExtractRequest {
14
14
  extractionConfigId?: string;
15
15
  /** Page range filter supporting segments such as `1-2` or mixed ranges like `1-2,5`. */
16
16
  pages?: string;
17
- /** Settings that control how figures in the document are processed. These affect the markdown output directly (e.g. figure descriptions, chart-to-table conversion, image embedding) and do not produce additional output fields in the response. */
17
+ /** Settings that control how figures and embedded visuals are processed. Applies to both PDFs/images (where figures are detected from layout) and spreadsheets (where charts and embedded images are read directly from the workbook). These options affect the markdown output and the `bounding_boxes.Images[]` array; they do not produce additional output fields elsewhere in the response. */
18
18
  figureProcessing?: ExtractRequest.FigureProcessing;
19
19
  /** Settings that enable additional processing passes or alternate output formats. Each enabled extension produces a corresponding output field under `response.extensions.*`. */
20
20
  extensions?: ExtractRequest.Extensions;
21
- /** 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. */
21
+ /** Settings for Excel/spreadsheet extraction. Controls handling of hidden rows, columns, and sheets. Applies to `.xlsx`, `.xlsm`, and `.xls` files. Accepts both camelCase and snake_case field names. */
22
22
  spreadsheet?: ExtractRequest.Spreadsheet;
23
23
  /** Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created. */
24
24
  storage?: ExtractRequest.Storage;
@@ -55,12 +55,12 @@ export declare namespace ExtractRequest {
55
55
  };
56
56
  type Model = (typeof Model)[keyof typeof Model];
57
57
  /**
58
- * Settings that control how figures in the document are processed. These affect the markdown output directly (e.g. figure descriptions, chart-to-table conversion, image embedding) and do not produce additional output fields in the response.
58
+ * Settings that control how figures and embedded visuals are processed. Applies to both PDFs/images (where figures are detected from layout) and spreadsheets (where charts and embedded images are read directly from the workbook). These options affect the markdown output and the `bounding_boxes.Images[]` array; they do not produce additional output fields elsewhere in the response.
59
59
  */
60
60
  interface FigureProcessing {
61
- /** Generate descriptive captions for extracted figures. */
61
+ /** Generate descriptive captions for extracted visuals. When `true`, applies to both detected charts and non-chart images. Captions appear under `bounding_boxes.Images[].description` and inline in the markdown output where applicable. */
62
62
  description?: boolean;
63
- /** Embed base64-encoded images inline in figure tags in the output. Increases response size. */
63
+ /** Return image URLs for extracted visuals. When `true`, applies to both charts and non-chart images. URLs are emitted under `bounding_boxes.Images[].image_url` — typically a Pulse-hosted proxy URL served from `GET /results/{jobId}/images/{filename}`. Spreadsheet charts and embedded images are read directly from the workbook; PDF/image inputs use detected figure regions. */
64
64
  showImages?: boolean;
65
65
  }
66
66
  /**
@@ -109,7 +109,7 @@ export declare namespace ExtractRequest {
109
109
  }
110
110
  }
111
111
  /**
112
- * 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.
112
+ * Settings for Excel/spreadsheet extraction. Controls handling of hidden rows, columns, and sheets. Applies to `.xlsx`, `.xlsm`, and `.xls` files. Accepts both camelCase and snake_case field names.
113
113
  */
114
114
  interface Spreadsheet {
115
115
  /** Include rows that are hidden in the Excel workbook. */
@@ -24,4 +24,32 @@ export declare class ResultsClient {
24
24
  */
25
25
  getPdf(request: Pulse.GetPdfResultsRequest, requestOptions?: ResultsClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
26
26
  private __getPdf;
27
+ /**
28
+ * Stream a PNG/JPEG visual image referenced by an extraction
29
+ * response under `bounding_boxes.Images[].image_url`.
30
+ *
31
+ * The URL is API-hosted instead of raw S3 — the underlying object
32
+ * store is intentionally not part of the public contract. The host
33
+ * in `image_url` mirrors the request origin (e.g. a request to a
34
+ * beta deployment returns image URLs on that same host).
35
+ *
36
+ * **Authentication is required.** Unlike the legacy single-use
37
+ * `/large_results/{jobId}` route, visual artifacts are
38
+ * independently-addressable resources — every fetch must present a
39
+ * valid API key for the owning org. There is no anonymous /
40
+ * TTL-based fallback. Use the same `x-api-key` header you use for
41
+ * `/extract`.
42
+ *
43
+ * Fetching an image does **not** consume the parent extraction's
44
+ * result-delivery slot, so one extraction can produce many image
45
+ * URLs and each can be fetched repeatedly while the artifact is
46
+ * retained.
47
+ * @throws {@link Pulse.BadRequestError}
48
+ * @throws {@link Pulse.UnauthorizedError}
49
+ * @throws {@link Pulse.ForbiddenError}
50
+ * @throws {@link Pulse.NotFoundError}
51
+ * @throws {@link Pulse.InternalServerError}
52
+ */
53
+ getImage(request: Pulse.GetImageResultsRequest, requestOptions?: ResultsClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
54
+ private __getImage;
27
55
  }
@@ -112,5 +112,82 @@ class ResultsClient {
112
112
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/results/{jobId}/pdf");
113
113
  });
114
114
  }
115
+ /**
116
+ * Stream a PNG/JPEG visual image referenced by an extraction
117
+ * response under `bounding_boxes.Images[].image_url`.
118
+ *
119
+ * The URL is API-hosted instead of raw S3 — the underlying object
120
+ * store is intentionally not part of the public contract. The host
121
+ * in `image_url` mirrors the request origin (e.g. a request to a
122
+ * beta deployment returns image URLs on that same host).
123
+ *
124
+ * **Authentication is required.** Unlike the legacy single-use
125
+ * `/large_results/{jobId}` route, visual artifacts are
126
+ * independently-addressable resources — every fetch must present a
127
+ * valid API key for the owning org. There is no anonymous /
128
+ * TTL-based fallback. Use the same `x-api-key` header you use for
129
+ * `/extract`.
130
+ *
131
+ * Fetching an image does **not** consume the parent extraction's
132
+ * result-delivery slot, so one extraction can produce many image
133
+ * URLs and each can be fetched repeatedly while the artifact is
134
+ * retained.
135
+ * @throws {@link Pulse.BadRequestError}
136
+ * @throws {@link Pulse.UnauthorizedError}
137
+ * @throws {@link Pulse.ForbiddenError}
138
+ * @throws {@link Pulse.NotFoundError}
139
+ * @throws {@link Pulse.InternalServerError}
140
+ */
141
+ getImage(request, requestOptions) {
142
+ return core.HttpResponsePromise.fromPromise(this.__getImage(request, requestOptions));
143
+ }
144
+ __getImage(request, requestOptions) {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ var _a, _b, _c, _d, _e, _f, _g, _h;
147
+ const { jobId, filename } = request;
148
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
149
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
150
+ const _response = yield core.fetcher({
151
+ 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, `results/${core.url.encodePathParam(jobId)}/images/${core.url.encodePathParam(filename)}`),
152
+ method: "GET",
153
+ headers: _headers,
154
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
155
+ responseType: "binary-response",
156
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null
157
+ ? requestOptions.timeoutInSeconds * 1000
158
+ : ((_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) != null
159
+ ? ((_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) * 1000
160
+ : undefined,
161
+ maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
162
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
163
+ fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
164
+ logging: this._options.logging,
165
+ });
166
+ if (_response.ok) {
167
+ return { data: _response.body, rawResponse: _response.rawResponse };
168
+ }
169
+ if (_response.error.reason === "status-code") {
170
+ switch (_response.error.statusCode) {
171
+ case 400:
172
+ throw new Pulse.BadRequestError(_response.error.body, _response.rawResponse);
173
+ case 401:
174
+ throw new Pulse.UnauthorizedError(_response.error.body, _response.rawResponse);
175
+ case 403:
176
+ throw new Pulse.ForbiddenError(_response.error.body, _response.rawResponse);
177
+ case 404:
178
+ throw new Pulse.NotFoundError(_response.error.body, _response.rawResponse);
179
+ case 500:
180
+ throw new Pulse.InternalServerError(_response.error.body, _response.rawResponse);
181
+ default:
182
+ throw new errors.PulseError({
183
+ statusCode: _response.error.statusCode,
184
+ body: _response.error.body,
185
+ rawResponse: _response.rawResponse,
186
+ });
187
+ }
188
+ }
189
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/results/{jobId}/images/{filename}");
190
+ });
191
+ }
115
192
  }
116
193
  exports.ResultsClient = ResultsClient;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * jobId: "jobId",
5
+ * filename: "filename"
6
+ * }
7
+ */
8
+ export interface GetImageResultsRequest {
9
+ /** Job identifier — same value used in the `image_url` returned from `/extract`. */
10
+ jobId: string;
11
+ /** Visual filename — e.g. `excel_image_1_1.png`. Must be the exact `filename` segment from the `image_url`. */
12
+ filename: string;
13
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
+ export type { GetImageResultsRequest } from "./GetImageResultsRequest.js";
1
2
  export type { GetPdfResultsRequest } from "./GetPdfResultsRequest.js";
@@ -0,0 +1,54 @@
1
+ import type * as Pulse from "../index.js";
2
+ /**
3
+ * Detected or embedded visual (chart or image) returned under `bounding_boxes.Images`. For PDFs/images, populated when figure detection is enabled. For spreadsheets, populated for embedded charts and images. `image_url` is set when `figure_processing.show_images` is enabled.
4
+ */
5
+ export interface BoundingBoxImage {
6
+ /** Stable visual identifier (e.g. `excel_image_1_1`, `fig-3`). Use this to join with the `data-bb-image-id` attribute in the markdown output. */
7
+ id: string;
8
+ /** Short caption for the visual (e.g. `Chart: Revenue`). Populated by the spreadsheet parser; PDF figures may leave this empty when no caption is detected. */
9
+ content?: string;
10
+ /** Visual class. Drives whether `figure_processing.description` / `figure_processing.show_images` apply to this entry. */
11
+ visual_type: Pulse.VisualType;
12
+ /** 1-indexed page or sheet index. */
13
+ page_number?: number;
14
+ /** Document coordinate polygon when available. Spreadsheet visuals typically use an empty array and rely on `excel_range` for positioning. */
15
+ bounding_box?: number[];
16
+ /** Pulse-hosted URL for the visual image bytes. Present when `figure_processing.show_images` was enabled for this visual_type. Spreadsheet visuals proxy through `GET /results/{jobId}/images/{filename}`; inline figure flows may use a data URI. */
17
+ image_url?: string;
18
+ /** Generated visual description. Present when `figure_processing.description` was enabled for this visual_type. */
19
+ description?: string;
20
+ /** Visual classification metadata when classification was run. Includes confidence, model name, and any non-fatal classification error. */
21
+ classification?: BoundingBoxImage.Classification;
22
+ /** Spreadsheet-only sheet name. */
23
+ sheet_name?: string;
24
+ /** Spreadsheet-only parsed sheet index after hidden-sheet filtering. */
25
+ sheet_index?: number;
26
+ /** Spreadsheet-only original workbook sheet index. */
27
+ workbook_sheet_index?: number;
28
+ /** Spreadsheet-only anchor or covered cell range for the visual. */
29
+ excel_range?: string;
30
+ /** Spreadsheet chart class name (e.g. `BarChart`, `LineChart`) when `visual_type` is `chart`. */
31
+ chart_type?: string;
32
+ /** Spreadsheet chart title when available. */
33
+ chart_title?: string;
34
+ /** Spreadsheet chart source ranges when available, e.g. `["Charts!$B$1:$B$3"]`. */
35
+ source_ranges?: string[];
36
+ /** Optional non-fatal rendering error for spreadsheet visuals. When set, the visual entry is still returned but `image_url` may be omitted. */
37
+ render_error?: string;
38
+ /** Optional non-fatal description-generation error. */
39
+ description_error?: string;
40
+ /** Accepts any additional properties */
41
+ [key: string]: any;
42
+ }
43
+ export declare namespace BoundingBoxImage {
44
+ /**
45
+ * Visual classification metadata when classification was run. Includes confidence, model name, and any non-fatal classification error.
46
+ */
47
+ interface Classification {
48
+ confidence?: number;
49
+ model?: string;
50
+ error?: string;
51
+ /** Accepts any additional properties */
52
+ [key: string]: any;
53
+ }
54
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Common base shape used for `Text`, `Title`, and `Footer` bounding-box entries. Spreadsheet rows may carry additional sheet-scoped fields such as `excel_range` and `sheet_name`; forward-compatible extra properties are accepted.
3
+ */
4
+ export interface BoundingBoxItem {
5
+ /** Stable bounding-box identifier (e.g. `txt-1`, `excel_title_0`). Used by extensions like `footnoteReferences` to cross-reference paragraphs. */
6
+ id?: string;
7
+ /** Plain-text content of the region. */
8
+ content?: string;
9
+ /** 1-indexed page number. For spreadsheets this matches the parsed sheet index after hidden-sheet filtering. */
10
+ page_number?: number;
11
+ /** Document coordinate polygon when available. Spreadsheet visuals may use an empty array and `excel_range` instead. */
12
+ bounding_box?: number[];
13
+ /** Spreadsheet-only anchor or covered cell range. */
14
+ excel_range?: string;
15
+ /** Spreadsheet-only sheet name. */
16
+ sheet_name?: string;
17
+ /** Spreadsheet-only parsed sheet index after hidden-sheet filtering. */
18
+ sheet_index?: number;
19
+ /** Spreadsheet-only original workbook sheet index. */
20
+ workbook_sheet_index?: number;
21
+ /** Accepts any additional properties */
22
+ [key: string]: any;
23
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Detected table region returned under `bounding_boxes.Tables`. Carries a structured `table_info` block plus optional `cell_data`. Kept loose with `additionalProperties: true` to round-trip future fields the server may add (e.g. layout metadata).
3
+ */
4
+ export interface BoundingBoxTable {
5
+ table_info?: BoundingBoxTable.TableInfo;
6
+ /** Table cell payload when available. Shape varies by extraction path; SDK consumers should treat as opaque. */
7
+ cell_data?: Record<string, unknown>[];
8
+ /** Accepts any additional properties */
9
+ [key: string]: any;
10
+ }
11
+ export declare namespace BoundingBoxTable {
12
+ interface TableInfo {
13
+ id?: string;
14
+ dimensions?: number[];
15
+ excel_range?: string;
16
+ sheet_name?: string;
17
+ sheet_index?: number;
18
+ workbook_sheet_index?: number;
19
+ section_index?: number;
20
+ section_type?: string;
21
+ section_name?: string;
22
+ table_name?: string;
23
+ layout_type?: string;
24
+ is_chart?: boolean;
25
+ chart_type?: string;
26
+ chart_title?: string;
27
+ source_ranges?: string[];
28
+ location?: Record<string, unknown>;
29
+ /** Accepts any additional properties */
30
+ [key: string]: any;
31
+ }
32
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,20 @@
1
+ import type * as Pulse from "../index.js";
2
+ /**
3
+ * Positional bounding-box data for text, titles, headers, footers, images, and tables. Used by the frontend for annotation overlays and by SDK consumers to access detected visuals (charts and images) returned under `Images`. Keys not listed here are accepted for forward compatibility (e.g. `markdown_with_ids`, `defined_names`).
4
+ */
5
+ export interface BoundingBoxes {
6
+ /** Detected or embedded visuals. `image_url` is populated when `figure_processing.show_images` was enabled and the entry's `visual_type` matched the requested target. */
7
+ Images?: Pulse.BoundingBoxImage[];
8
+ /** Detected tables. Each entry carries a `table_info` block plus optional `cell_data`. */
9
+ Tables?: Pulse.BoundingBoxTable[];
10
+ /** Body-text paragraphs and detected text regions. For spreadsheets, includes free-form text outside table regions (titles, captions, instructions). */
11
+ Text?: Pulse.BoundingBoxItem[];
12
+ /** Detected title regions. Spreadsheets emit one `Sheet: <name>` title per processed sheet. */
13
+ Title?: Pulse.BoundingBoxItem[];
14
+ /** Detected footer regions (e.g. spreadsheet "Totals" rows, PDF page footers). */
15
+ Footer?: Pulse.BoundingBoxItem[];
16
+ /** Markdown variant with stable `data-bb-*-id` attributes in figure / table / text tags. Lets clients join rendered HTML back to bounding-box entries by id. */
17
+ markdown_with_ids?: string;
18
+ /** Accepts any additional properties */
19
+ [key: string]: any;
20
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -12,11 +12,11 @@ export interface ExtractInput {
12
12
  extractionConfigId?: string;
13
13
  /** Page range filter supporting segments such as `1-2` or mixed ranges like `1-2,5`. */
14
14
  pages?: string;
15
- /** Settings that control how figures in the document are processed. These affect the markdown output directly (e.g. figure descriptions, chart-to-table conversion, image embedding) and do not produce additional output fields in the response. */
15
+ /** Settings that control how figures and embedded visuals are processed. Applies to both PDFs/images (where figures are detected from layout) and spreadsheets (where charts and embedded images are read directly from the workbook). These options affect the markdown output and the `bounding_boxes.Images[]` array; they do not produce additional output fields elsewhere in the response. */
16
16
  figureProcessing?: ExtractInput.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?: ExtractInput.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. */
19
+ /** Settings for Excel/spreadsheet extraction. Controls handling of hidden rows, columns, and sheets. Applies to `.xlsx`, `.xlsm`, and `.xls` files. Accepts both camelCase and snake_case field names. */
20
20
  spreadsheet?: ExtractInput.Spreadsheet;
21
21
  /** Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created. */
22
22
  storage?: ExtractInput.Storage;
@@ -53,12 +53,12 @@ export declare namespace ExtractInput {
53
53
  };
54
54
  type Model = (typeof Model)[keyof typeof Model];
55
55
  /**
56
- * Settings that control how figures in the document are processed. These affect the markdown output directly (e.g. figure descriptions, chart-to-table conversion, image embedding) and do not produce additional output fields in the response.
56
+ * Settings that control how figures and embedded visuals are processed. Applies to both PDFs/images (where figures are detected from layout) and spreadsheets (where charts and embedded images are read directly from the workbook). These options affect the markdown output and the `bounding_boxes.Images[]` array; they do not produce additional output fields elsewhere in the response.
57
57
  */
58
58
  interface FigureProcessing {
59
- /** Generate descriptive captions for extracted figures. */
59
+ /** Generate descriptive captions for extracted visuals. When `true`, applies to both detected charts and non-chart images. Captions appear under `bounding_boxes.Images[].description` and inline in the markdown output where applicable. */
60
60
  description?: boolean;
61
- /** Embed base64-encoded images inline in figure tags in the output. Increases response size. */
61
+ /** Return image URLs for extracted visuals. When `true`, applies to both charts and non-chart images. URLs are emitted under `bounding_boxes.Images[].image_url` — typically a Pulse-hosted proxy URL served from `GET /results/{jobId}/images/{filename}`. Spreadsheet charts and embedded images are read directly from the workbook; PDF/image inputs use detected figure regions. */
62
62
  showImages?: boolean;
63
63
  }
64
64
  /**
@@ -107,7 +107,7 @@ export declare namespace ExtractInput {
107
107
  }
108
108
  }
109
109
  /**
110
- * 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
+ * Settings for Excel/spreadsheet extraction. Controls handling of hidden rows, columns, and sheets. Applies to `.xlsx`, `.xlsm`, and `.xls` files. Accepts both camelCase and snake_case field names.
111
111
  */
112
112
  interface Spreadsheet {
113
113
  /** Include rows that are hidden in the Excel workbook. */
@@ -1,3 +1,4 @@
1
+ import type * as Pulse from "../index.js";
1
2
  /**
2
3
  * 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
  */
@@ -10,16 +11,6 @@ export interface ExtractLargeResultResponse {
10
11
  extraction_id?: string;
11
12
  /** Number of pages in the document. */
12
13
  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
- }
14
+ /** Billing tier and cumulative usage information. Includes `total_credits_used` (primary billing metric) and `pages_used` (legacy compatibility). */
15
+ plan_info?: Pulse.PlanInfo;
25
16
  }
@@ -8,11 +8,11 @@ export interface ExtractOptions {
8
8
  extractionConfigId?: string;
9
9
  /** Page range filter supporting segments such as `1-2` or mixed ranges like `1-2,5`. */
10
10
  pages?: string;
11
- /** Settings that control how figures in the document are processed. These affect the markdown output directly (e.g. figure descriptions, chart-to-table conversion, image embedding) and do not produce additional output fields in the response. */
11
+ /** Settings that control how figures and embedded visuals are processed. Applies to both PDFs/images (where figures are detected from layout) and spreadsheets (where charts and embedded images are read directly from the workbook). These options affect the markdown output and the `bounding_boxes.Images[]` array; they do not produce additional output fields elsewhere in the response. */
12
12
  figureProcessing?: ExtractOptions.FigureProcessing;
13
13
  /** Settings that enable additional processing passes or alternate output formats. Each enabled extension produces a corresponding output field under `response.extensions.*`. */
14
14
  extensions?: ExtractOptions.Extensions;
15
- /** 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. */
15
+ /** Settings for Excel/spreadsheet extraction. Controls handling of hidden rows, columns, and sheets. Applies to `.xlsx`, `.xlsm`, and `.xls` files. Accepts both camelCase and snake_case field names. */
16
16
  spreadsheet?: ExtractOptions.Spreadsheet;
17
17
  /** Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created. */
18
18
  storage?: ExtractOptions.Storage;
@@ -49,12 +49,12 @@ export declare namespace ExtractOptions {
49
49
  };
50
50
  type Model = (typeof Model)[keyof typeof Model];
51
51
  /**
52
- * Settings that control how figures in the document are processed. These affect the markdown output directly (e.g. figure descriptions, chart-to-table conversion, image embedding) and do not produce additional output fields in the response.
52
+ * Settings that control how figures and embedded visuals are processed. Applies to both PDFs/images (where figures are detected from layout) and spreadsheets (where charts and embedded images are read directly from the workbook). These options affect the markdown output and the `bounding_boxes.Images[]` array; they do not produce additional output fields elsewhere in the response.
53
53
  */
54
54
  interface FigureProcessing {
55
- /** Generate descriptive captions for extracted figures. */
55
+ /** Generate descriptive captions for extracted visuals. When `true`, applies to both detected charts and non-chart images. Captions appear under `bounding_boxes.Images[].description` and inline in the markdown output where applicable. */
56
56
  description?: boolean;
57
- /** Embed base64-encoded images inline in figure tags in the output. Increases response size. */
57
+ /** Return image URLs for extracted visuals. When `true`, applies to both charts and non-chart images. URLs are emitted under `bounding_boxes.Images[].image_url` — typically a Pulse-hosted proxy URL served from `GET /results/{jobId}/images/{filename}`. Spreadsheet charts and embedded images are read directly from the workbook; PDF/image inputs use detected figure regions. */
58
58
  showImages?: boolean;
59
59
  }
60
60
  /**
@@ -103,7 +103,7 @@ export declare namespace ExtractOptions {
103
103
  }
104
104
  }
105
105
  /**
106
- * 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.
106
+ * Settings for Excel/spreadsheet extraction. Controls handling of hidden rows, columns, and sheets. Applies to `.xlsx`, `.xlsm`, and `.xls` files. Accepts both camelCase and snake_case field names.
107
107
  */
108
108
  interface Spreadsheet {
109
109
  /** Include rows that are hidden in the Excel workbook. */
@@ -7,16 +7,16 @@ export interface ExtractResponse {
7
7
  markdown?: string;
8
8
  /** Output from enabled extensions. Each key corresponds to an extension that was enabled in the request under `extensions.*`. Only keys for enabled extensions are present. */
9
9
  extensions?: ExtractResponse.Extensions;
10
- /** Positional bounding-box data for text, titles, headers, footers, images, and tables. Used by the frontend for annotation overlays. */
11
- bounding_boxes?: Record<string, unknown>;
10
+ /** Positional bounding-box data for text, titles, headers, footers, images, and tables. `Images` carries chart/image visuals (with `image_url` when `figure_processing.show_images` is enabled), `Tables` the detected tables, and `Text`/`Title`/`Footer` the paragraph/title/footer regions. Additional keys (e.g. `markdown_with_ids`, `defined_names`) round-trip without being typed. */
11
+ bounding_boxes?: Pulse.BoundingBoxes;
12
12
  /** Persisted extraction ID. Present when storage is enabled (default). Use this ID with `/split` and `/schema` endpoints. */
13
13
  extraction_id?: string;
14
14
  /** URL to view the extraction on the Pulse platform. Present when storage is enabled. */
15
15
  extraction_url?: string;
16
16
  /** Number of pages processed. */
17
17
  page_count?: number;
18
- /** Billing tier and usage information. */
19
- plan_info?: ExtractResponse.PlanInfo;
18
+ /** Billing tier and cumulative usage information. Includes `total_credits_used` (primary billing metric) and `pages_used` (legacy compatibility). */
19
+ plan_info?: Pulse.PlanInfo;
20
20
  /** Non-fatal warnings generated during extraction. Includes deprecation notices when legacy input parameters are used, as well as processing warnings (e.g. word-level bounding box limitations). */
21
21
  warnings?: string[];
22
22
  /** Number of credits consumed by this request. Only present when the organization has the credit billing system enabled. */
@@ -117,17 +117,6 @@ export declare namespace ExtractResponse {
117
117
  }
118
118
  }
119
119
  }
120
- /**
121
- * Billing tier and usage information.
122
- */
123
- interface PlanInfo {
124
- /** Current plan tier name. */
125
- tier?: string;
126
- /** Cumulative pages used after this extraction. */
127
- pages_used?: number;
128
- /** Human-readable plan note. */
129
- note?: string;
130
- }
131
120
  /**
132
121
  * **Deprecated** — Use `extensions.chunking` instead. Document content split into chunks. Present when the legacy `chunking` input was used.
133
122
  */
@@ -1,3 +1,4 @@
1
+ import type * as Pulse from "../index.js";
1
2
  /**
2
3
  * Core extraction result fields shared by the synchronous `/extract` endpoint and the pipeline extract step.
3
4
  */
@@ -6,16 +7,16 @@ export interface ExtractResultCore {
6
7
  markdown?: string;
7
8
  /** Output from enabled extensions. Each key corresponds to an extension that was enabled in the request under `extensions.*`. Only keys for enabled extensions are present. */
8
9
  extensions?: ExtractResultCore.Extensions;
9
- /** Positional bounding-box data for text, titles, headers, footers, images, and tables. Used by the frontend for annotation overlays. */
10
- bounding_boxes?: Record<string, unknown>;
10
+ /** Positional bounding-box data for text, titles, headers, footers, images, and tables. `Images` carries chart/image visuals (with `image_url` when `figure_processing.show_images` is enabled), `Tables` the detected tables, and `Text`/`Title`/`Footer` the paragraph/title/footer regions. Additional keys (e.g. `markdown_with_ids`, `defined_names`) round-trip without being typed. */
11
+ bounding_boxes?: Pulse.BoundingBoxes;
11
12
  /** Persisted extraction ID. Present when storage is enabled (default). Use this ID with `/split` and `/schema` endpoints. */
12
13
  extraction_id?: string;
13
14
  /** URL to view the extraction on the Pulse platform. Present when storage is enabled. */
14
15
  extraction_url?: string;
15
16
  /** Number of pages processed. */
16
17
  page_count?: number;
17
- /** Billing tier and usage information. */
18
- plan_info?: ExtractResultCore.PlanInfo;
18
+ /** Billing tier and cumulative usage information. Includes `total_credits_used` (primary billing metric) and `pages_used` (legacy compatibility). */
19
+ plan_info?: Pulse.PlanInfo;
19
20
  /** Non-fatal warnings generated during extraction. Includes deprecation notices when legacy input parameters are used, as well as processing warnings (e.g. word-level bounding box limitations). */
20
21
  warnings?: string[];
21
22
  /** Number of credits consumed by this request. Only present when the organization has the credit billing system enabled. */
@@ -98,15 +99,4 @@ export declare namespace ExtractResultCore {
98
99
  }
99
100
  }
100
101
  }
101
- /**
102
- * Billing tier and usage information.
103
- */
104
- interface PlanInfo {
105
- /** Current plan tier name. */
106
- tier?: string;
107
- /** Cumulative pages used after this extraction. */
108
- pages_used?: number;
109
- /** Human-readable plan note. */
110
- note?: string;
111
- }
112
102
  }
@@ -1,11 +1,5 @@
1
+ import type * as Pulse from "../index.js";
1
2
  /**
2
- * Cumulative billing snapshot for the calling organization. Sourced from the `pulse-org-stats` aggregate table maintained asynchronously by the org-stats Lambda; the in-flight request's contribution is added on top so every response reflects post-request state.
3
+ * **Deprecated** Use `PlanInfo` instead. Retained as an alias so existing SDK type imports continue to compile.
3
4
  */
4
- export interface FormPlanInfo {
5
- /** Billing tier, e.g. `"trial"`, `"pulse_ultra_2"`. */
6
- tier?: string;
7
- /** Total credits consumed by the organization to date, including this request. The primary billing metric going forward. */
8
- total_credits_used?: number;
9
- /** Total pages processed by the organization to date, including this request. Kept for backward compatibility with clients that haven't migrated to `total_credits_used`. */
10
- pages_used?: number;
11
- }
5
+ export type FormPlanInfo = Pulse.PlanInfo;
@@ -20,5 +20,6 @@ export interface FormResult {
20
20
  fields_cleared?: number;
21
21
  /** Number of credits consumed by **this request**. Detect charges 1 credit per page; fill and clear charge 3 credits per page. */
22
22
  credits_used?: number;
23
- plan_info?: Pulse.FormPlanInfo;
23
+ /** Billing tier and cumulative usage information for the calling org, including this form run. */
24
+ plan_info?: Pulse.PlanInfo;
24
25
  }