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,131 @@
|
|
|
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.LargeResultsClient = 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 LargeResultsClient {
|
|
55
|
+
constructor(options = {}) {
|
|
56
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Download the full result for a large extraction. When `/extract`
|
|
60
|
+
* or `GET /job/{jobId}` returns `is_url: true`, fetch the complete
|
|
61
|
+
* result from the URL provided. The URL is single-use: after a
|
|
62
|
+
* successful download the resource is deleted and subsequent
|
|
63
|
+
* requests return 410 Gone.
|
|
64
|
+
*
|
|
65
|
+
* For form jobs (`/form/detect`, `/form/fill`, `/form/clear`)
|
|
66
|
+
* you don't need this endpoint at all — `GET /job/{jobId}`
|
|
67
|
+
* already returns the full `FormResult` inline under `result`,
|
|
68
|
+
* and the `pdf_url` field points at
|
|
69
|
+
* [GET /results/{jobId}/pdf](api:GET/results/{jobId}/pdf) for the
|
|
70
|
+
* binary.
|
|
71
|
+
*
|
|
72
|
+
* @param {Pulse.GetLargeResultLargeResultsRequest} request
|
|
73
|
+
* @param {LargeResultsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
74
|
+
*
|
|
75
|
+
* @throws {@link Pulse.NotFoundError}
|
|
76
|
+
* @throws {@link Pulse.GoneError}
|
|
77
|
+
* @throws {@link Pulse.InternalServerError}
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* await client.largeResults.getLargeResult({
|
|
81
|
+
* jobId: "jobId"
|
|
82
|
+
* })
|
|
83
|
+
*/
|
|
84
|
+
getLargeResult(request, requestOptions) {
|
|
85
|
+
return core.HttpResponsePromise.fromPromise(this.__getLargeResult(request, requestOptions));
|
|
86
|
+
}
|
|
87
|
+
__getLargeResult(request, requestOptions) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
90
|
+
const { jobId } = request;
|
|
91
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
92
|
+
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);
|
|
93
|
+
const _response = yield core.fetcher({
|
|
94
|
+
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)}`),
|
|
95
|
+
method: "GET",
|
|
96
|
+
headers: _headers,
|
|
97
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
98
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null
|
|
99
|
+
? requestOptions.timeoutInSeconds * 1000
|
|
100
|
+
: ((_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) != null
|
|
101
|
+
? ((_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) * 1000
|
|
102
|
+
: undefined,
|
|
103
|
+
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,
|
|
104
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
105
|
+
fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
|
|
106
|
+
logging: this._options.logging,
|
|
107
|
+
});
|
|
108
|
+
if (_response.ok) {
|
|
109
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
110
|
+
}
|
|
111
|
+
if (_response.error.reason === "status-code") {
|
|
112
|
+
switch (_response.error.statusCode) {
|
|
113
|
+
case 404:
|
|
114
|
+
throw new Pulse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
115
|
+
case 410:
|
|
116
|
+
throw new Pulse.GoneError(_response.error.body, _response.rawResponse);
|
|
117
|
+
case 500:
|
|
118
|
+
throw new Pulse.InternalServerError(_response.error.body, _response.rawResponse);
|
|
119
|
+
default:
|
|
120
|
+
throw new errors.PulseError({
|
|
121
|
+
statusCode: _response.error.statusCode,
|
|
122
|
+
body: _response.error.body,
|
|
123
|
+
rawResponse: _response.rawResponse,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/large_results/{jobId}");
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.LargeResultsClient = LargeResultsClient;
|
|
@@ -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 @@
|
|
|
1
|
+
export type { GetLargeResultLargeResultsRequest } from "./GetLargeResultLargeResultsRequest.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);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../core/index.js";
|
|
4
|
+
import * as Pulse from "../../../index.js";
|
|
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,151 @@
|
|
|
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, tables) into a
|
|
60
|
+
* single 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
|
+
* - `extract` → `split` → `schema` — extract, split by topic, apply per-topic schemas
|
|
71
|
+
* - `extract` → `tables` — extract then extract structured tables
|
|
72
|
+
* - `batch_extract` → `schema` — extract multiple files, combine into one schema output
|
|
73
|
+
*
|
|
74
|
+
* **Document input:**
|
|
75
|
+
* - Single file: provide `fileUrl` in JSON or `file` via multipart
|
|
76
|
+
* - Multiple files (batch_extract): provide `fileUrls` in JSON or multiple `file` fields via multipart
|
|
77
|
+
*
|
|
78
|
+
* Set `async: true` to return immediately with a `job_id` for polling via
|
|
79
|
+
* `GET /job/{jobId}`.
|
|
80
|
+
*
|
|
81
|
+
* Set `autoDelete: true` for zero-retention mode — all stored artifacts
|
|
82
|
+
* are deleted immediately after you receive the results. Requires
|
|
83
|
+
* `save_extractions` to be disabled for your organization.
|
|
84
|
+
*
|
|
85
|
+
* Requires the `enable_adhoc_pipeline` feature flag.
|
|
86
|
+
*
|
|
87
|
+
* @param {Pulse.PipelineExecuteInput} request
|
|
88
|
+
* @param {PipelineClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
89
|
+
*
|
|
90
|
+
* @throws {@link Pulse.BadRequestError}
|
|
91
|
+
* @throws {@link Pulse.UnauthorizedError}
|
|
92
|
+
* @throws {@link Pulse.ForbiddenError}
|
|
93
|
+
* @throws {@link Pulse.TooManyRequestsError}
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* await client.pipeline.execute({
|
|
97
|
+
* steps: {}
|
|
98
|
+
* })
|
|
99
|
+
*/
|
|
100
|
+
execute(request, requestOptions) {
|
|
101
|
+
return core.HttpResponsePromise.fromPromise(this.__execute(request, requestOptions));
|
|
102
|
+
}
|
|
103
|
+
__execute(request, requestOptions) {
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
106
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
107
|
+
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);
|
|
108
|
+
const _response = yield core.fetcher({
|
|
109
|
+
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"),
|
|
110
|
+
method: "POST",
|
|
111
|
+
headers: _headers,
|
|
112
|
+
contentType: "application/json",
|
|
113
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
114
|
+
requestType: "json",
|
|
115
|
+
body: request,
|
|
116
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null
|
|
117
|
+
? requestOptions.timeoutInSeconds * 1000
|
|
118
|
+
: ((_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) != null
|
|
119
|
+
? ((_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) * 1000
|
|
120
|
+
: undefined,
|
|
121
|
+
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,
|
|
122
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
123
|
+
fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
|
|
124
|
+
logging: this._options.logging,
|
|
125
|
+
});
|
|
126
|
+
if (_response.ok) {
|
|
127
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
128
|
+
}
|
|
129
|
+
if (_response.error.reason === "status-code") {
|
|
130
|
+
switch (_response.error.statusCode) {
|
|
131
|
+
case 400:
|
|
132
|
+
throw new Pulse.BadRequestError(_response.error.body, _response.rawResponse);
|
|
133
|
+
case 401:
|
|
134
|
+
throw new Pulse.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
135
|
+
case 403:
|
|
136
|
+
throw new Pulse.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
137
|
+
case 429:
|
|
138
|
+
throw new Pulse.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
139
|
+
default:
|
|
140
|
+
throw new errors.PulseError({
|
|
141
|
+
statusCode: _response.error.statusCode,
|
|
142
|
+
body: _response.error.body,
|
|
143
|
+
rawResponse: _response.rawResponse,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/pipeline/execute");
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
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);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../core/index.js";
|
|
4
|
+
import * as Pulse from "../../../index.js";
|
|
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,116 @@
|
|
|
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.ResultsClient = 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 ResultsClient {
|
|
55
|
+
constructor(options = {}) {
|
|
56
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Download the PDF binary produced by a `/form/detect`,
|
|
60
|
+
* `/form/fill`, or `/form/clear` job. The `pdf_url` field on a
|
|
61
|
+
* `FormResult` points at this endpoint — you can hand it
|
|
62
|
+
* directly to a browser, embed it in an `<iframe>`, or fetch the
|
|
63
|
+
* bytes from a backend.
|
|
64
|
+
*
|
|
65
|
+
* Returns `404` for non-form jobs (no PDF was produced) and for
|
|
66
|
+
* form jobs whose PDF artifact is no longer available.
|
|
67
|
+
* @throws {@link Pulse.NotFoundError}
|
|
68
|
+
* @throws {@link Pulse.InternalServerError}
|
|
69
|
+
*/
|
|
70
|
+
getPdf(request, requestOptions) {
|
|
71
|
+
return core.HttpResponsePromise.fromPromise(this.__getPdf(request, requestOptions));
|
|
72
|
+
}
|
|
73
|
+
__getPdf(request, requestOptions) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
76
|
+
const { jobId } = request;
|
|
77
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
78
|
+
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);
|
|
79
|
+
const _response = yield core.fetcher({
|
|
80
|
+
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`),
|
|
81
|
+
method: "GET",
|
|
82
|
+
headers: _headers,
|
|
83
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
84
|
+
responseType: "binary-response",
|
|
85
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null
|
|
86
|
+
? requestOptions.timeoutInSeconds * 1000
|
|
87
|
+
: ((_d = this._options) === null || _d === void 0 ? void 0 : _d.timeoutInSeconds) != null
|
|
88
|
+
? ((_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) * 1000
|
|
89
|
+
: undefined,
|
|
90
|
+
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,
|
|
91
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
92
|
+
fetchFn: (_h = this._options) === null || _h === void 0 ? void 0 : _h.fetch,
|
|
93
|
+
logging: this._options.logging,
|
|
94
|
+
});
|
|
95
|
+
if (_response.ok) {
|
|
96
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
97
|
+
}
|
|
98
|
+
if (_response.error.reason === "status-code") {
|
|
99
|
+
switch (_response.error.statusCode) {
|
|
100
|
+
case 404:
|
|
101
|
+
throw new Pulse.NotFoundError(_response.error.body, _response.rawResponse);
|
|
102
|
+
case 500:
|
|
103
|
+
throw new Pulse.InternalServerError(_response.error.body, _response.rawResponse);
|
|
104
|
+
default:
|
|
105
|
+
throw new errors.PulseError({
|
|
106
|
+
statusCode: _response.error.statusCode,
|
|
107
|
+
body: _response.error.body,
|
|
108
|
+
rawResponse: _response.rawResponse,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/results/{jobId}/pdf");
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.ResultsClient = ResultsClient;
|
|
@@ -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);
|