pulse-ts-sdk 1.0.8 → 1.0.10
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/README.md +22 -22
- package/dist/cjs/BaseClient.js +3 -2
- package/dist/cjs/Client.d.ts +12 -0
- package/dist/cjs/Client.js +78 -28
- package/dist/cjs/api/client/requests/ExtractAsyncRequest.d.ts +17 -5
- package/dist/cjs/api/client/requests/ExtractAsyncRequest.js +3 -2
- package/dist/cjs/api/client/requests/ExtractRequest.d.ts +17 -5
- package/dist/cjs/api/client/requests/ExtractRequest.js +3 -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/batch/client/Client.js +32 -16
- package/dist/cjs/api/resources/form/client/Client.d.ts +148 -0
- package/dist/cjs/api/resources/form/client/Client.js +350 -0
- package/dist/cjs/api/resources/form/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/form/client/index.js +17 -0
- package/dist/cjs/api/resources/form/client/requests/FormClearJsonInput.d.ts +19 -0
- package/dist/cjs/api/resources/form/client/requests/FormClearJsonInput.js +3 -0
- package/dist/cjs/api/resources/form/client/requests/FormDetectJsonInput.d.ts +14 -0
- package/dist/cjs/api/resources/form/client/requests/FormDetectJsonInput.js +3 -0
- package/dist/cjs/api/resources/form/client/requests/FormFillJsonInput.d.ts +21 -0
- package/dist/cjs/api/resources/form/client/requests/FormFillJsonInput.js +3 -0
- package/dist/cjs/api/resources/form/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/form/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/form/index.d.ts +1 -0
- package/dist/cjs/api/resources/form/index.js +17 -0
- package/dist/cjs/api/resources/index.d.ts +8 -0
- package/dist/cjs/api/resources/index.js +9 -1
- package/dist/cjs/api/resources/jobs/client/Client.js +16 -8
- package/dist/cjs/api/resources/largeResults/client/Client.d.ts +41 -0
- package/dist/cjs/api/resources/largeResults/client/Client.js +131 -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 +57 -0
- package/dist/cjs/api/resources/pipeline/client/Client.js +151 -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/resources/results/client/Client.d.ts +27 -0
- package/dist/cjs/api/resources/results/client/Client.js +116 -0
- package/dist/cjs/api/resources/results/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/results/client/index.js +17 -0
- package/dist/cjs/api/resources/results/client/requests/GetPdfResultsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/results/client/requests/GetPdfResultsRequest.js +3 -0
- package/dist/cjs/api/resources/results/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/results/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/results/index.d.ts +1 -0
- package/dist/cjs/api/resources/results/index.js +17 -0
- package/dist/cjs/api/resources/webhooks/client/Client.js +8 -4
- package/dist/cjs/api/types/AsyncSubmissionResponse.d.ts +2 -0
- package/dist/cjs/api/types/ExtractInput.d.ts +17 -5
- package/dist/cjs/api/types/ExtractInput.js +3 -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 +17 -5
- package/dist/cjs/api/types/ExtractOptions.js +3 -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/FormCell.d.ts +40 -0
- package/dist/cjs/api/types/FormCell.js +13 -0
- package/dist/cjs/api/types/FormCheckboxDetail.d.ts +11 -0
- package/dist/cjs/api/types/FormCheckboxDetail.js +3 -0
- package/dist/cjs/api/types/FormClearMultipartInput.d.ts +21 -0
- package/dist/cjs/api/types/FormClearMultipartInput.js +3 -0
- package/dist/cjs/api/types/FormDetectMultipartInput.d.ts +16 -0
- package/dist/cjs/api/types/FormDetectMultipartInput.js +3 -0
- package/dist/cjs/api/types/FormFillMultipartInput.d.ts +21 -0
- package/dist/cjs/api/types/FormFillMultipartInput.js +3 -0
- package/dist/cjs/api/types/FormFillSharedOptions.d.ts +12 -0
- package/dist/cjs/api/types/FormFillSharedOptions.js +3 -0
- package/dist/cjs/api/types/FormPlanInfo.d.ts +11 -0
- package/dist/cjs/api/types/FormPlanInfo.js +3 -0
- package/dist/cjs/api/types/FormResult.d.ts +24 -0
- package/dist/cjs/api/types/FormResult.js +3 -0
- package/dist/cjs/api/types/FormSharedOptions.d.ts +9 -0
- package/dist/cjs/api/types/FormSharedOptions.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 +16 -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 +147 -0
- package/dist/cjs/api/types/PipelineStepBatchExtractConfig.js +27 -0
- package/dist/cjs/api/types/PipelineSteps.d.ts +16 -0
- package/dist/cjs/api/types/PipelineSteps.js +3 -0
- package/dist/cjs/api/types/PipelineTablesResult.d.ts +33 -0
- package/dist/cjs/api/types/PipelineTablesResult.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 +5 -2
- package/dist/cjs/api/types/TablesConfig.js +2 -1
- package/dist/cjs/api/types/TablesResponse.d.ts +4 -2
- package/dist/cjs/api/types/index.d.ts +23 -0
- package/dist/cjs/api/types/index.js +23 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +3 -2
- package/dist/esm/Client.d.mts +12 -0
- package/dist/esm/Client.mjs +74 -24
- package/dist/esm/api/client/requests/ExtractAsyncRequest.d.mts +17 -5
- package/dist/esm/api/client/requests/ExtractAsyncRequest.mjs +3 -2
- package/dist/esm/api/client/requests/ExtractRequest.d.mts +17 -5
- package/dist/esm/api/client/requests/ExtractRequest.mjs +3 -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/batch/client/Client.mjs +32 -16
- package/dist/esm/api/resources/form/client/Client.d.mts +148 -0
- package/dist/esm/api/resources/form/client/Client.mjs +313 -0
- package/dist/esm/api/resources/form/client/index.d.mts +1 -0
- package/dist/esm/api/resources/form/client/index.mjs +1 -0
- package/dist/esm/api/resources/form/client/requests/FormClearJsonInput.d.mts +19 -0
- package/dist/esm/api/resources/form/client/requests/FormClearJsonInput.mjs +2 -0
- package/dist/esm/api/resources/form/client/requests/FormDetectJsonInput.d.mts +14 -0
- package/dist/esm/api/resources/form/client/requests/FormDetectJsonInput.mjs +2 -0
- package/dist/esm/api/resources/form/client/requests/FormFillJsonInput.d.mts +21 -0
- package/dist/esm/api/resources/form/client/requests/FormFillJsonInput.mjs +2 -0
- package/dist/esm/api/resources/form/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/form/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/form/index.d.mts +1 -0
- package/dist/esm/api/resources/form/index.mjs +1 -0
- package/dist/esm/api/resources/index.d.mts +8 -0
- package/dist/esm/api/resources/index.mjs +8 -0
- package/dist/esm/api/resources/jobs/client/Client.mjs +16 -8
- package/dist/esm/api/resources/largeResults/client/Client.d.mts +41 -0
- package/dist/esm/api/resources/largeResults/client/Client.mjs +94 -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 +57 -0
- package/dist/esm/api/resources/pipeline/client/Client.mjs +114 -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/resources/results/client/Client.d.mts +27 -0
- package/dist/esm/api/resources/results/client/Client.mjs +79 -0
- package/dist/esm/api/resources/results/client/index.d.mts +1 -0
- package/dist/esm/api/resources/results/client/index.mjs +1 -0
- package/dist/esm/api/resources/results/client/requests/GetPdfResultsRequest.d.mts +10 -0
- package/dist/esm/api/resources/results/client/requests/GetPdfResultsRequest.mjs +2 -0
- package/dist/esm/api/resources/results/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/results/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/results/index.d.mts +1 -0
- package/dist/esm/api/resources/results/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/client/Client.mjs +8 -4
- package/dist/esm/api/types/AsyncSubmissionResponse.d.mts +2 -0
- package/dist/esm/api/types/ExtractInput.d.mts +17 -5
- package/dist/esm/api/types/ExtractInput.mjs +3 -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 +17 -5
- package/dist/esm/api/types/ExtractOptions.mjs +3 -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/FormCell.d.mts +40 -0
- package/dist/esm/api/types/FormCell.mjs +10 -0
- package/dist/esm/api/types/FormCheckboxDetail.d.mts +11 -0
- package/dist/esm/api/types/FormCheckboxDetail.mjs +2 -0
- package/dist/esm/api/types/FormClearMultipartInput.d.mts +21 -0
- package/dist/esm/api/types/FormClearMultipartInput.mjs +2 -0
- package/dist/esm/api/types/FormDetectMultipartInput.d.mts +16 -0
- package/dist/esm/api/types/FormDetectMultipartInput.mjs +2 -0
- package/dist/esm/api/types/FormFillMultipartInput.d.mts +21 -0
- package/dist/esm/api/types/FormFillMultipartInput.mjs +2 -0
- package/dist/esm/api/types/FormFillSharedOptions.d.mts +12 -0
- package/dist/esm/api/types/FormFillSharedOptions.mjs +2 -0
- package/dist/esm/api/types/FormPlanInfo.d.mts +11 -0
- package/dist/esm/api/types/FormPlanInfo.mjs +2 -0
- package/dist/esm/api/types/FormResult.d.mts +24 -0
- package/dist/esm/api/types/FormResult.mjs +2 -0
- package/dist/esm/api/types/FormSharedOptions.d.mts +9 -0
- package/dist/esm/api/types/FormSharedOptions.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 +16 -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 +147 -0
- package/dist/esm/api/types/PipelineStepBatchExtractConfig.mjs +24 -0
- package/dist/esm/api/types/PipelineSteps.d.mts +16 -0
- package/dist/esm/api/types/PipelineSteps.mjs +2 -0
- package/dist/esm/api/types/PipelineTablesResult.d.mts +33 -0
- package/dist/esm/api/types/PipelineTablesResult.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 +5 -2
- package/dist/esm/api/types/TablesConfig.mjs +2 -1
- package/dist/esm/api/types/TablesResponse.d.mts +4 -2
- package/dist/esm/api/types/index.d.mts +23 -0
- package/dist/esm/api/types/index.mjs +23 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +513 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
export * from "./batch/client/requests/index.mjs";
|
|
2
2
|
export * as batch from "./batch/index.mjs";
|
|
3
|
+
export * from "./form/client/requests/index.mjs";
|
|
4
|
+
export * as form from "./form/index.mjs";
|
|
3
5
|
export * from "./jobs/client/requests/index.mjs";
|
|
4
6
|
export * as jobs from "./jobs/index.mjs";
|
|
7
|
+
export * from "./largeResults/client/requests/index.mjs";
|
|
8
|
+
export * as largeResults from "./largeResults/index.mjs";
|
|
9
|
+
export * from "./pipeline/client/requests/index.mjs";
|
|
10
|
+
export * as pipeline from "./pipeline/index.mjs";
|
|
11
|
+
export * from "./results/client/requests/index.mjs";
|
|
12
|
+
export * as results from "./results/index.mjs";
|
|
5
13
|
export * as webhooks from "./webhooks/index.mjs";
|
|
6
14
|
export * from "./webhooks/types/index.mjs";
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
export * from "./batch/client/requests/index.mjs";
|
|
2
2
|
export * as batch from "./batch/index.mjs";
|
|
3
|
+
export * from "./form/client/requests/index.mjs";
|
|
4
|
+
export * as form from "./form/index.mjs";
|
|
3
5
|
export * from "./jobs/client/requests/index.mjs";
|
|
4
6
|
export * as jobs from "./jobs/index.mjs";
|
|
7
|
+
export * from "./largeResults/client/requests/index.mjs";
|
|
8
|
+
export * as largeResults from "./largeResults/index.mjs";
|
|
9
|
+
export * from "./pipeline/client/requests/index.mjs";
|
|
10
|
+
export * as pipeline from "./pipeline/index.mjs";
|
|
11
|
+
export * from "./results/client/requests/index.mjs";
|
|
12
|
+
export * as results from "./results/index.mjs";
|
|
5
13
|
export * as webhooks from "./webhooks/index.mjs";
|
|
6
14
|
export * from "./webhooks/types/index.mjs";
|
|
@@ -42,7 +42,7 @@ export class JobsClient {
|
|
|
42
42
|
}
|
|
43
43
|
__getJob(request, requestOptions) {
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
45
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
46
46
|
const { jobId } = request;
|
|
47
47
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
48
48
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
@@ -51,10 +51,14 @@ export class JobsClient {
|
|
|
51
51
|
method: "GET",
|
|
52
52
|
headers: _headers,
|
|
53
53
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
54
|
-
timeoutMs: (
|
|
55
|
-
|
|
54
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null
|
|
55
|
+
? requestOptions.timeoutInSeconds * 1000
|
|
56
|
+
: ((_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) != null
|
|
57
|
+
? ((_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) * 1000
|
|
58
|
+
: undefined,
|
|
59
|
+
maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
|
|
56
60
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
57
|
-
fetchFn: (
|
|
61
|
+
fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
|
|
58
62
|
logging: this._options.logging,
|
|
59
63
|
});
|
|
60
64
|
if (_response.ok) {
|
|
@@ -106,7 +110,7 @@ export class JobsClient {
|
|
|
106
110
|
}
|
|
107
111
|
__cancelJob(request, requestOptions) {
|
|
108
112
|
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
113
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
110
114
|
const { jobId } = request;
|
|
111
115
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
112
116
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
@@ -115,10 +119,14 @@ export class JobsClient {
|
|
|
115
119
|
method: "DELETE",
|
|
116
120
|
headers: _headers,
|
|
117
121
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
118
|
-
timeoutMs: (
|
|
119
|
-
|
|
122
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null
|
|
123
|
+
? requestOptions.timeoutInSeconds * 1000
|
|
124
|
+
: ((_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) != null
|
|
125
|
+
? ((_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) * 1000
|
|
126
|
+
: undefined,
|
|
127
|
+
maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
|
|
120
128
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
121
|
-
fetchFn: (
|
|
129
|
+
fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
|
|
122
130
|
logging: this._options.logging,
|
|
123
131
|
});
|
|
124
132
|
if (_response.ok) {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as Pulse from "../../../index.mjs";
|
|
5
|
+
export declare namespace LargeResultsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class LargeResultsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<LargeResultsClient.Options>;
|
|
12
|
+
constructor(options?: LargeResultsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Download the full result for a large extraction. When `/extract`
|
|
15
|
+
* or `GET /job/{jobId}` returns `is_url: true`, fetch the complete
|
|
16
|
+
* result from the URL provided. The URL is single-use: after a
|
|
17
|
+
* successful download the resource is deleted and subsequent
|
|
18
|
+
* requests return 410 Gone.
|
|
19
|
+
*
|
|
20
|
+
* For form jobs (`/form/detect`, `/form/fill`, `/form/clear`)
|
|
21
|
+
* you don't need this endpoint at all — `GET /job/{jobId}`
|
|
22
|
+
* already returns the full `FormResult` inline under `result`,
|
|
23
|
+
* and the `pdf_url` field points at
|
|
24
|
+
* [GET /results/{jobId}/pdf](api:GET/results/{jobId}/pdf) for the
|
|
25
|
+
* binary.
|
|
26
|
+
*
|
|
27
|
+
* @param {Pulse.GetLargeResultLargeResultsRequest} request
|
|
28
|
+
* @param {LargeResultsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
|
+
*
|
|
30
|
+
* @throws {@link Pulse.NotFoundError}
|
|
31
|
+
* @throws {@link Pulse.GoneError}
|
|
32
|
+
* @throws {@link Pulse.InternalServerError}
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* await client.largeResults.getLargeResult({
|
|
36
|
+
* jobId: "jobId"
|
|
37
|
+
* })
|
|
38
|
+
*/
|
|
39
|
+
getLargeResult(request: Pulse.GetLargeResultLargeResultsRequest, requestOptions?: LargeResultsClient.RequestOptions): core.HttpResponsePromise<Pulse.ExtractResultCore>;
|
|
40
|
+
private __getLargeResult;
|
|
41
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
+
import * as Pulse from "../../../index.mjs";
|
|
18
|
+
export class LargeResultsClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Download the full result for a large extraction. When `/extract`
|
|
24
|
+
* or `GET /job/{jobId}` returns `is_url: true`, fetch the complete
|
|
25
|
+
* result from the URL provided. The URL is single-use: after a
|
|
26
|
+
* successful download the resource is deleted and subsequent
|
|
27
|
+
* requests return 410 Gone.
|
|
28
|
+
*
|
|
29
|
+
* For form jobs (`/form/detect`, `/form/fill`, `/form/clear`)
|
|
30
|
+
* you don't need this endpoint at all — `GET /job/{jobId}`
|
|
31
|
+
* already returns the full `FormResult` inline under `result`,
|
|
32
|
+
* and the `pdf_url` field points at
|
|
33
|
+
* [GET /results/{jobId}/pdf](api:GET/results/{jobId}/pdf) for the
|
|
34
|
+
* binary.
|
|
35
|
+
*
|
|
36
|
+
* @param {Pulse.GetLargeResultLargeResultsRequest} request
|
|
37
|
+
* @param {LargeResultsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
+
*
|
|
39
|
+
* @throws {@link Pulse.NotFoundError}
|
|
40
|
+
* @throws {@link Pulse.GoneError}
|
|
41
|
+
* @throws {@link Pulse.InternalServerError}
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* await client.largeResults.getLargeResult({
|
|
45
|
+
* jobId: "jobId"
|
|
46
|
+
* })
|
|
47
|
+
*/
|
|
48
|
+
getLargeResult(request, requestOptions) {
|
|
49
|
+
return core.HttpResponsePromise.fromPromise(this.__getLargeResult(request, requestOptions));
|
|
50
|
+
}
|
|
51
|
+
__getLargeResult(request, requestOptions) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
54
|
+
const { jobId } = request;
|
|
55
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
56
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
57
|
+
const _response = yield core.fetcher({
|
|
58
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PulseEnvironment.Default, `large_results/${core.url.encodePathParam(jobId)}`),
|
|
59
|
+
method: "GET",
|
|
60
|
+
headers: _headers,
|
|
61
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
62
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null
|
|
63
|
+
? requestOptions.timeoutInSeconds * 1000
|
|
64
|
+
: ((_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) != null
|
|
65
|
+
? ((_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) * 1000
|
|
66
|
+
: undefined,
|
|
67
|
+
maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
|
|
68
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
69
|
+
fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
|
|
70
|
+
logging: this._options.logging,
|
|
71
|
+
});
|
|
72
|
+
if (_response.ok) {
|
|
73
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
74
|
+
}
|
|
75
|
+
if (_response.error.reason === "status-code") {
|
|
76
|
+
switch (_response.error.statusCode) {
|
|
77
|
+
case 404:
|
|
78
|
+
throw new Pulse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
79
|
+
case 410:
|
|
80
|
+
throw new Pulse.GoneError(_response.error.body, _response.rawResponse);
|
|
81
|
+
case 500:
|
|
82
|
+
throw new Pulse.InternalServerError(_response.error.body, _response.rawResponse);
|
|
83
|
+
default:
|
|
84
|
+
throw new errors.PulseError({
|
|
85
|
+
statusCode: _response.error.statusCode,
|
|
86
|
+
body: _response.error.body,
|
|
87
|
+
rawResponse: _response.rawResponse,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/large_results/{jobId}");
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { GetLargeResultLargeResultsRequest } from "./GetLargeResultLargeResultsRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as Pulse from "../../../index.mjs";
|
|
5
|
+
export declare namespace PipelineClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class PipelineClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<PipelineClient.Options>;
|
|
12
|
+
constructor(options?: PipelineClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Chain multiple processing steps (extract, schema, split, tables) into a
|
|
15
|
+
* single request with inline configurations. No saved pipeline required.
|
|
16
|
+
*
|
|
17
|
+
* The `steps` object defines what to run and in what order. Outputs flow
|
|
18
|
+
* forward automatically — you never need to pass extraction IDs between
|
|
19
|
+
* steps.
|
|
20
|
+
*
|
|
21
|
+
* **Supported step combinations:**
|
|
22
|
+
* - `extract` — extract a single document
|
|
23
|
+
* - `extract` → `schema` — extract then apply structured schema
|
|
24
|
+
* - `extract` → `split` — extract then split into topics
|
|
25
|
+
* - `extract` → `split` → `schema` — extract, split by topic, apply per-topic schemas
|
|
26
|
+
* - `extract` → `tables` — extract then extract structured tables
|
|
27
|
+
* - `batch_extract` → `schema` — extract multiple files, combine into one schema output
|
|
28
|
+
*
|
|
29
|
+
* **Document input:**
|
|
30
|
+
* - Single file: provide `fileUrl` in JSON or `file` via multipart
|
|
31
|
+
* - Multiple files (batch_extract): provide `fileUrls` in JSON or multiple `file` fields via multipart
|
|
32
|
+
*
|
|
33
|
+
* Set `async: true` to return immediately with a `job_id` for polling via
|
|
34
|
+
* `GET /job/{jobId}`.
|
|
35
|
+
*
|
|
36
|
+
* Set `autoDelete: true` for zero-retention mode — all stored artifacts
|
|
37
|
+
* are deleted immediately after you receive the results. Requires
|
|
38
|
+
* `save_extractions` to be disabled for your organization.
|
|
39
|
+
*
|
|
40
|
+
* Requires the `enable_adhoc_pipeline` feature flag.
|
|
41
|
+
*
|
|
42
|
+
* @param {Pulse.PipelineExecuteInput} request
|
|
43
|
+
* @param {PipelineClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
44
|
+
*
|
|
45
|
+
* @throws {@link Pulse.BadRequestError}
|
|
46
|
+
* @throws {@link Pulse.UnauthorizedError}
|
|
47
|
+
* @throws {@link Pulse.ForbiddenError}
|
|
48
|
+
* @throws {@link Pulse.TooManyRequestsError}
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* await client.pipeline.execute({
|
|
52
|
+
* steps: {}
|
|
53
|
+
* })
|
|
54
|
+
*/
|
|
55
|
+
execute(request: Pulse.PipelineExecuteInput, requestOptions?: PipelineClient.RequestOptions): core.HttpResponsePromise<Pulse.PipelineExecuteResponse>;
|
|
56
|
+
private __execute;
|
|
57
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
+
import * as Pulse from "../../../index.mjs";
|
|
18
|
+
export class PipelineClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Chain multiple processing steps (extract, schema, split, tables) into a
|
|
24
|
+
* single request with inline configurations. No saved pipeline required.
|
|
25
|
+
*
|
|
26
|
+
* The `steps` object defines what to run and in what order. Outputs flow
|
|
27
|
+
* forward automatically — you never need to pass extraction IDs between
|
|
28
|
+
* steps.
|
|
29
|
+
*
|
|
30
|
+
* **Supported step combinations:**
|
|
31
|
+
* - `extract` — extract a single document
|
|
32
|
+
* - `extract` → `schema` — extract then apply structured schema
|
|
33
|
+
* - `extract` → `split` — extract then split into topics
|
|
34
|
+
* - `extract` → `split` → `schema` — extract, split by topic, apply per-topic schemas
|
|
35
|
+
* - `extract` → `tables` — extract then extract structured tables
|
|
36
|
+
* - `batch_extract` → `schema` — extract multiple files, combine into one schema output
|
|
37
|
+
*
|
|
38
|
+
* **Document input:**
|
|
39
|
+
* - Single file: provide `fileUrl` in JSON or `file` via multipart
|
|
40
|
+
* - Multiple files (batch_extract): provide `fileUrls` in JSON or multiple `file` fields via multipart
|
|
41
|
+
*
|
|
42
|
+
* Set `async: true` to return immediately with a `job_id` for polling via
|
|
43
|
+
* `GET /job/{jobId}`.
|
|
44
|
+
*
|
|
45
|
+
* Set `autoDelete: true` for zero-retention mode — all stored artifacts
|
|
46
|
+
* are deleted immediately after you receive the results. Requires
|
|
47
|
+
* `save_extractions` to be disabled for your organization.
|
|
48
|
+
*
|
|
49
|
+
* Requires the `enable_adhoc_pipeline` feature flag.
|
|
50
|
+
*
|
|
51
|
+
* @param {Pulse.PipelineExecuteInput} request
|
|
52
|
+
* @param {PipelineClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
53
|
+
*
|
|
54
|
+
* @throws {@link Pulse.BadRequestError}
|
|
55
|
+
* @throws {@link Pulse.UnauthorizedError}
|
|
56
|
+
* @throws {@link Pulse.ForbiddenError}
|
|
57
|
+
* @throws {@link Pulse.TooManyRequestsError}
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* await client.pipeline.execute({
|
|
61
|
+
* steps: {}
|
|
62
|
+
* })
|
|
63
|
+
*/
|
|
64
|
+
execute(request, requestOptions) {
|
|
65
|
+
return core.HttpResponsePromise.fromPromise(this.__execute(request, requestOptions));
|
|
66
|
+
}
|
|
67
|
+
__execute(request, requestOptions) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
70
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
71
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
72
|
+
const _response = yield core.fetcher({
|
|
73
|
+
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"),
|
|
74
|
+
method: "POST",
|
|
75
|
+
headers: _headers,
|
|
76
|
+
contentType: "application/json",
|
|
77
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
78
|
+
requestType: "json",
|
|
79
|
+
body: request,
|
|
80
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null
|
|
81
|
+
? requestOptions.timeoutInSeconds * 1000
|
|
82
|
+
: ((_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) != null
|
|
83
|
+
? ((_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) * 1000
|
|
84
|
+
: undefined,
|
|
85
|
+
maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
|
|
86
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
87
|
+
fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
|
|
88
|
+
logging: this._options.logging,
|
|
89
|
+
});
|
|
90
|
+
if (_response.ok) {
|
|
91
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
92
|
+
}
|
|
93
|
+
if (_response.error.reason === "status-code") {
|
|
94
|
+
switch (_response.error.statusCode) {
|
|
95
|
+
case 400:
|
|
96
|
+
throw new Pulse.BadRequestError(_response.error.body, _response.rawResponse);
|
|
97
|
+
case 401:
|
|
98
|
+
throw new Pulse.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
99
|
+
case 403:
|
|
100
|
+
throw new Pulse.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
101
|
+
case 429:
|
|
102
|
+
throw new Pulse.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
103
|
+
default:
|
|
104
|
+
throw new errors.PulseError({
|
|
105
|
+
statusCode: _response.error.statusCode,
|
|
106
|
+
body: _response.error.body,
|
|
107
|
+
rawResponse: _response.rawResponse,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/pipeline/execute");
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as Pulse from "../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* steps: {}
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface PipelineExecuteInput {
|
|
9
|
+
/** URL of the document to process. Use with `extract` step. */
|
|
10
|
+
file_url?: string;
|
|
11
|
+
/** Ordered step definitions. Key order determines execution order. */
|
|
12
|
+
steps: Pulse.PipelineSteps;
|
|
13
|
+
/** If true, returns immediately with a `job_id` for polling via `GET /job/{jobId}`. */
|
|
14
|
+
async?: boolean;
|
|
15
|
+
/** If true, all stored artifacts are deleted immediately after you receive the results. The inline data in the response is unaffected. Requires `save_extractions` to be disabled for your organization. */
|
|
16
|
+
auto_delete?: boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { PipelineExecuteInput } from "./PipelineExecuteInput.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as Pulse from "../../../index.mjs";
|
|
5
|
+
export declare namespace ResultsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class ResultsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ResultsClient.Options>;
|
|
12
|
+
constructor(options?: ResultsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Download the PDF binary produced by a `/form/detect`,
|
|
15
|
+
* `/form/fill`, or `/form/clear` job. The `pdf_url` field on a
|
|
16
|
+
* `FormResult` points at this endpoint — you can hand it
|
|
17
|
+
* directly to a browser, embed it in an `<iframe>`, or fetch the
|
|
18
|
+
* bytes from a backend.
|
|
19
|
+
*
|
|
20
|
+
* Returns `404` for non-form jobs (no PDF was produced) and for
|
|
21
|
+
* form jobs whose PDF artifact is no longer available.
|
|
22
|
+
* @throws {@link Pulse.NotFoundError}
|
|
23
|
+
* @throws {@link Pulse.InternalServerError}
|
|
24
|
+
*/
|
|
25
|
+
getPdf(request: Pulse.GetPdfResultsRequest, requestOptions?: ResultsClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
|
|
26
|
+
private __getPdf;
|
|
27
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
+
import * as Pulse from "../../../index.mjs";
|
|
18
|
+
export class ResultsClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Download the PDF binary produced by a `/form/detect`,
|
|
24
|
+
* `/form/fill`, or `/form/clear` job. The `pdf_url` field on a
|
|
25
|
+
* `FormResult` points at this endpoint — you can hand it
|
|
26
|
+
* directly to a browser, embed it in an `<iframe>`, or fetch the
|
|
27
|
+
* bytes from a backend.
|
|
28
|
+
*
|
|
29
|
+
* Returns `404` for non-form jobs (no PDF was produced) and for
|
|
30
|
+
* form jobs whose PDF artifact is no longer available.
|
|
31
|
+
* @throws {@link Pulse.NotFoundError}
|
|
32
|
+
* @throws {@link Pulse.InternalServerError}
|
|
33
|
+
*/
|
|
34
|
+
getPdf(request, requestOptions) {
|
|
35
|
+
return core.HttpResponsePromise.fromPromise(this.__getPdf(request, requestOptions));
|
|
36
|
+
}
|
|
37
|
+
__getPdf(request, requestOptions) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
40
|
+
const { jobId } = request;
|
|
41
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
42
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
43
|
+
const _response = yield core.fetcher({
|
|
44
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PulseEnvironment.Default, `results/${core.url.encodePathParam(jobId)}/pdf`),
|
|
45
|
+
method: "GET",
|
|
46
|
+
headers: _headers,
|
|
47
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
48
|
+
responseType: "binary-response",
|
|
49
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null
|
|
50
|
+
? requestOptions.timeoutInSeconds * 1000
|
|
51
|
+
: ((_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) != null
|
|
52
|
+
? ((_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) * 1000
|
|
53
|
+
: undefined,
|
|
54
|
+
maxRetries: (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.maxRetries,
|
|
55
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
56
|
+
fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
|
|
57
|
+
logging: this._options.logging,
|
|
58
|
+
});
|
|
59
|
+
if (_response.ok) {
|
|
60
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
61
|
+
}
|
|
62
|
+
if (_response.error.reason === "status-code") {
|
|
63
|
+
switch (_response.error.statusCode) {
|
|
64
|
+
case 404:
|
|
65
|
+
throw new Pulse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
66
|
+
case 500:
|
|
67
|
+
throw new Pulse.InternalServerError(_response.error.body, _response.rawResponse);
|
|
68
|
+
default:
|
|
69
|
+
throw new errors.PulseError({
|
|
70
|
+
statusCode: _response.error.statusCode,
|
|
71
|
+
body: _response.error.body,
|
|
72
|
+
rawResponse: _response.rawResponse,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/results/{jobId}/pdf");
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { GetPdfResultsRequest } from "./GetPdfResultsRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|