pulse-ts-sdk 1.0.5 → 1.0.7

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 (109) hide show
  1. package/README.md +391 -1
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +37 -0
  4. package/dist/cjs/Client.js +88 -4
  5. package/dist/cjs/api/client/requests/DownloadSchemaExcelRequest.d.ts +10 -0
  6. package/dist/cjs/api/client/requests/DownloadSchemaExcelRequest.js +3 -0
  7. package/dist/cjs/api/client/requests/ExtractAsyncRequest.d.ts +7 -0
  8. package/dist/cjs/api/client/requests/ExtractAsyncRequest.js +4 -0
  9. package/dist/cjs/api/client/requests/ExtractRequest.d.ts +7 -0
  10. package/dist/cjs/api/client/requests/ExtractRequest.js +4 -0
  11. package/dist/cjs/api/client/requests/SchemaInput.d.ts +3 -1
  12. package/dist/cjs/api/client/requests/index.d.ts +1 -0
  13. package/dist/cjs/api/resources/batch/client/Client.d.ts +141 -0
  14. package/dist/cjs/api/resources/batch/client/Client.js +361 -0
  15. package/dist/cjs/api/resources/batch/client/index.d.ts +1 -0
  16. package/dist/cjs/api/resources/batch/client/index.js +17 -0
  17. package/dist/cjs/api/resources/batch/client/requests/BatchExtractInput.d.ts +18 -0
  18. package/dist/cjs/api/resources/batch/client/requests/BatchExtractInput.js +3 -0
  19. package/dist/cjs/api/resources/batch/client/requests/BatchSchemaInput.d.ts +27 -0
  20. package/dist/cjs/api/resources/batch/client/requests/BatchSchemaInput.js +3 -0
  21. package/dist/cjs/api/resources/batch/client/requests/BatchSplitInput.d.ts +24 -0
  22. package/dist/cjs/api/resources/batch/client/requests/BatchSplitInput.js +3 -0
  23. package/dist/cjs/api/resources/batch/client/requests/BatchTablesInput.d.ts +19 -0
  24. package/dist/cjs/api/resources/batch/client/requests/BatchTablesInput.js +3 -0
  25. package/dist/cjs/api/resources/batch/client/requests/index.d.ts +4 -0
  26. package/dist/cjs/api/resources/batch/client/requests/index.js +2 -0
  27. package/dist/cjs/api/resources/batch/index.d.ts +1 -0
  28. package/dist/cjs/api/resources/batch/index.js +17 -0
  29. package/dist/cjs/api/resources/index.d.ts +2 -0
  30. package/dist/cjs/api/resources/index.js +3 -1
  31. package/dist/cjs/api/types/BatchExtractResponse.d.ts +16 -0
  32. package/dist/cjs/api/types/BatchExtractResponse.js +10 -0
  33. package/dist/cjs/api/types/BatchExtractionIds.d.ts +10 -0
  34. package/dist/cjs/api/types/BatchExtractionIds.js +3 -0
  35. package/dist/cjs/api/types/BatchInputSource.d.ts +12 -0
  36. package/dist/cjs/api/types/BatchInputSource.js +3 -0
  37. package/dist/cjs/api/types/BatchOutputDestination.d.ts +11 -0
  38. package/dist/cjs/api/types/BatchOutputDestination.js +3 -0
  39. package/dist/cjs/api/types/BatchSchemaResponse.d.ts +18 -0
  40. package/dist/cjs/api/types/BatchSchemaResponse.js +10 -0
  41. package/dist/cjs/api/types/BatchSplitResponse.d.ts +16 -0
  42. package/dist/cjs/api/types/BatchSplitResponse.js +10 -0
  43. package/dist/cjs/api/types/BatchTablesResponse.d.ts +16 -0
  44. package/dist/cjs/api/types/BatchTablesResponse.js +10 -0
  45. package/dist/cjs/api/types/ExtractInput.d.ts +7 -0
  46. package/dist/cjs/api/types/ExtractInput.js +4 -0
  47. package/dist/cjs/api/types/ExtractOptions.d.ts +7 -0
  48. package/dist/cjs/api/types/ExtractOptions.js +4 -0
  49. package/dist/cjs/api/types/SchemaConfig.d.ts +5 -3
  50. package/dist/cjs/api/types/SingleSchemaResponse.d.ts +4 -0
  51. package/dist/cjs/api/types/index.d.ts +7 -0
  52. package/dist/cjs/api/types/index.js +7 -0
  53. package/dist/cjs/version.d.ts +1 -1
  54. package/dist/cjs/version.js +1 -1
  55. package/dist/esm/BaseClient.mjs +2 -2
  56. package/dist/esm/Client.d.mts +37 -0
  57. package/dist/esm/Client.mjs +84 -0
  58. package/dist/esm/api/client/requests/DownloadSchemaExcelRequest.d.mts +10 -0
  59. package/dist/esm/api/client/requests/DownloadSchemaExcelRequest.mjs +2 -0
  60. package/dist/esm/api/client/requests/ExtractAsyncRequest.d.mts +7 -0
  61. package/dist/esm/api/client/requests/ExtractAsyncRequest.mjs +4 -0
  62. package/dist/esm/api/client/requests/ExtractRequest.d.mts +7 -0
  63. package/dist/esm/api/client/requests/ExtractRequest.mjs +4 -0
  64. package/dist/esm/api/client/requests/SchemaInput.d.mts +3 -1
  65. package/dist/esm/api/client/requests/index.d.mts +1 -0
  66. package/dist/esm/api/resources/batch/client/Client.d.mts +141 -0
  67. package/dist/esm/api/resources/batch/client/Client.mjs +324 -0
  68. package/dist/esm/api/resources/batch/client/index.d.mts +1 -0
  69. package/dist/esm/api/resources/batch/client/index.mjs +1 -0
  70. package/dist/esm/api/resources/batch/client/requests/BatchExtractInput.d.mts +18 -0
  71. package/dist/esm/api/resources/batch/client/requests/BatchExtractInput.mjs +2 -0
  72. package/dist/esm/api/resources/batch/client/requests/BatchSchemaInput.d.mts +27 -0
  73. package/dist/esm/api/resources/batch/client/requests/BatchSchemaInput.mjs +2 -0
  74. package/dist/esm/api/resources/batch/client/requests/BatchSplitInput.d.mts +24 -0
  75. package/dist/esm/api/resources/batch/client/requests/BatchSplitInput.mjs +2 -0
  76. package/dist/esm/api/resources/batch/client/requests/BatchTablesInput.d.mts +19 -0
  77. package/dist/esm/api/resources/batch/client/requests/BatchTablesInput.mjs +2 -0
  78. package/dist/esm/api/resources/batch/client/requests/index.d.mts +4 -0
  79. package/dist/esm/api/resources/batch/client/requests/index.mjs +1 -0
  80. package/dist/esm/api/resources/batch/index.d.mts +1 -0
  81. package/dist/esm/api/resources/batch/index.mjs +1 -0
  82. package/dist/esm/api/resources/index.d.mts +2 -0
  83. package/dist/esm/api/resources/index.mjs +2 -0
  84. package/dist/esm/api/types/BatchExtractResponse.d.mts +16 -0
  85. package/dist/esm/api/types/BatchExtractResponse.mjs +7 -0
  86. package/dist/esm/api/types/BatchExtractionIds.d.mts +10 -0
  87. package/dist/esm/api/types/BatchExtractionIds.mjs +2 -0
  88. package/dist/esm/api/types/BatchInputSource.d.mts +12 -0
  89. package/dist/esm/api/types/BatchInputSource.mjs +2 -0
  90. package/dist/esm/api/types/BatchOutputDestination.d.mts +11 -0
  91. package/dist/esm/api/types/BatchOutputDestination.mjs +2 -0
  92. package/dist/esm/api/types/BatchSchemaResponse.d.mts +18 -0
  93. package/dist/esm/api/types/BatchSchemaResponse.mjs +7 -0
  94. package/dist/esm/api/types/BatchSplitResponse.d.mts +16 -0
  95. package/dist/esm/api/types/BatchSplitResponse.mjs +7 -0
  96. package/dist/esm/api/types/BatchTablesResponse.d.mts +16 -0
  97. package/dist/esm/api/types/BatchTablesResponse.mjs +7 -0
  98. package/dist/esm/api/types/ExtractInput.d.mts +7 -0
  99. package/dist/esm/api/types/ExtractInput.mjs +4 -0
  100. package/dist/esm/api/types/ExtractOptions.d.mts +7 -0
  101. package/dist/esm/api/types/ExtractOptions.mjs +4 -0
  102. package/dist/esm/api/types/SchemaConfig.d.mts +5 -3
  103. package/dist/esm/api/types/SingleSchemaResponse.d.mts +4 -0
  104. package/dist/esm/api/types/index.d.mts +7 -0
  105. package/dist/esm/api/types/index.mjs +7 -0
  106. package/dist/esm/version.d.mts +1 -1
  107. package/dist/esm/version.mjs +1 -1
  108. package/package.json +1 -1
  109. package/reference.md +410 -0
package/README.md CHANGED
@@ -13,6 +13,7 @@ The Pulse TypeScript library provides convenient access to the Pulse APIs from T
13
13
  - [Request and Response Types](#request-and-response-types)
14
14
  - [Exception Handling](#exception-handling)
15
15
  - [File Uploads](#file-uploads)
16
+ - [Binary Response](#binary-response)
16
17
  - [Advanced](#advanced)
17
18
  - [Additional Headers](#additional-headers)
18
19
  - [Additional Query String Parameters](#additional-query-string-parameters)
@@ -54,7 +55,7 @@ following namespace:
54
55
  ```typescript
55
56
  import { Pulse } from "pulse-ts-sdk";
56
57
 
57
- const request: Pulse.GetJobRequest = {
58
+ const request: Pulse.BatchExtractInput = {
58
59
  ...
59
60
  };
60
61
  ```
@@ -120,6 +121,395 @@ The metadata is used to set the `Content-Length`, `Content-Type`, and `Content-D
120
121
  For example, `fs.ReadStream` has a `path` property which the SDK uses to retrieve the file size from the filesystem without loading it into memory.
121
122
 
122
123
 
124
+ ## Binary Response
125
+
126
+ You can consume binary data from endpoints using the `BinaryResponse` type which lets you choose how to consume the data:
127
+
128
+ ```typescript
129
+ const response = await client.downloadSchemaExcel(...);
130
+ const stream: ReadableStream<Uint8Array> = response.stream();
131
+ // const arrayBuffer: ArrayBuffer = await response.arrayBuffer();
132
+ // const blob: Blob = response.blob();
133
+ // const bytes: Uint8Array = response.bytes();
134
+ // You can only use the response body once, so you must choose one of the above methods.
135
+ // If you want to check if the response body has been used, you can use the following property.
136
+ const bodyUsed = response.bodyUsed;
137
+ ```
138
+ <details>
139
+ <summary>Save binary response to a file</summary>
140
+
141
+ <blockquote>
142
+ <details>
143
+ <summary>Node.js</summary>
144
+
145
+ <blockquote>
146
+ <details>
147
+ <summary>ReadableStream (most-efficient)</summary>
148
+
149
+ ```ts
150
+ import { createWriteStream } from 'fs';
151
+ import { Readable } from 'stream';
152
+ import { pipeline } from 'stream/promises';
153
+
154
+ const response = await client.downloadSchemaExcel(...);
155
+
156
+ const stream = response.stream();
157
+ const nodeStream = Readable.fromWeb(stream);
158
+ const writeStream = createWriteStream('path/to/file');
159
+
160
+ await pipeline(nodeStream, writeStream);
161
+ ```
162
+
163
+ </details>
164
+ </blockquote>
165
+
166
+ <blockquote>
167
+ <details>
168
+ <summary>ArrayBuffer</summary>
169
+
170
+ ```ts
171
+ import { writeFile } from 'fs/promises';
172
+
173
+ const response = await client.downloadSchemaExcel(...);
174
+
175
+ const arrayBuffer = await response.arrayBuffer();
176
+ await writeFile('path/to/file', Buffer.from(arrayBuffer));
177
+ ```
178
+
179
+ </details>
180
+ </blockquote>
181
+
182
+ <blockquote>
183
+ <details>
184
+ <summary>Blob</summary>
185
+
186
+ ```ts
187
+ import { writeFile } from 'fs/promises';
188
+
189
+ const response = await client.downloadSchemaExcel(...);
190
+
191
+ const blob = await response.blob();
192
+ const arrayBuffer = await blob.arrayBuffer();
193
+ await writeFile('output.bin', Buffer.from(arrayBuffer));
194
+ ```
195
+
196
+ </details>
197
+ </blockquote>
198
+
199
+ <blockquote>
200
+ <details>
201
+ <summary>Bytes (UIntArray8)</summary>
202
+
203
+ ```ts
204
+ import { writeFile } from 'fs/promises';
205
+
206
+ const response = await client.downloadSchemaExcel(...);
207
+
208
+ const bytes = await response.bytes();
209
+ await writeFile('path/to/file', bytes);
210
+ ```
211
+
212
+ </details>
213
+ </blockquote>
214
+
215
+ </details>
216
+ </blockquote>
217
+
218
+ <blockquote>
219
+ <details>
220
+ <summary>Bun</summary>
221
+
222
+ <blockquote>
223
+ <details>
224
+ <summary>ReadableStream (most-efficient)</summary>
225
+
226
+ ```ts
227
+ const response = await client.downloadSchemaExcel(...);
228
+
229
+ const stream = response.stream();
230
+ await Bun.write('path/to/file', stream);
231
+ ```
232
+
233
+ </details>
234
+ </blockquote>
235
+
236
+ <blockquote>
237
+ <details>
238
+ <summary>ArrayBuffer</summary>
239
+
240
+ ```ts
241
+ const response = await client.downloadSchemaExcel(...);
242
+
243
+ const arrayBuffer = await response.arrayBuffer();
244
+ await Bun.write('path/to/file', arrayBuffer);
245
+ ```
246
+
247
+ </details>
248
+ </blockquote>
249
+
250
+ <blockquote>
251
+ <details>
252
+ <summary>Blob</summary>
253
+
254
+ ```ts
255
+ const response = await client.downloadSchemaExcel(...);
256
+
257
+ const blob = await response.blob();
258
+ await Bun.write('path/to/file', blob);
259
+ ```
260
+
261
+ </details>
262
+ </blockquote>
263
+
264
+ <blockquote>
265
+ <details>
266
+ <summary>Bytes (UIntArray8)</summary>
267
+
268
+ ```ts
269
+ const response = await client.downloadSchemaExcel(...);
270
+
271
+ const bytes = await response.bytes();
272
+ await Bun.write('path/to/file', bytes);
273
+ ```
274
+
275
+ </details>
276
+ </blockquote>
277
+
278
+ </details>
279
+ </blockquote>
280
+
281
+ <blockquote>
282
+ <details>
283
+ <summary>Deno</summary>
284
+
285
+ <blockquote>
286
+ <details>
287
+ <summary>ReadableStream (most-efficient)</summary>
288
+
289
+ ```ts
290
+ const response = await client.downloadSchemaExcel(...);
291
+
292
+ const stream = response.stream();
293
+ const file = await Deno.open('path/to/file', { write: true, create: true });
294
+ await stream.pipeTo(file.writable);
295
+ ```
296
+
297
+ </details>
298
+ </blockquote>
299
+
300
+ <blockquote>
301
+ <details>
302
+ <summary>ArrayBuffer</summary>
303
+
304
+ ```ts
305
+ const response = await client.downloadSchemaExcel(...);
306
+
307
+ const arrayBuffer = await response.arrayBuffer();
308
+ await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer));
309
+ ```
310
+
311
+ </details>
312
+ </blockquote>
313
+
314
+ <blockquote>
315
+ <details>
316
+ <summary>Blob</summary>
317
+
318
+ ```ts
319
+ const response = await client.downloadSchemaExcel(...);
320
+
321
+ const blob = await response.blob();
322
+ const arrayBuffer = await blob.arrayBuffer();
323
+ await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer));
324
+ ```
325
+
326
+ </details>
327
+ </blockquote>
328
+
329
+ <blockquote>
330
+ <details>
331
+ <summary>Bytes (UIntArray8)</summary>
332
+
333
+ ```ts
334
+ const response = await client.downloadSchemaExcel(...);
335
+
336
+ const bytes = await response.bytes();
337
+ await Deno.writeFile('path/to/file', bytes);
338
+ ```
339
+
340
+ </details>
341
+ </blockquote>
342
+
343
+ </details>
344
+ </blockquote>
345
+
346
+ <blockquote>
347
+ <details>
348
+ <summary>Browser</summary>
349
+
350
+ <blockquote>
351
+ <details>
352
+ <summary>Blob (most-efficient)</summary>
353
+
354
+ ```ts
355
+ const response = await client.downloadSchemaExcel(...);
356
+
357
+ const blob = await response.blob();
358
+ const url = URL.createObjectURL(blob);
359
+
360
+ // trigger download
361
+ const a = document.createElement('a');
362
+ a.href = url;
363
+ a.download = 'filename';
364
+ a.click();
365
+ URL.revokeObjectURL(url);
366
+ ```
367
+
368
+ </details>
369
+ </blockquote>
370
+
371
+ <blockquote>
372
+ <details>
373
+ <summary>ReadableStream</summary>
374
+
375
+ ```ts
376
+ const response = await client.downloadSchemaExcel(...);
377
+
378
+ const stream = response.stream();
379
+ const reader = stream.getReader();
380
+ const chunks = [];
381
+
382
+ while (true) {
383
+ const { done, value } = await reader.read();
384
+ if (done) break;
385
+ chunks.push(value);
386
+ }
387
+
388
+ const blob = new Blob(chunks);
389
+ const url = URL.createObjectURL(blob);
390
+
391
+ // trigger download
392
+ const a = document.createElement('a');
393
+ a.href = url;
394
+ a.download = 'filename';
395
+ a.click();
396
+ URL.revokeObjectURL(url);
397
+ ```
398
+
399
+ </details>
400
+ </blockquote>
401
+
402
+ <blockquote>
403
+ <details>
404
+ <summary>ArrayBuffer</summary>
405
+
406
+ ```ts
407
+ const response = await client.downloadSchemaExcel(...);
408
+
409
+ const arrayBuffer = await response.arrayBuffer();
410
+ const blob = new Blob([arrayBuffer]);
411
+ const url = URL.createObjectURL(blob);
412
+
413
+ // trigger download
414
+ const a = document.createElement('a');
415
+ a.href = url;
416
+ a.download = 'filename';
417
+ a.click();
418
+ URL.revokeObjectURL(url);
419
+ ```
420
+
421
+ </details>
422
+ </blockquote>
423
+
424
+ <blockquote>
425
+ <details>
426
+ <summary>Bytes (UIntArray8)</summary>
427
+
428
+ ```ts
429
+ const response = await client.downloadSchemaExcel(...);
430
+
431
+ const bytes = await response.bytes();
432
+ const blob = new Blob([bytes]);
433
+ const url = URL.createObjectURL(blob);
434
+
435
+ // trigger download
436
+ const a = document.createElement('a');
437
+ a.href = url;
438
+ a.download = 'filename';
439
+ a.click();
440
+ URL.revokeObjectURL(url);
441
+ ```
442
+
443
+ </details>
444
+ </blockquote>
445
+
446
+ </details>
447
+ </blockquote>
448
+
449
+ </details>
450
+ </blockquote>
451
+
452
+ <details>
453
+ <summary>Convert binary response to text</summary>
454
+
455
+ <blockquote>
456
+ <details>
457
+ <summary>ReadableStream</summary>
458
+
459
+ ```ts
460
+ const response = await client.downloadSchemaExcel(...);
461
+
462
+ const stream = response.stream();
463
+ const text = await new Response(stream).text();
464
+ ```
465
+
466
+ </details>
467
+ </blockquote>
468
+
469
+ <blockquote>
470
+ <details>
471
+ <summary>ArrayBuffer</summary>
472
+
473
+ ```ts
474
+ const response = await client.downloadSchemaExcel(...);
475
+
476
+ const arrayBuffer = await response.arrayBuffer();
477
+ const text = new TextDecoder().decode(arrayBuffer);
478
+ ```
479
+
480
+ </details>
481
+ </blockquote>
482
+
483
+ <blockquote>
484
+ <details>
485
+ <summary>Blob</summary>
486
+
487
+ ```ts
488
+ const response = await client.downloadSchemaExcel(...);
489
+
490
+ const blob = await response.blob();
491
+ const text = await blob.text();
492
+ ```
493
+
494
+ </details>
495
+ </blockquote>
496
+
497
+ <blockquote>
498
+ <details>
499
+ <summary>Bytes (UIntArray8)</summary>
500
+
501
+ ```ts
502
+ const response = await client.downloadSchemaExcel(...);
503
+
504
+ const bytes = await response.bytes();
505
+ const text = new TextDecoder().decode(bytes);
506
+ ```
507
+
508
+ </details>
509
+ </blockquote>
510
+
511
+ </details>
512
+
123
513
  ## Advanced
124
514
 
125
515
  ### Additional Headers
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "pulse-ts-sdk",
46
- "X-Fern-SDK-Version": "1.0.5",
47
- "User-Agent": "pulse-ts-sdk/1.0.5",
46
+ "X-Fern-SDK-Version": "1.0.7",
47
+ "User-Agent": "pulse-ts-sdk/1.0.7",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -1,4 +1,5 @@
1
1
  import * as Pulse from "./api/index.js";
2
+ import { BatchClient } from "./api/resources/batch/client/Client.js";
2
3
  import { JobsClient } from "./api/resources/jobs/client/Client.js";
3
4
  import { WebhooksClient } from "./api/resources/webhooks/client/Client.js";
4
5
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
@@ -11,9 +12,11 @@ export declare namespace PulseClient {
11
12
  }
12
13
  export declare class PulseClient {
13
14
  protected readonly _options: NormalizedClientOptionsWithAuth<PulseClient.Options>;
15
+ protected _batch: BatchClient | undefined;
14
16
  protected _jobs: JobsClient | undefined;
15
17
  protected _webhooks: WebhooksClient | undefined;
16
18
  constructor(options?: PulseClient.Options);
19
+ get batch(): BatchClient;
17
20
  get jobs(): JobsClient;
18
21
  get webhooks(): WebhooksClient;
19
22
  /**
@@ -24,6 +27,9 @@ export declare class PulseClient {
24
27
  * Set `async: true` to return immediately with a job_id for polling via
25
28
  * GET /job/{jobId}. Otherwise processes synchronously.
26
29
  *
30
+ * To process many files at once, see [Batch Extract](api:POST/batch/extract)
31
+ * or the [Batch Processing guide](/batch).
32
+ *
27
33
  * @param {Pulse.ExtractRequest} request
28
34
  * @param {PulseClient.RequestOptions} requestOptions - Request-specific configuration.
29
35
  *
@@ -68,6 +74,9 @@ export declare class PulseClient {
68
74
  *
69
75
  * Set `async: true` to return immediately with a job_id for polling.
70
76
  *
77
+ * To split many extractions at once, see [Batch Split](api:POST/batch/split)
78
+ * or the [Batch Processing guide](/batch).
79
+ *
71
80
  * @param {Pulse.SplitInput} request
72
81
  * @param {PulseClient.RequestOptions} requestOptions - Request-specific configuration.
73
82
  *
@@ -91,13 +100,27 @@ export declare class PulseClient {
91
100
  * **Single mode** — Provide `extraction_id` + `schema_config` (or
92
101
  * `schema_config_id`) to apply one schema to the entire document.
93
102
  *
103
+ * **Multi-extraction mode** — Provide a batch extract ID as `extraction_id`
104
+ * (auto-detected) or an explicit `extraction_ids` list. The content from all
105
+ * extractions is combined and the schema is applied to the composite. Citations
106
+ * use `extraction_id-bb_id` format to disambiguate across source documents.
107
+ *
94
108
  * **Split mode** — Provide `split_id` + `split_schema_config` to apply
95
109
  * different schemas to different page groups from a prior `/split` call.
96
110
  * Each topic can have its own schema, prompt, and effort setting.
97
111
  *
112
+ * **Excel template mode** — Provide `excel_template` (base64 .xlsx) in
113
+ * `schema_config` instead of `input_schema`. The schema is auto-generated
114
+ * from the template's column headers, and a filled copy is returned as
115
+ * `excel_output_url`.
116
+ *
98
117
  * Creates a versioned schema record that can be retrieved later.
99
118
  * Set `async: true` to return immediately with a job_id for polling.
100
119
  *
120
+ * To apply schemas across many extractions or splits at once, see
121
+ * [Batch Schema](api:POST/batch/schema) or the
122
+ * [Batch Processing guide](/batch).
123
+ *
101
124
  * @param {Pulse.SchemaInput} request
102
125
  * @param {PulseClient.RequestOptions} requestOptions - Request-specific configuration.
103
126
  *
@@ -112,6 +135,16 @@ export declare class PulseClient {
112
135
  */
113
136
  schema(request?: Pulse.SchemaInput, requestOptions?: PulseClient.RequestOptions): core.HttpResponsePromise<Pulse.SchemaResponse>;
114
137
  private __schema;
138
+ /**
139
+ * Download the filled Excel template produced by a schema extraction that
140
+ * used `excel_template` in its `schema_config`. Requires the same API key
141
+ * authentication as other endpoints. The caller must belong to the org
142
+ * that owns the underlying extraction.
143
+ * @throws {@link Pulse.UnauthorizedError}
144
+ * @throws {@link Pulse.NotFoundError}
145
+ */
146
+ downloadSchemaExcel(request: Pulse.DownloadSchemaExcelRequest, requestOptions?: PulseClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
147
+ private __downloadSchemaExcel;
115
148
  /**
116
149
  * Extract tables from a previously completed extraction. Processes the
117
150
  * extraction's document content and returns structured table data.
@@ -122,6 +155,10 @@ export declare class PulseClient {
122
155
  * Set `async: true` to return immediately with a `tables_id` for
123
156
  * polling via `GET /job/{tables_id}`.
124
157
  *
158
+ * To extract tables from many extractions at once, see
159
+ * [Batch Tables](api:POST/batch/tables) or the
160
+ * [Batch Processing guide](/batch).
161
+ *
125
162
  * @param {Pulse.TablesInput} request
126
163
  * @param {PulseClient.RequestOptions} requestOptions - Request-specific configuration.
127
164
  *
@@ -45,8 +45,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
46
  exports.PulseClient = void 0;
47
47
  const Pulse = __importStar(require("./api/index.js"));
48
- const Client_js_1 = require("./api/resources/jobs/client/Client.js");
49
- const Client_js_2 = require("./api/resources/webhooks/client/Client.js");
48
+ const Client_js_1 = require("./api/resources/batch/client/Client.js");
49
+ const Client_js_2 = require("./api/resources/jobs/client/Client.js");
50
+ const Client_js_3 = require("./api/resources/webhooks/client/Client.js");
50
51
  const BaseClient_js_1 = require("./BaseClient.js");
51
52
  const headers_js_1 = require("./core/headers.js");
52
53
  const core = __importStar(require("./core/index.js"));
@@ -58,13 +59,17 @@ class PulseClient {
58
59
  constructor(options = {}) {
59
60
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
60
61
  }
62
+ get batch() {
63
+ var _a;
64
+ return ((_a = this._batch) !== null && _a !== void 0 ? _a : (this._batch = new Client_js_1.BatchClient(this._options)));
65
+ }
61
66
  get jobs() {
62
67
  var _a;
63
- return ((_a = this._jobs) !== null && _a !== void 0 ? _a : (this._jobs = new Client_js_1.JobsClient(this._options)));
68
+ return ((_a = this._jobs) !== null && _a !== void 0 ? _a : (this._jobs = new Client_js_2.JobsClient(this._options)));
64
69
  }
65
70
  get webhooks() {
66
71
  var _a;
67
- return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_js_2.WebhooksClient(this._options)));
72
+ return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_js_3.WebhooksClient(this._options)));
68
73
  }
69
74
  /**
70
75
  * The primary endpoint for the Pulse API. Parses uploaded documents or remote
@@ -74,6 +79,9 @@ class PulseClient {
74
79
  * Set `async: true` to return immediately with a job_id for polling via
75
80
  * GET /job/{jobId}. Otherwise processes synchronously.
76
81
  *
82
+ * To process many files at once, see [Batch Extract](api:POST/batch/extract)
83
+ * or the [Batch Processing guide](/batch).
84
+ *
77
85
  * @param {Pulse.ExtractRequest} request
78
86
  * @param {PulseClient.RequestOptions} requestOptions - Request-specific configuration.
79
87
  *
@@ -98,6 +106,9 @@ class PulseClient {
98
106
  if (request.fileUrl != null) {
99
107
  _request.append("fileUrl", request.fileUrl);
100
108
  }
109
+ if (request.model != null) {
110
+ _request.append("model", request.model);
111
+ }
101
112
  if (request.pages != null) {
102
113
  _request.append("pages", request.pages);
103
114
  }
@@ -216,6 +227,9 @@ class PulseClient {
216
227
  if (request.fileUrl != null) {
217
228
  _request.append("fileUrl", request.fileUrl);
218
229
  }
230
+ if (request.model != null) {
231
+ _request.append("model", request.model);
232
+ }
219
233
  if (request.pages != null) {
220
234
  _request.append("pages", request.pages);
221
235
  }
@@ -314,6 +328,9 @@ class PulseClient {
314
328
  *
315
329
  * Set `async: true` to return immediately with a job_id for polling.
316
330
  *
331
+ * To split many extractions at once, see [Batch Split](api:POST/batch/split)
332
+ * or the [Batch Processing guide](/batch).
333
+ *
317
334
  * @param {Pulse.SplitInput} request
318
335
  * @param {PulseClient.RequestOptions} requestOptions - Request-specific configuration.
319
336
  *
@@ -383,13 +400,27 @@ class PulseClient {
383
400
  * **Single mode** — Provide `extraction_id` + `schema_config` (or
384
401
  * `schema_config_id`) to apply one schema to the entire document.
385
402
  *
403
+ * **Multi-extraction mode** — Provide a batch extract ID as `extraction_id`
404
+ * (auto-detected) or an explicit `extraction_ids` list. The content from all
405
+ * extractions is combined and the schema is applied to the composite. Citations
406
+ * use `extraction_id-bb_id` format to disambiguate across source documents.
407
+ *
386
408
  * **Split mode** — Provide `split_id` + `split_schema_config` to apply
387
409
  * different schemas to different page groups from a prior `/split` call.
388
410
  * Each topic can have its own schema, prompt, and effort setting.
389
411
  *
412
+ * **Excel template mode** — Provide `excel_template` (base64 .xlsx) in
413
+ * `schema_config` instead of `input_schema`. The schema is auto-generated
414
+ * from the template's column headers, and a filled copy is returned as
415
+ * `excel_output_url`.
416
+ *
390
417
  * Creates a versioned schema record that can be retrieved later.
391
418
  * Set `async: true` to return immediately with a job_id for polling.
392
419
  *
420
+ * To apply schemas across many extractions or splits at once, see
421
+ * [Batch Schema](api:POST/batch/schema) or the
422
+ * [Batch Processing guide](/batch).
423
+ *
393
424
  * @param {Pulse.SchemaInput} request
394
425
  * @param {PulseClient.RequestOptions} requestOptions - Request-specific configuration.
395
426
  *
@@ -450,6 +481,55 @@ class PulseClient {
450
481
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/schema");
451
482
  });
452
483
  }
484
+ /**
485
+ * Download the filled Excel template produced by a schema extraction that
486
+ * used `excel_template` in its `schema_config`. Requires the same API key
487
+ * authentication as other endpoints. The caller must belong to the org
488
+ * that owns the underlying extraction.
489
+ * @throws {@link Pulse.UnauthorizedError}
490
+ * @throws {@link Pulse.NotFoundError}
491
+ */
492
+ downloadSchemaExcel(request, requestOptions) {
493
+ return core.HttpResponsePromise.fromPromise(this.__downloadSchemaExcel(request, requestOptions));
494
+ }
495
+ __downloadSchemaExcel(request, requestOptions) {
496
+ return __awaiter(this, void 0, void 0, function* () {
497
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
498
+ const { schemaId } = request;
499
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
500
+ 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);
501
+ const _response = yield core.fetcher({
502
+ 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, `schema/${core.url.encodePathParam(schemaId)}/excel`),
503
+ method: "GET",
504
+ headers: _headers,
505
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
506
+ responseType: "binary-response",
507
+ 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,
508
+ 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,
509
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
510
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
511
+ logging: this._options.logging,
512
+ });
513
+ if (_response.ok) {
514
+ return { data: _response.body, rawResponse: _response.rawResponse };
515
+ }
516
+ if (_response.error.reason === "status-code") {
517
+ switch (_response.error.statusCode) {
518
+ case 401:
519
+ throw new Pulse.UnauthorizedError(_response.error.body, _response.rawResponse);
520
+ case 404:
521
+ throw new Pulse.NotFoundError(_response.error.body, _response.rawResponse);
522
+ default:
523
+ throw new errors.PulseError({
524
+ statusCode: _response.error.statusCode,
525
+ body: _response.error.body,
526
+ rawResponse: _response.rawResponse,
527
+ });
528
+ }
529
+ }
530
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/schema/{schemaId}/excel");
531
+ });
532
+ }
453
533
  /**
454
534
  * Extract tables from a previously completed extraction. Processes the
455
535
  * extraction's document content and returns structured table data.
@@ -460,6 +540,10 @@ class PulseClient {
460
540
  * Set `async: true` to return immediately with a `tables_id` for
461
541
  * polling via `GET /job/{tables_id}`.
462
542
  *
543
+ * To extract tables from many extractions at once, see
544
+ * [Batch Tables](api:POST/batch/tables) or the
545
+ * [Batch Processing guide](/batch).
546
+ *
463
547
  * @param {Pulse.TablesInput} request
464
548
  * @param {PulseClient.RequestOptions} requestOptions - Request-specific configuration.
465
549
  *
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * schemaId: "schemaId"
5
+ * }
6
+ */
7
+ export interface DownloadSchemaExcelRequest {
8
+ /** The schema ID returned from a prior `POST /schema` call. */
9
+ schemaId: string;
10
+ }
@@ -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 });