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