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
@@ -10,6 +10,8 @@ export interface ExtractOptions {
10
10
  figureProcessing?: ExtractOptions.FigureProcessing;
11
11
  /** Settings that enable additional processing passes or alternate output formats. Each enabled extension produces a corresponding output field under `response.extensions.*`. */
12
12
  extensions?: ExtractOptions.Extensions;
13
+ /** 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. */
14
+ spreadsheet?: ExtractOptions.Spreadsheet;
13
15
  /** Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created. */
14
16
  storage?: ExtractOptions.Storage;
15
17
  /** If true, returns immediately with a job_id for polling via GET /job/{jobId}. Otherwise processes synchronously. */
@@ -56,8 +58,6 @@ export declare namespace ExtractOptions {
56
58
  * Settings that enable additional processing passes or alternate output formats. Each enabled extension produces a corresponding output field under `response.extensions.*`.
57
59
  */
58
60
  interface Extensions {
59
- /** Merge tables that span multiple pages into a single table. */
60
- mergeTables?: boolean;
61
61
  /** Link footnote markers to their corresponding footnote text. */
62
62
  footnoteReferences?: boolean;
63
63
  /** Chunking configuration. When provided, the document is split into chunks using the specified strategies. Results appear in `response.extensions.chunking`. */
@@ -99,6 +99,17 @@ export declare namespace ExtractOptions {
99
99
  returnXml?: boolean;
100
100
  }
101
101
  }
102
+ /**
103
+ * 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.
104
+ */
105
+ interface Spreadsheet {
106
+ /** Include rows that are hidden in the Excel workbook. */
107
+ includeHiddenRows?: boolean;
108
+ /** Include columns that are hidden in the Excel workbook. */
109
+ includeHiddenCols?: boolean;
110
+ /** Include sheets that are hidden in the Excel workbook. */
111
+ includeHiddenSheets?: boolean;
112
+ }
102
113
  /**
103
114
  * Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created.
104
115
  */
@@ -1,6 +1,6 @@
1
1
  import type * as Pulse from "../index.mjs";
2
2
  /**
3
- * Full extraction result returned by the synchronous `/extract` endpoint. Contains the extracted markdown, optional extensions output, bounding boxes, and storage metadata.
3
+ * Full extraction result returned by the synchronous `/extract` endpoint. Inherits all core fields and adds deprecated backward-compatibility fields.
4
4
  */
5
5
  export interface ExtractResponse {
6
6
  /** Primary markdown content extracted from the document. Always present in the new format. */
@@ -19,6 +19,8 @@ export interface ExtractResponse {
19
19
  plan_info?: ExtractResponse.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
+ /** Number of credits consumed by this request. Only present when the organization has the credit billing system enabled. */
23
+ credits_used?: number | null;
22
24
  /** **Deprecated** — Use `extensions.altOutputs.html` instead. HTML representation of the extracted content. Present when the legacy `returnHtml` input was used. */
23
25
  html?: string;
24
26
  /** **Deprecated** — Use `extensions.chunking` instead. Document content split into chunks. Present when the legacy `chunking` input was used. */
@@ -45,8 +47,6 @@ export declare namespace ExtractResponse {
45
47
  interface Extensions {
46
48
  /** Chunk results by strategy. Present when `extensions.chunking` was provided in the request. */
47
49
  chunking?: Extensions.Chunking;
48
- /** Merge tables result/metadata. Present when `extensions.mergeTables` was enabled. */
49
- mergeTables?: Record<string, unknown>;
50
50
  /** List of detected footnotes with their in-text references. Present when `extensions.footnoteReferences` was enabled. Each item links a footnote paragraph to the body-text paragraphs that reference it, using bounding-box text IDs. */
51
51
  footnoteReferences?: Extensions.FootnoteReferences.Item[];
52
52
  /** Alternate output formats. Each key corresponds to an enabled alt output. */
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Core extraction result fields shared by the synchronous `/extract` endpoint and the pipeline extract step.
3
+ */
4
+ export interface ExtractResultCore {
5
+ /** Primary markdown content extracted from the document. Always present in the new format. */
6
+ markdown?: string;
7
+ /** 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
+ 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>;
11
+ /** Persisted extraction ID. Present when storage is enabled (default). Use this ID with `/split` and `/schema` endpoints. */
12
+ extraction_id?: string;
13
+ /** URL to view the extraction on the Pulse platform. Present when storage is enabled. */
14
+ extraction_url?: string;
15
+ /** Number of pages processed. */
16
+ page_count?: number;
17
+ /** Billing tier and usage information. */
18
+ plan_info?: ExtractResultCore.PlanInfo;
19
+ /** 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
+ warnings?: string[];
21
+ /** Number of credits consumed by this request. Only present when the organization has the credit billing system enabled. */
22
+ credits_used?: number | null;
23
+ }
24
+ export declare namespace ExtractResultCore {
25
+ /**
26
+ * 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.
27
+ */
28
+ interface Extensions {
29
+ /** Chunk results by strategy. Present when `extensions.chunking` was provided in the request. */
30
+ chunking?: Extensions.Chunking;
31
+ /** List of detected footnotes with their in-text references. Present when `extensions.footnoteReferences` was enabled. Each item links a footnote paragraph to the body-text paragraphs that reference it, using bounding-box text IDs. */
32
+ footnoteReferences?: Extensions.FootnoteReferences.Item[];
33
+ /** Alternate output formats. Each key corresponds to an enabled alt output. */
34
+ altOutputs?: Extensions.AltOutputs;
35
+ }
36
+ namespace Extensions {
37
+ /**
38
+ * Chunk results by strategy. Present when `extensions.chunking` was provided in the request.
39
+ */
40
+ interface Chunking {
41
+ /** Semantically-segmented chunks. */
42
+ semantic?: string[];
43
+ /** Chunks split by document headers/headings. */
44
+ header?: string[];
45
+ /** One chunk per page. */
46
+ page?: string[];
47
+ /** Recursively-split chunks respecting size limits. */
48
+ recursive?: string[];
49
+ }
50
+ type FootnoteReferences = FootnoteReferences.Item[];
51
+ namespace FootnoteReferences {
52
+ interface Item {
53
+ /** The footnote marker symbol (e.g. "*", "†", "1", "#"). */
54
+ symbol?: string;
55
+ /** The bounding-box text ID (e.g. "txt-15") of the footnote explanation paragraph. */
56
+ footnoteTextId?: string;
57
+ /** Bounding-box text IDs of body-text paragraphs that contain a reference to this footnote marker. */
58
+ referenceTextIds?: string[];
59
+ }
60
+ }
61
+ /**
62
+ * Alternate output formats. Each key corresponds to an enabled alt output.
63
+ */
64
+ interface AltOutputs {
65
+ /** Word-level bounding box data. Present when `extensions.altOutputs.wlbb` was enabled and input is a PDF. */
66
+ wlbb?: AltOutputs.Wlbb;
67
+ /** HTML representation of the document. Present when `extensions.altOutputs.returnHtml` was enabled. */
68
+ html?: string;
69
+ /** XML representation of the document. Present when `extensions.altOutputs.returnXml` was enabled. (WIP) */
70
+ xml?: string;
71
+ }
72
+ namespace AltOutputs {
73
+ /**
74
+ * Word-level bounding box data. Present when `extensions.altOutputs.wlbb` was enabled and input is a PDF.
75
+ */
76
+ interface Wlbb {
77
+ /** List of detected words with their positions. */
78
+ words?: Wlbb.Words.Item[];
79
+ /** Error message if word-level extraction failed. */
80
+ error?: string;
81
+ }
82
+ namespace Wlbb {
83
+ type Words = Words.Item[];
84
+ namespace Words {
85
+ interface Item {
86
+ /** Unique identifier for the word (e.g. "w-1", "w-2", …). */
87
+ id?: string;
88
+ /** The recognised word text. */
89
+ text?: string;
90
+ /** 1-indexed page number in the original document. */
91
+ page_number?: number;
92
+ /** Flat 4-corner polygon: [x1,y1, x2,y2, x3,y3, x4,y4]. All coordinates normalised to 0–1 range. */
93
+ bounding_box?: number[];
94
+ /** Recognition confidence score (0–1). */
95
+ average_word_confidence?: number;
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
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
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ export interface GoneErrorBody {
2
+ error?: GoneErrorBody.Error_;
3
+ }
4
+ export declare namespace GoneErrorBody {
5
+ interface Error_ {
6
+ code?: string;
7
+ message?: string;
8
+ }
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -10,7 +10,7 @@ export interface JobStatusResponse {
10
10
  created_at: string;
11
11
  /** Timestamp of the last status update, if available. */
12
12
  updated_at?: string;
13
- /** Structured payload that contains output when the job is completed. */
13
+ /** Structured payload returned when the job completes. For large extractions (70+ pages) this object contains `is_url: true` and a single-use `url` to download the full result via `GET /large_results/{jobId}`. */
14
14
  result?: Record<string, unknown>;
15
15
  /** Error message describing why the job failed, if applicable. */
16
16
  error?: string;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Result from the batch_extract step in a pipeline.
3
+ */
4
+ export interface PipelineBatchExtractResult {
5
+ /** List of extraction IDs for each processed file. */
6
+ extraction_ids?: string[];
7
+ /** Number of files processed. */
8
+ total_files?: number;
9
+ /** Step execution time in seconds. */
10
+ latency?: number;
11
+ /** Accepts any additional properties */
12
+ [key: string]: any;
13
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Multipart form-data request body for ad-hoc pipeline execution. Upload file(s) directly and provide step configs as a JSON string.
3
+ */
4
+ export interface PipelineExecuteMultipartInput {
5
+ /** Document file to upload. For batch_extract, multiple `file` fields can be provided. */
6
+ file?: string;
7
+ /** JSON string containing the step configurations (same structure as `PipelineSteps`). */
8
+ steps: string;
9
+ /** Set to `"true"` for async execution. */
10
+ async?: string;
11
+ /** Set to `"true"` for zero-retention mode. */
12
+ auto_delete?: string;
13
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,21 @@
1
+ import type * as Pulse from "../index.mjs";
2
+ /**
3
+ * Synchronous pipeline execution result. Contains the status, total latency, and results from each step.
4
+ */
5
+ export interface PipelineExecuteResponse {
6
+ /** Pipeline execution status. */
7
+ status: PipelineExecuteResponse.Status;
8
+ /** Total pipeline execution time in seconds. */
9
+ total_latency?: number;
10
+ /** Per-step results. */
11
+ results: Pulse.PipelineResults;
12
+ /** Present and true when auto-delete mode was used. Confirms that artifacts have been purged. */
13
+ auto_delete?: boolean;
14
+ }
15
+ export declare namespace PipelineExecuteResponse {
16
+ /** Pipeline execution status. */
17
+ const Status: {
18
+ readonly Completed: "completed";
19
+ };
20
+ type Status = (typeof Status)[keyof typeof Status];
21
+ }
@@ -0,0 +1,8 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var PipelineExecuteResponse;
3
+ (function (PipelineExecuteResponse) {
4
+ /** Pipeline execution status. */
5
+ PipelineExecuteResponse.Status = {
6
+ Completed: "completed",
7
+ };
8
+ })(PipelineExecuteResponse || (PipelineExecuteResponse = {}));
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Result from the extract step in a pipeline. Inherits all core extraction fields and adds pipeline-specific timing.
3
+ */
4
+ export interface PipelineExtractResult {
5
+ /** Primary markdown content extracted from the document. Always present in the new format. */
6
+ markdown?: string;
7
+ /** 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
+ extensions?: PipelineExtractResult.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>;
11
+ /** Persisted extraction ID. Present when storage is enabled (default). Use this ID with `/split` and `/schema` endpoints. */
12
+ extraction_id?: string;
13
+ /** URL to view the extraction on the Pulse platform. Present when storage is enabled. */
14
+ extraction_url?: string;
15
+ /** Number of pages processed. */
16
+ page_count?: number;
17
+ /** Billing tier and usage information. */
18
+ plan_info?: PipelineExtractResult.PlanInfo;
19
+ /** 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
+ warnings?: string[];
21
+ /** Number of credits consumed by this request. Only present when the organization has the credit billing system enabled. */
22
+ credits_used?: number | null;
23
+ /** Number of pages processed. Convenience alias for `page_count`. */
24
+ pages?: number;
25
+ /** Step execution time in seconds. */
26
+ latency?: number;
27
+ /** Accepts any additional properties */
28
+ [key: string]: any;
29
+ }
30
+ export declare namespace PipelineExtractResult {
31
+ /**
32
+ * 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.
33
+ */
34
+ interface Extensions {
35
+ /** Chunk results by strategy. Present when `extensions.chunking` was provided in the request. */
36
+ chunking?: Extensions.Chunking;
37
+ /** List of detected footnotes with their in-text references. Present when `extensions.footnoteReferences` was enabled. Each item links a footnote paragraph to the body-text paragraphs that reference it, using bounding-box text IDs. */
38
+ footnoteReferences?: Extensions.FootnoteReferences.Item[];
39
+ /** Alternate output formats. Each key corresponds to an enabled alt output. */
40
+ altOutputs?: Extensions.AltOutputs;
41
+ }
42
+ namespace Extensions {
43
+ /**
44
+ * Chunk results by strategy. Present when `extensions.chunking` was provided in the request.
45
+ */
46
+ interface Chunking {
47
+ /** Semantically-segmented chunks. */
48
+ semantic?: string[];
49
+ /** Chunks split by document headers/headings. */
50
+ header?: string[];
51
+ /** One chunk per page. */
52
+ page?: string[];
53
+ /** Recursively-split chunks respecting size limits. */
54
+ recursive?: string[];
55
+ }
56
+ type FootnoteReferences = FootnoteReferences.Item[];
57
+ namespace FootnoteReferences {
58
+ interface Item {
59
+ /** The footnote marker symbol (e.g. "*", "†", "1", "#"). */
60
+ symbol?: string;
61
+ /** The bounding-box text ID (e.g. "txt-15") of the footnote explanation paragraph. */
62
+ footnoteTextId?: string;
63
+ /** Bounding-box text IDs of body-text paragraphs that contain a reference to this footnote marker. */
64
+ referenceTextIds?: string[];
65
+ }
66
+ }
67
+ /**
68
+ * Alternate output formats. Each key corresponds to an enabled alt output.
69
+ */
70
+ interface AltOutputs {
71
+ /** Word-level bounding box data. Present when `extensions.altOutputs.wlbb` was enabled and input is a PDF. */
72
+ wlbb?: AltOutputs.Wlbb;
73
+ /** HTML representation of the document. Present when `extensions.altOutputs.returnHtml` was enabled. */
74
+ html?: string;
75
+ /** XML representation of the document. Present when `extensions.altOutputs.returnXml` was enabled. (WIP) */
76
+ xml?: string;
77
+ }
78
+ namespace AltOutputs {
79
+ /**
80
+ * Word-level bounding box data. Present when `extensions.altOutputs.wlbb` was enabled and input is a PDF.
81
+ */
82
+ interface Wlbb {
83
+ /** List of detected words with their positions. */
84
+ words?: Wlbb.Words.Item[];
85
+ /** Error message if word-level extraction failed. */
86
+ error?: string;
87
+ }
88
+ namespace Wlbb {
89
+ type Words = Words.Item[];
90
+ namespace Words {
91
+ interface Item {
92
+ /** Unique identifier for the word (e.g. "w-1", "w-2", …). */
93
+ id?: string;
94
+ /** The recognised word text. */
95
+ text?: string;
96
+ /** 1-indexed page number in the original document. */
97
+ page_number?: number;
98
+ /** Flat 4-corner polygon: [x1,y1, x2,y2, x3,y3, x4,y4]. All coordinates normalised to 0–1 range. */
99
+ bounding_box?: number[];
100
+ /** Recognition confidence score (0–1). */
101
+ average_word_confidence?: number;
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
107
+ /**
108
+ * Billing tier and usage information.
109
+ */
110
+ interface PlanInfo {
111
+ /** Current plan tier name. */
112
+ tier?: string;
113
+ /** Cumulative pages used after this extraction. */
114
+ pages_used?: number;
115
+ /** Human-readable plan note. */
116
+ note?: string;
117
+ }
118
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,14 @@
1
+ import type * as Pulse from "../index.mjs";
2
+ /**
3
+ * Results from each pipeline step, keyed by step name. Only steps that were executed are present.
4
+ */
5
+ export interface PipelineResults {
6
+ /** Extract step result. */
7
+ extract?: Pulse.PipelineExtractResult;
8
+ /** Batch extract step result. */
9
+ batch_extract?: Pulse.PipelineBatchExtractResult;
10
+ /** Schema step result. */
11
+ schema?: Pulse.PipelineSchemaResult;
12
+ /** Split step result. */
13
+ split?: Pulse.PipelineSplitResult;
14
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,14 @@
1
+ import type * as Pulse from "../index.mjs";
2
+ /**
3
+ * Result from the schema step in a pipeline.
4
+ */
5
+ export interface PipelineSchemaResult {
6
+ /** Persisted schema version ID. */
7
+ schema_id?: string;
8
+ /** Extracted values and citations. */
9
+ schema_output?: Pulse.StructuredOutputResult;
10
+ /** Step execution time in seconds. */
11
+ latency?: number;
12
+ /** Accepts any additional properties */
13
+ [key: string]: any;
14
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,18 @@
1
+ import type * as Pulse from "../index.mjs";
2
+ /**
3
+ * Result from the split step in a pipeline. Inherits all core split fields and adds pipeline-specific timing and input echo.
4
+ */
5
+ export interface PipelineSplitResult {
6
+ /** Unique identifier for this split result. Use this ID with the `/schema` endpoint (split mode) to apply schemas to specific page groups. */
7
+ split_id?: string;
8
+ /** Page assignments per topic. */
9
+ split_output?: Pulse.SplitOutput;
10
+ /** Number of credits consumed by this request. Only present when the organization has the credit billing system enabled. */
11
+ credits_used?: number | null;
12
+ /** Echo of the topic definitions used. */
13
+ split_input?: Pulse.TopicDefinition[];
14
+ /** Step execution time in seconds. */
15
+ latency?: number;
16
+ /** Accepts any additional properties */
17
+ [key: string]: any;
18
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,146 @@
1
+ import type * as Pulse from "../index.mjs";
2
+ /**
3
+ * Configuration for the batch_extract step. Same extract options as `POST /extract` (applied to every file) plus file inputs and a `workers` field for parallelism. Provide files via `file_urls` (URL list) or `files` (base64 inline uploads).
4
+ */
5
+ export interface PipelineStepBatchExtractConfig {
6
+ /** Extraction model to use. When set to `enterprise-preview`, routes the request through Pulse's self-hosted VPC extraction model instead of the default cloud-based service. If omitted or set to any other value, the default model is used. */
7
+ model?: PipelineStepBatchExtractConfig.Model;
8
+ /** Page range filter supporting segments such as `1-2` or mixed ranges like `1-2,5`. */
9
+ pages?: string;
10
+ /** 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
+ figureProcessing?: PipelineStepBatchExtractConfig.FigureProcessing;
12
+ /** Settings that enable additional processing passes or alternate output formats. Each enabled extension produces a corresponding output field under `response.extensions.*`. */
13
+ extensions?: PipelineStepBatchExtractConfig.Extensions;
14
+ /** 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
+ spreadsheet?: PipelineStepBatchExtractConfig.Spreadsheet;
16
+ /** Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created. */
17
+ storage?: PipelineStepBatchExtractConfig.Storage;
18
+ /** If true, returns immediately with a job_id for polling via GET /job/{jobId}. Otherwise processes synchronously. */
19
+ async?: boolean;
20
+ /** **⚠️ DEPRECATED** — Use the `/schema` endpoint after extraction instead. Pass the `extraction_id` from the extract response to `/schema` with your `schema_config`. This parameter still works for backward compatibility but will be removed in a future version. */
21
+ structuredOutput?: PipelineStepBatchExtractConfig.StructuredOutput;
22
+ /** (Deprecated) JSON schema describing structured data to extract. Use structuredOutput instead. Accepts either a JSON object or a stringified JSON representation. */
23
+ schema?: PipelineStepBatchExtractConfig.Schema;
24
+ /** (Deprecated) Natural language prompt for schema-guided extraction. Use structuredOutput.schemaPrompt instead. */
25
+ schemaPrompt?: string;
26
+ /** (Deprecated) Custom instructions that augment the default extraction behaviour. Use `figureProcessing` or `extensions` instead. */
27
+ customPrompt?: string;
28
+ /** **⚠️ DEPRECATED** — Use `extensions.chunking.chunkTypes` instead. Comma-separated list of chunking strategies to apply (for example `semantic,header,page,recursive`). Still accepted for backward compatibility. */
29
+ chunking?: string;
30
+ /** **⚠️ DEPRECATED** — Use `extensions.chunking.chunkSize` instead. Override for maximum characters per chunk when chunking is enabled. */
31
+ chunkSize?: number;
32
+ /** **⚠️ DEPRECATED** — Toggle to enable figure extraction in results. */
33
+ extractFigure?: boolean;
34
+ /** **⚠️ DEPRECATED** — Use `figureProcessing.description` instead. Toggle to generate descriptive captions for extracted figures. */
35
+ figureDescription?: boolean;
36
+ /** **⚠️ DEPRECATED** — Use `figureProcessing.showImages` instead. Embed base64-encoded images inline in figure tags in the output. Increases response size. */
37
+ showImages?: boolean;
38
+ /** **⚠️ DEPRECATED** — Use `extensions.altOutputs.returnHtml` instead. Whether to include HTML representation alongside markdown in the response. */
39
+ returnHtml?: boolean;
40
+ /** (Deprecated) Enables expanded rationale output for debugging. */
41
+ thinking?: boolean;
42
+ /** List of document URLs to process in parallel. */
43
+ file_urls?: string[];
44
+ /** Inline file uploads. Each entry contains a filename and base64-encoded file content. Use instead of `file_urls` when you have local files. */
45
+ files?: Pulse.BatchFileUpload[];
46
+ /** Number of parallel workers. */
47
+ workers?: number;
48
+ }
49
+ export declare namespace PipelineStepBatchExtractConfig {
50
+ /** Extraction model to use. When set to `enterprise-preview`, routes the request through Pulse's self-hosted VPC extraction model instead of the default cloud-based service. If omitted or set to any other value, the default model is used. */
51
+ const Model: {
52
+ readonly EnterprisePreview: "enterprise-preview";
53
+ };
54
+ type Model = (typeof Model)[keyof typeof Model];
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.
57
+ */
58
+ interface FigureProcessing {
59
+ /** Generate descriptive captions for extracted figures. */
60
+ description?: boolean;
61
+ /** Embed base64-encoded images inline in figure tags in the output. Increases response size. */
62
+ showImages?: boolean;
63
+ }
64
+ /**
65
+ * Settings that enable additional processing passes or alternate output formats. Each enabled extension produces a corresponding output field under `response.extensions.*`.
66
+ */
67
+ interface Extensions {
68
+ /** Link footnote markers to their corresponding footnote text. */
69
+ footnoteReferences?: boolean;
70
+ /** Chunking configuration. When provided, the document is split into chunks using the specified strategies. Results appear in `response.extensions.chunking`. */
71
+ chunking?: Extensions.Chunking;
72
+ /** Alternate output format options. Each enabled format produces a corresponding field under `response.extensions.altOutputs`. */
73
+ altOutputs?: Extensions.AltOutputs;
74
+ }
75
+ namespace Extensions {
76
+ /**
77
+ * Chunking configuration. When provided, the document is split into chunks using the specified strategies. Results appear in `response.extensions.chunking`.
78
+ */
79
+ interface Chunking {
80
+ /** List of chunking strategies to apply (e.g. `["semantic", "header", "page", "recursive"]`). */
81
+ chunkTypes?: Chunking.ChunkTypes.Item[];
82
+ /** Maximum characters per chunk. */
83
+ chunkSize?: number;
84
+ }
85
+ namespace Chunking {
86
+ type ChunkTypes = ChunkTypes.Item[];
87
+ namespace ChunkTypes {
88
+ const Item: {
89
+ readonly Semantic: "semantic";
90
+ readonly Header: "header";
91
+ readonly Page: "page";
92
+ readonly Recursive: "recursive";
93
+ };
94
+ type Item = (typeof Item)[keyof typeof Item];
95
+ }
96
+ }
97
+ /**
98
+ * Alternate output format options. Each enabled format produces a corresponding field under `response.extensions.altOutputs`.
99
+ */
100
+ interface AltOutputs {
101
+ /** Enable word-level bounding boxes. Runs an additional OCR model to derive bounding boxes for each word. Only applies to PDFs. Results in `response.extensions.altOutputs.wlbb`. */
102
+ wlbb?: boolean;
103
+ /** Include an HTML representation of the document. When enabled, `response.markdown` is still present and the HTML is available at `response.extensions.altOutputs.html`. */
104
+ returnHtml?: boolean;
105
+ /** Include an XML representation of the document. Results in `response.extensions.altOutputs.xml`. (Work in progress.) */
106
+ returnXml?: boolean;
107
+ }
108
+ }
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.
111
+ */
112
+ interface Spreadsheet {
113
+ /** Include rows that are hidden in the Excel workbook. */
114
+ includeHiddenRows?: boolean;
115
+ /** Include columns that are hidden in the Excel workbook. */
116
+ includeHiddenCols?: boolean;
117
+ /** Include sheets that are hidden in the Excel workbook. */
118
+ includeHiddenSheets?: boolean;
119
+ }
120
+ /**
121
+ * Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created.
122
+ */
123
+ interface Storage {
124
+ /** Whether to persist extraction artifacts. Set to false for temporary extractions with no storage or database record. */
125
+ enabled?: boolean;
126
+ /** Target folder name to save the extraction to. Creates the folder if it doesn't exist. */
127
+ folderName?: string;
128
+ /** Target folder ID to save the extraction to. Takes precedence over folderName if both are provided. */
129
+ folderId?: string;
130
+ }
131
+ /**
132
+ * **⚠️ DEPRECATED** — Use the `/schema` endpoint after extraction instead. Pass the `extraction_id` from the extract response to `/schema` with your `schema_config`. This parameter still works for backward compatibility but will be removed in a future version.
133
+ */
134
+ interface StructuredOutput {
135
+ /** JSON schema describing the structured data to extract. */
136
+ schema?: Record<string, unknown>;
137
+ /** Natural language prompt with additional extraction instructions. */
138
+ schemaPrompt?: string;
139
+ /** Use higher quality model for better results. When true, uses a more capable model at the cost of higher latency. */
140
+ effort?: boolean;
141
+ }
142
+ /**
143
+ * (Deprecated) JSON schema describing structured data to extract. Use structuredOutput instead. Accepts either a JSON object or a stringified JSON representation.
144
+ */
145
+ type Schema = Record<string, unknown> | string;
146
+ }
@@ -0,0 +1,23 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var PipelineStepBatchExtractConfig;
3
+ (function (PipelineStepBatchExtractConfig) {
4
+ /** Extraction model to use. When set to `enterprise-preview`, routes the request through Pulse's self-hosted VPC extraction model instead of the default cloud-based service. If omitted or set to any other value, the default model is used. */
5
+ PipelineStepBatchExtractConfig.Model = {
6
+ EnterprisePreview: "enterprise-preview",
7
+ };
8
+ let Extensions;
9
+ (function (Extensions) {
10
+ let Chunking;
11
+ (function (Chunking) {
12
+ let ChunkTypes;
13
+ (function (ChunkTypes) {
14
+ ChunkTypes.Item = {
15
+ Semantic: "semantic",
16
+ Header: "header",
17
+ Page: "page",
18
+ Recursive: "recursive",
19
+ };
20
+ })(ChunkTypes = Chunking.ChunkTypes || (Chunking.ChunkTypes = {}));
21
+ })(Chunking = Extensions.Chunking || (Extensions.Chunking = {}));
22
+ })(Extensions = PipelineStepBatchExtractConfig.Extensions || (PipelineStepBatchExtractConfig.Extensions = {}));
23
+ })(PipelineStepBatchExtractConfig || (PipelineStepBatchExtractConfig = {}));