@aws-sdk/client-textract 3.42.0 → 3.47.0
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/CHANGELOG.md +50 -0
- package/dist-cjs/Textract.js +15 -0
- package/dist-cjs/commands/AnalyzeIDCommand.js +36 -0
- package/dist-cjs/commands/index.js +1 -0
- package/dist-cjs/endpoints.js +1 -28
- package/dist-cjs/models/models_0.js +42 -86
- package/dist-cjs/protocols/Aws_json1_1.js +204 -1
- package/dist-cjs/runtimeConfig.browser.js +7 -2
- package/dist-cjs/runtimeConfig.js +9 -3
- package/dist-es/Textract.js +15 -0
- package/dist-es/commands/AnalyzeIDCommand.js +39 -0
- package/dist-es/commands/index.js +1 -0
- package/dist-es/endpoints.js +1 -28
- package/dist-es/models/models_0.js +28 -56
- package/dist-es/protocols/Aws_json1_1.js +211 -0
- package/dist-es/runtimeConfig.browser.js +12 -3
- package/dist-es/runtimeConfig.js +13 -6
- package/dist-types/Textract.d.ts +11 -1
- package/dist-types/TextractClient.d.ts +8 -3
- package/dist-types/commands/AnalyzeExpenseCommand.d.ts +2 -1
- package/dist-types/commands/AnalyzeIDCommand.d.ts +37 -0
- package/dist-types/commands/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +123 -86
- package/dist-types/protocols/Aws_json1_1.d.ts +3 -0
- package/dist-types/runtimeConfig.browser.d.ts +3 -2
- package/dist-types/runtimeConfig.d.ts +4 -3
- package/dist-types/runtimeConfig.native.d.ts +1 -0
- package/dist-types/ts3.4/Textract.d.ts +5 -0
- package/dist-types/ts3.4/TextractClient.d.ts +6 -3
- package/dist-types/ts3.4/commands/AnalyzeIDCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +69 -56
- package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +3 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +3 -2
- package/dist-types/ts3.4/runtimeConfig.d.ts +4 -3
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -0
- package/package.json +38 -45
|
@@ -16,14 +16,17 @@ const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
|
|
|
16
16
|
const util_utf8_node_1 = require("@aws-sdk/util-utf8-node");
|
|
17
17
|
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
|
18
18
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
19
|
+
const util_defaults_mode_node_1 = require("@aws-sdk/util-defaults-mode-node");
|
|
19
20
|
const getRuntimeConfig = (config) => {
|
|
20
21
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
21
|
-
|
|
22
|
+
const defaultsMode = util_defaults_mode_node_1.resolveDefaultsModeConfig(config);
|
|
23
|
+
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
|
|
22
24
|
const clientSharedValues = runtimeConfig_shared_1.getRuntimeConfig(config);
|
|
23
25
|
return {
|
|
24
26
|
...clientSharedValues,
|
|
25
27
|
...config,
|
|
26
28
|
runtime: "node",
|
|
29
|
+
defaultsMode,
|
|
27
30
|
base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : util_base64_node_1.fromBase64,
|
|
28
31
|
base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : util_base64_node_1.toBase64,
|
|
29
32
|
bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : util_body_length_node_1.calculateBodyLength,
|
|
@@ -31,8 +34,11 @@ const getRuntimeConfig = (config) => {
|
|
|
31
34
|
defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : util_user_agent_node_1.defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
|
|
32
35
|
maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : node_config_provider_1.loadConfig(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
33
36
|
region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : node_config_provider_1.loadConfig(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS),
|
|
34
|
-
requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new node_http_handler_1.NodeHttpHandler(),
|
|
35
|
-
retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : node_config_provider_1.loadConfig(
|
|
37
|
+
requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new node_http_handler_1.NodeHttpHandler(defaultConfigProvider),
|
|
38
|
+
retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : node_config_provider_1.loadConfig({
|
|
39
|
+
...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
40
|
+
default: async () => (await defaultConfigProvider()).retryMode || middleware_retry_1.DEFAULT_RETRY_MODE,
|
|
41
|
+
}),
|
|
36
42
|
sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : hash_node_1.Hash.bind(null, "sha256"),
|
|
37
43
|
streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : node_http_handler_1.streamCollector,
|
|
38
44
|
useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : node_config_provider_1.loadConfig(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
|
package/dist-es/Textract.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __extends } from "tslib";
|
|
2
2
|
import { AnalyzeDocumentCommand, } from "./commands/AnalyzeDocumentCommand";
|
|
3
3
|
import { AnalyzeExpenseCommand, } from "./commands/AnalyzeExpenseCommand";
|
|
4
|
+
import { AnalyzeIDCommand } from "./commands/AnalyzeIDCommand";
|
|
4
5
|
import { DetectDocumentTextCommand, } from "./commands/DetectDocumentTextCommand";
|
|
5
6
|
import { GetDocumentAnalysisCommand, } from "./commands/GetDocumentAnalysisCommand";
|
|
6
7
|
import { GetDocumentTextDetectionCommand, } from "./commands/GetDocumentTextDetectionCommand";
|
|
@@ -42,6 +43,20 @@ var Textract = (function (_super) {
|
|
|
42
43
|
return this.send(command, optionsOrCb);
|
|
43
44
|
}
|
|
44
45
|
};
|
|
46
|
+
Textract.prototype.analyzeID = function (args, optionsOrCb, cb) {
|
|
47
|
+
var command = new AnalyzeIDCommand(args);
|
|
48
|
+
if (typeof optionsOrCb === "function") {
|
|
49
|
+
this.send(command, optionsOrCb);
|
|
50
|
+
}
|
|
51
|
+
else if (typeof cb === "function") {
|
|
52
|
+
if (typeof optionsOrCb !== "object")
|
|
53
|
+
throw new Error("Expect http options but get " + typeof optionsOrCb);
|
|
54
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
return this.send(command, optionsOrCb);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
45
60
|
Textract.prototype.detectDocumentText = function (args, optionsOrCb, cb) {
|
|
46
61
|
var command = new DetectDocumentTextCommand(args);
|
|
47
62
|
if (typeof optionsOrCb === "function") {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
4
|
+
import { AnalyzeIDRequest, AnalyzeIDResponse } from "../models/models_0";
|
|
5
|
+
import { deserializeAws_json1_1AnalyzeIDCommand, serializeAws_json1_1AnalyzeIDCommand } from "../protocols/Aws_json1_1";
|
|
6
|
+
var AnalyzeIDCommand = (function (_super) {
|
|
7
|
+
__extends(AnalyzeIDCommand, _super);
|
|
8
|
+
function AnalyzeIDCommand(input) {
|
|
9
|
+
var _this = _super.call(this) || this;
|
|
10
|
+
_this.input = input;
|
|
11
|
+
return _this;
|
|
12
|
+
}
|
|
13
|
+
AnalyzeIDCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
|
|
14
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
15
|
+
var stack = clientStack.concat(this.middlewareStack);
|
|
16
|
+
var logger = configuration.logger;
|
|
17
|
+
var clientName = "TextractClient";
|
|
18
|
+
var commandName = "AnalyzeIDCommand";
|
|
19
|
+
var handlerExecutionContext = {
|
|
20
|
+
logger: logger,
|
|
21
|
+
clientName: clientName,
|
|
22
|
+
commandName: commandName,
|
|
23
|
+
inputFilterSensitiveLog: AnalyzeIDRequest.filterSensitiveLog,
|
|
24
|
+
outputFilterSensitiveLog: AnalyzeIDResponse.filterSensitiveLog,
|
|
25
|
+
};
|
|
26
|
+
var requestHandler = configuration.requestHandler;
|
|
27
|
+
return stack.resolve(function (request) {
|
|
28
|
+
return requestHandler.handle(request.request, options || {});
|
|
29
|
+
}, handlerExecutionContext);
|
|
30
|
+
};
|
|
31
|
+
AnalyzeIDCommand.prototype.serialize = function (input, context) {
|
|
32
|
+
return serializeAws_json1_1AnalyzeIDCommand(input, context);
|
|
33
|
+
};
|
|
34
|
+
AnalyzeIDCommand.prototype.deserialize = function (output, context) {
|
|
35
|
+
return deserializeAws_json1_1AnalyzeIDCommand(output, context);
|
|
36
|
+
};
|
|
37
|
+
return AnalyzeIDCommand;
|
|
38
|
+
}($Command));
|
|
39
|
+
export { AnalyzeIDCommand };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./AnalyzeDocumentCommand";
|
|
2
2
|
export * from "./AnalyzeExpenseCommand";
|
|
3
|
+
export * from "./AnalyzeIDCommand";
|
|
3
4
|
export * from "./DetectDocumentTextCommand";
|
|
4
5
|
export * from "./GetDocumentAnalysisCommand";
|
|
5
6
|
export * from "./GetDocumentTextDetectionCommand";
|
package/dist-es/endpoints.js
CHANGED
|
@@ -3,10 +3,6 @@ import { getRegionInfo } from "@aws-sdk/config-resolver";
|
|
|
3
3
|
var regionHash = {
|
|
4
4
|
"ca-central-1": {
|
|
5
5
|
variants: [
|
|
6
|
-
{
|
|
7
|
-
hostname: "textract.ca-central-1.amazonaws.com",
|
|
8
|
-
tags: [],
|
|
9
|
-
},
|
|
10
6
|
{
|
|
11
7
|
hostname: "textract-fips.ca-central-1.amazonaws.com",
|
|
12
8
|
tags: ["fips"],
|
|
@@ -15,10 +11,6 @@ var regionHash = {
|
|
|
15
11
|
},
|
|
16
12
|
"us-east-1": {
|
|
17
13
|
variants: [
|
|
18
|
-
{
|
|
19
|
-
hostname: "textract.us-east-1.amazonaws.com",
|
|
20
|
-
tags: [],
|
|
21
|
-
},
|
|
22
14
|
{
|
|
23
15
|
hostname: "textract-fips.us-east-1.amazonaws.com",
|
|
24
16
|
tags: ["fips"],
|
|
@@ -27,10 +19,6 @@ var regionHash = {
|
|
|
27
19
|
},
|
|
28
20
|
"us-east-2": {
|
|
29
21
|
variants: [
|
|
30
|
-
{
|
|
31
|
-
hostname: "textract.us-east-2.amazonaws.com",
|
|
32
|
-
tags: [],
|
|
33
|
-
},
|
|
34
22
|
{
|
|
35
23
|
hostname: "textract-fips.us-east-2.amazonaws.com",
|
|
36
24
|
tags: ["fips"],
|
|
@@ -39,10 +27,6 @@ var regionHash = {
|
|
|
39
27
|
},
|
|
40
28
|
"us-gov-east-1": {
|
|
41
29
|
variants: [
|
|
42
|
-
{
|
|
43
|
-
hostname: "textract.us-gov-east-1.amazonaws.com",
|
|
44
|
-
tags: [],
|
|
45
|
-
},
|
|
46
30
|
{
|
|
47
31
|
hostname: "textract-fips.us-gov-east-1.amazonaws.com",
|
|
48
32
|
tags: ["fips"],
|
|
@@ -51,10 +35,6 @@ var regionHash = {
|
|
|
51
35
|
},
|
|
52
36
|
"us-gov-west-1": {
|
|
53
37
|
variants: [
|
|
54
|
-
{
|
|
55
|
-
hostname: "textract.us-gov-west-1.amazonaws.com",
|
|
56
|
-
tags: [],
|
|
57
|
-
},
|
|
58
38
|
{
|
|
59
39
|
hostname: "textract-fips.us-gov-west-1.amazonaws.com",
|
|
60
40
|
tags: ["fips"],
|
|
@@ -63,10 +43,6 @@ var regionHash = {
|
|
|
63
43
|
},
|
|
64
44
|
"us-west-1": {
|
|
65
45
|
variants: [
|
|
66
|
-
{
|
|
67
|
-
hostname: "textract.us-west-1.amazonaws.com",
|
|
68
|
-
tags: [],
|
|
69
|
-
},
|
|
70
46
|
{
|
|
71
47
|
hostname: "textract-fips.us-west-1.amazonaws.com",
|
|
72
48
|
tags: ["fips"],
|
|
@@ -75,10 +51,6 @@ var regionHash = {
|
|
|
75
51
|
},
|
|
76
52
|
"us-west-2": {
|
|
77
53
|
variants: [
|
|
78
|
-
{
|
|
79
|
-
hostname: "textract.us-west-2.amazonaws.com",
|
|
80
|
-
tags: [],
|
|
81
|
-
},
|
|
82
54
|
{
|
|
83
55
|
hostname: "textract-fips.us-west-2.amazonaws.com",
|
|
84
56
|
tags: ["fips"],
|
|
@@ -97,6 +69,7 @@ var partitionHash = {
|
|
|
97
69
|
"ap-south-1",
|
|
98
70
|
"ap-southeast-1",
|
|
99
71
|
"ap-southeast-2",
|
|
72
|
+
"ap-southeast-3",
|
|
100
73
|
"ca-central-1",
|
|
101
74
|
"eu-central-1",
|
|
102
75
|
"eu-north-1",
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
|
-
export var AccessDeniedException;
|
|
3
|
-
(function (AccessDeniedException) {
|
|
4
|
-
AccessDeniedException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
5
|
-
})(AccessDeniedException || (AccessDeniedException = {}));
|
|
6
2
|
export var S3Object;
|
|
7
3
|
(function (S3Object) {
|
|
8
4
|
S3Object.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -96,42 +92,6 @@ export var AnalyzeDocumentResponse;
|
|
|
96
92
|
(function (AnalyzeDocumentResponse) {
|
|
97
93
|
AnalyzeDocumentResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
98
94
|
})(AnalyzeDocumentResponse || (AnalyzeDocumentResponse = {}));
|
|
99
|
-
export var BadDocumentException;
|
|
100
|
-
(function (BadDocumentException) {
|
|
101
|
-
BadDocumentException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
102
|
-
})(BadDocumentException || (BadDocumentException = {}));
|
|
103
|
-
export var DocumentTooLargeException;
|
|
104
|
-
(function (DocumentTooLargeException) {
|
|
105
|
-
DocumentTooLargeException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
106
|
-
})(DocumentTooLargeException || (DocumentTooLargeException = {}));
|
|
107
|
-
export var HumanLoopQuotaExceededException;
|
|
108
|
-
(function (HumanLoopQuotaExceededException) {
|
|
109
|
-
HumanLoopQuotaExceededException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
110
|
-
})(HumanLoopQuotaExceededException || (HumanLoopQuotaExceededException = {}));
|
|
111
|
-
export var InternalServerError;
|
|
112
|
-
(function (InternalServerError) {
|
|
113
|
-
InternalServerError.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
114
|
-
})(InternalServerError || (InternalServerError = {}));
|
|
115
|
-
export var InvalidParameterException;
|
|
116
|
-
(function (InvalidParameterException) {
|
|
117
|
-
InvalidParameterException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
118
|
-
})(InvalidParameterException || (InvalidParameterException = {}));
|
|
119
|
-
export var InvalidS3ObjectException;
|
|
120
|
-
(function (InvalidS3ObjectException) {
|
|
121
|
-
InvalidS3ObjectException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
122
|
-
})(InvalidS3ObjectException || (InvalidS3ObjectException = {}));
|
|
123
|
-
export var ProvisionedThroughputExceededException;
|
|
124
|
-
(function (ProvisionedThroughputExceededException) {
|
|
125
|
-
ProvisionedThroughputExceededException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
126
|
-
})(ProvisionedThroughputExceededException || (ProvisionedThroughputExceededException = {}));
|
|
127
|
-
export var ThrottlingException;
|
|
128
|
-
(function (ThrottlingException) {
|
|
129
|
-
ThrottlingException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
130
|
-
})(ThrottlingException || (ThrottlingException = {}));
|
|
131
|
-
export var UnsupportedDocumentException;
|
|
132
|
-
(function (UnsupportedDocumentException) {
|
|
133
|
-
UnsupportedDocumentException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
134
|
-
})(UnsupportedDocumentException || (UnsupportedDocumentException = {}));
|
|
135
95
|
export var AnalyzeExpenseRequest;
|
|
136
96
|
(function (AnalyzeExpenseRequest) {
|
|
137
97
|
AnalyzeExpenseRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -164,6 +124,34 @@ export var AnalyzeExpenseResponse;
|
|
|
164
124
|
(function (AnalyzeExpenseResponse) {
|
|
165
125
|
AnalyzeExpenseResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
166
126
|
})(AnalyzeExpenseResponse || (AnalyzeExpenseResponse = {}));
|
|
127
|
+
export var AnalyzeIDRequest;
|
|
128
|
+
(function (AnalyzeIDRequest) {
|
|
129
|
+
AnalyzeIDRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
130
|
+
})(AnalyzeIDRequest || (AnalyzeIDRequest = {}));
|
|
131
|
+
export var ValueType;
|
|
132
|
+
(function (ValueType) {
|
|
133
|
+
ValueType["DATE"] = "DATE";
|
|
134
|
+
})(ValueType || (ValueType = {}));
|
|
135
|
+
export var NormalizedValue;
|
|
136
|
+
(function (NormalizedValue) {
|
|
137
|
+
NormalizedValue.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
138
|
+
})(NormalizedValue || (NormalizedValue = {}));
|
|
139
|
+
export var AnalyzeIDDetections;
|
|
140
|
+
(function (AnalyzeIDDetections) {
|
|
141
|
+
AnalyzeIDDetections.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
142
|
+
})(AnalyzeIDDetections || (AnalyzeIDDetections = {}));
|
|
143
|
+
export var IdentityDocumentField;
|
|
144
|
+
(function (IdentityDocumentField) {
|
|
145
|
+
IdentityDocumentField.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
146
|
+
})(IdentityDocumentField || (IdentityDocumentField = {}));
|
|
147
|
+
export var IdentityDocument;
|
|
148
|
+
(function (IdentityDocument) {
|
|
149
|
+
IdentityDocument.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
150
|
+
})(IdentityDocument || (IdentityDocument = {}));
|
|
151
|
+
export var AnalyzeIDResponse;
|
|
152
|
+
(function (AnalyzeIDResponse) {
|
|
153
|
+
AnalyzeIDResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
154
|
+
})(AnalyzeIDResponse || (AnalyzeIDResponse = {}));
|
|
167
155
|
export var DetectDocumentTextRequest;
|
|
168
156
|
(function (DetectDocumentTextRequest) {
|
|
169
157
|
DetectDocumentTextRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -195,14 +183,6 @@ export var GetDocumentAnalysisResponse;
|
|
|
195
183
|
(function (GetDocumentAnalysisResponse) {
|
|
196
184
|
GetDocumentAnalysisResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
197
185
|
})(GetDocumentAnalysisResponse || (GetDocumentAnalysisResponse = {}));
|
|
198
|
-
export var InvalidJobIdException;
|
|
199
|
-
(function (InvalidJobIdException) {
|
|
200
|
-
InvalidJobIdException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
201
|
-
})(InvalidJobIdException || (InvalidJobIdException = {}));
|
|
202
|
-
export var InvalidKMSKeyException;
|
|
203
|
-
(function (InvalidKMSKeyException) {
|
|
204
|
-
InvalidKMSKeyException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
205
|
-
})(InvalidKMSKeyException || (InvalidKMSKeyException = {}));
|
|
206
186
|
export var GetDocumentTextDetectionRequest;
|
|
207
187
|
(function (GetDocumentTextDetectionRequest) {
|
|
208
188
|
GetDocumentTextDetectionRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -219,14 +199,6 @@ export var GetExpenseAnalysisResponse;
|
|
|
219
199
|
(function (GetExpenseAnalysisResponse) {
|
|
220
200
|
GetExpenseAnalysisResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
221
201
|
})(GetExpenseAnalysisResponse || (GetExpenseAnalysisResponse = {}));
|
|
222
|
-
export var IdempotentParameterMismatchException;
|
|
223
|
-
(function (IdempotentParameterMismatchException) {
|
|
224
|
-
IdempotentParameterMismatchException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
225
|
-
})(IdempotentParameterMismatchException || (IdempotentParameterMismatchException = {}));
|
|
226
|
-
export var LimitExceededException;
|
|
227
|
-
(function (LimitExceededException) {
|
|
228
|
-
LimitExceededException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
229
|
-
})(LimitExceededException || (LimitExceededException = {}));
|
|
230
202
|
export var NotificationChannel;
|
|
231
203
|
(function (NotificationChannel) {
|
|
232
204
|
NotificationChannel.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -23,6 +23,17 @@ export var serializeAws_json1_1AnalyzeExpenseCommand = function (input, context)
|
|
|
23
23
|
return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
|
|
24
24
|
});
|
|
25
25
|
}); };
|
|
26
|
+
export var serializeAws_json1_1AnalyzeIDCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
27
|
+
var headers, body;
|
|
28
|
+
return __generator(this, function (_a) {
|
|
29
|
+
headers = {
|
|
30
|
+
"content-type": "application/x-amz-json-1.1",
|
|
31
|
+
"x-amz-target": "Textract.AnalyzeID",
|
|
32
|
+
};
|
|
33
|
+
body = JSON.stringify(serializeAws_json1_1AnalyzeIDRequest(input, context));
|
|
34
|
+
return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
|
|
35
|
+
});
|
|
36
|
+
}); };
|
|
26
37
|
export var serializeAws_json1_1DetectDocumentTextCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
27
38
|
var headers, body;
|
|
28
39
|
return __generator(this, function (_a) {
|
|
@@ -348,6 +359,126 @@ var deserializeAws_json1_1AnalyzeExpenseCommandError = function (output, context
|
|
|
348
359
|
}
|
|
349
360
|
});
|
|
350
361
|
}); };
|
|
362
|
+
export var deserializeAws_json1_1AnalyzeIDCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
363
|
+
var data, contents, response;
|
|
364
|
+
return __generator(this, function (_a) {
|
|
365
|
+
switch (_a.label) {
|
|
366
|
+
case 0:
|
|
367
|
+
if (output.statusCode >= 300) {
|
|
368
|
+
return [2, deserializeAws_json1_1AnalyzeIDCommandError(output, context)];
|
|
369
|
+
}
|
|
370
|
+
return [4, parseBody(output.body, context)];
|
|
371
|
+
case 1:
|
|
372
|
+
data = _a.sent();
|
|
373
|
+
contents = {};
|
|
374
|
+
contents = deserializeAws_json1_1AnalyzeIDResponse(data, context);
|
|
375
|
+
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
376
|
+
return [2, Promise.resolve(response)];
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
}); };
|
|
380
|
+
var deserializeAws_json1_1AnalyzeIDCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
381
|
+
var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, parsedBody, message;
|
|
382
|
+
var _m;
|
|
383
|
+
return __generator(this, function (_o) {
|
|
384
|
+
switch (_o.label) {
|
|
385
|
+
case 0:
|
|
386
|
+
_a = [__assign({}, output)];
|
|
387
|
+
_m = {};
|
|
388
|
+
return [4, parseBody(output.body, context)];
|
|
389
|
+
case 1:
|
|
390
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_m.body = _o.sent(), _m)]));
|
|
391
|
+
errorCode = "UnknownError";
|
|
392
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
393
|
+
_b = errorCode;
|
|
394
|
+
switch (_b) {
|
|
395
|
+
case "AccessDeniedException": return [3, 2];
|
|
396
|
+
case "com.amazonaws.textract#AccessDeniedException": return [3, 2];
|
|
397
|
+
case "BadDocumentException": return [3, 4];
|
|
398
|
+
case "com.amazonaws.textract#BadDocumentException": return [3, 4];
|
|
399
|
+
case "DocumentTooLargeException": return [3, 6];
|
|
400
|
+
case "com.amazonaws.textract#DocumentTooLargeException": return [3, 6];
|
|
401
|
+
case "InternalServerError": return [3, 8];
|
|
402
|
+
case "com.amazonaws.textract#InternalServerError": return [3, 8];
|
|
403
|
+
case "InvalidParameterException": return [3, 10];
|
|
404
|
+
case "com.amazonaws.textract#InvalidParameterException": return [3, 10];
|
|
405
|
+
case "InvalidS3ObjectException": return [3, 12];
|
|
406
|
+
case "com.amazonaws.textract#InvalidS3ObjectException": return [3, 12];
|
|
407
|
+
case "ProvisionedThroughputExceededException": return [3, 14];
|
|
408
|
+
case "com.amazonaws.textract#ProvisionedThroughputExceededException": return [3, 14];
|
|
409
|
+
case "ThrottlingException": return [3, 16];
|
|
410
|
+
case "com.amazonaws.textract#ThrottlingException": return [3, 16];
|
|
411
|
+
case "UnsupportedDocumentException": return [3, 18];
|
|
412
|
+
case "com.amazonaws.textract#UnsupportedDocumentException": return [3, 18];
|
|
413
|
+
}
|
|
414
|
+
return [3, 20];
|
|
415
|
+
case 2:
|
|
416
|
+
_c = [{}];
|
|
417
|
+
return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
418
|
+
case 3:
|
|
419
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
420
|
+
return [3, 21];
|
|
421
|
+
case 4:
|
|
422
|
+
_d = [{}];
|
|
423
|
+
return [4, deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context)];
|
|
424
|
+
case 5:
|
|
425
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
426
|
+
return [3, 21];
|
|
427
|
+
case 6:
|
|
428
|
+
_e = [{}];
|
|
429
|
+
return [4, deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context)];
|
|
430
|
+
case 7:
|
|
431
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
432
|
+
return [3, 21];
|
|
433
|
+
case 8:
|
|
434
|
+
_f = [{}];
|
|
435
|
+
return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
|
|
436
|
+
case 9:
|
|
437
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
438
|
+
return [3, 21];
|
|
439
|
+
case 10:
|
|
440
|
+
_g = [{}];
|
|
441
|
+
return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
|
|
442
|
+
case 11:
|
|
443
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
444
|
+
return [3, 21];
|
|
445
|
+
case 12:
|
|
446
|
+
_h = [{}];
|
|
447
|
+
return [4, deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)];
|
|
448
|
+
case 13:
|
|
449
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
450
|
+
return [3, 21];
|
|
451
|
+
case 14:
|
|
452
|
+
_j = [{}];
|
|
453
|
+
return [4, deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)];
|
|
454
|
+
case 15:
|
|
455
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
456
|
+
return [3, 21];
|
|
457
|
+
case 16:
|
|
458
|
+
_k = [{}];
|
|
459
|
+
return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
460
|
+
case 17:
|
|
461
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _k.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
462
|
+
return [3, 21];
|
|
463
|
+
case 18:
|
|
464
|
+
_l = [{}];
|
|
465
|
+
return [4, deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context)];
|
|
466
|
+
case 19:
|
|
467
|
+
response = __assign.apply(void 0, [__assign.apply(void 0, _l.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
|
|
468
|
+
return [3, 21];
|
|
469
|
+
case 20:
|
|
470
|
+
parsedBody = parsedOutput.body;
|
|
471
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
472
|
+
response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
|
|
473
|
+
_o.label = 21;
|
|
474
|
+
case 21:
|
|
475
|
+
message = response.message || response.Message || errorCode;
|
|
476
|
+
response.message = message;
|
|
477
|
+
delete response.Message;
|
|
478
|
+
return [2, Promise.reject(Object.assign(new Error(message), response))];
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
}); };
|
|
351
482
|
export var deserializeAws_json1_1DetectDocumentTextCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
352
483
|
var data, contents, response;
|
|
353
484
|
return __generator(this, function (_a) {
|
|
@@ -1374,6 +1505,12 @@ var serializeAws_json1_1AnalyzeExpenseRequest = function (input, context) {
|
|
|
1374
1505
|
return __assign({}, (input.Document !== undefined &&
|
|
1375
1506
|
input.Document !== null && { Document: serializeAws_json1_1Document(input.Document, context) }));
|
|
1376
1507
|
};
|
|
1508
|
+
var serializeAws_json1_1AnalyzeIDRequest = function (input, context) {
|
|
1509
|
+
return __assign({}, (input.DocumentPages !== undefined &&
|
|
1510
|
+
input.DocumentPages !== null && {
|
|
1511
|
+
DocumentPages: serializeAws_json1_1DocumentPages(input.DocumentPages, context),
|
|
1512
|
+
}));
|
|
1513
|
+
};
|
|
1377
1514
|
var serializeAws_json1_1ContentClassifiers = function (input, context) {
|
|
1378
1515
|
return input
|
|
1379
1516
|
.filter(function (e) { return e != null; })
|
|
@@ -1396,6 +1533,16 @@ var serializeAws_json1_1DocumentLocation = function (input, context) {
|
|
|
1396
1533
|
return __assign({}, (input.S3Object !== undefined &&
|
|
1397
1534
|
input.S3Object !== null && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }));
|
|
1398
1535
|
};
|
|
1536
|
+
var serializeAws_json1_1DocumentPages = function (input, context) {
|
|
1537
|
+
return input
|
|
1538
|
+
.filter(function (e) { return e != null; })
|
|
1539
|
+
.map(function (entry) {
|
|
1540
|
+
if (entry === null) {
|
|
1541
|
+
return null;
|
|
1542
|
+
}
|
|
1543
|
+
return serializeAws_json1_1Document(entry, context);
|
|
1544
|
+
});
|
|
1545
|
+
};
|
|
1399
1546
|
var serializeAws_json1_1FeatureTypes = function (input, context) {
|
|
1400
1547
|
return input
|
|
1401
1548
|
.filter(function (e) { return e != null; })
|
|
@@ -1501,6 +1648,26 @@ var deserializeAws_json1_1AnalyzeExpenseResponse = function (output, context) {
|
|
|
1501
1648
|
: undefined,
|
|
1502
1649
|
};
|
|
1503
1650
|
};
|
|
1651
|
+
var deserializeAws_json1_1AnalyzeIDDetections = function (output, context) {
|
|
1652
|
+
return {
|
|
1653
|
+
Confidence: __limitedParseFloat32(output.Confidence),
|
|
1654
|
+
NormalizedValue: output.NormalizedValue !== undefined && output.NormalizedValue !== null
|
|
1655
|
+
? deserializeAws_json1_1NormalizedValue(output.NormalizedValue, context)
|
|
1656
|
+
: undefined,
|
|
1657
|
+
Text: __expectString(output.Text),
|
|
1658
|
+
};
|
|
1659
|
+
};
|
|
1660
|
+
var deserializeAws_json1_1AnalyzeIDResponse = function (output, context) {
|
|
1661
|
+
return {
|
|
1662
|
+
AnalyzeIDModelVersion: __expectString(output.AnalyzeIDModelVersion),
|
|
1663
|
+
DocumentMetadata: output.DocumentMetadata !== undefined && output.DocumentMetadata !== null
|
|
1664
|
+
? deserializeAws_json1_1DocumentMetadata(output.DocumentMetadata, context)
|
|
1665
|
+
: undefined,
|
|
1666
|
+
IdentityDocuments: output.IdentityDocuments !== undefined && output.IdentityDocuments !== null
|
|
1667
|
+
? deserializeAws_json1_1IdentityDocumentList(output.IdentityDocuments, context)
|
|
1668
|
+
: undefined,
|
|
1669
|
+
};
|
|
1670
|
+
};
|
|
1504
1671
|
var deserializeAws_json1_1BadDocumentException = function (output, context) {
|
|
1505
1672
|
return {
|
|
1506
1673
|
Code: __expectString(output.Code),
|
|
@@ -1739,6 +1906,44 @@ var deserializeAws_json1_1IdempotentParameterMismatchException = function (outpu
|
|
|
1739
1906
|
Message: __expectString(output.Message),
|
|
1740
1907
|
};
|
|
1741
1908
|
};
|
|
1909
|
+
var deserializeAws_json1_1IdentityDocument = function (output, context) {
|
|
1910
|
+
return {
|
|
1911
|
+
DocumentIndex: __expectInt32(output.DocumentIndex),
|
|
1912
|
+
IdentityDocumentFields: output.IdentityDocumentFields !== undefined && output.IdentityDocumentFields !== null
|
|
1913
|
+
? deserializeAws_json1_1IdentityDocumentFieldList(output.IdentityDocumentFields, context)
|
|
1914
|
+
: undefined,
|
|
1915
|
+
};
|
|
1916
|
+
};
|
|
1917
|
+
var deserializeAws_json1_1IdentityDocumentField = function (output, context) {
|
|
1918
|
+
return {
|
|
1919
|
+
Type: output.Type !== undefined && output.Type !== null
|
|
1920
|
+
? deserializeAws_json1_1AnalyzeIDDetections(output.Type, context)
|
|
1921
|
+
: undefined,
|
|
1922
|
+
ValueDetection: output.ValueDetection !== undefined && output.ValueDetection !== null
|
|
1923
|
+
? deserializeAws_json1_1AnalyzeIDDetections(output.ValueDetection, context)
|
|
1924
|
+
: undefined,
|
|
1925
|
+
};
|
|
1926
|
+
};
|
|
1927
|
+
var deserializeAws_json1_1IdentityDocumentFieldList = function (output, context) {
|
|
1928
|
+
return (output || [])
|
|
1929
|
+
.filter(function (e) { return e != null; })
|
|
1930
|
+
.map(function (entry) {
|
|
1931
|
+
if (entry === null) {
|
|
1932
|
+
return null;
|
|
1933
|
+
}
|
|
1934
|
+
return deserializeAws_json1_1IdentityDocumentField(entry, context);
|
|
1935
|
+
});
|
|
1936
|
+
};
|
|
1937
|
+
var deserializeAws_json1_1IdentityDocumentList = function (output, context) {
|
|
1938
|
+
return (output || [])
|
|
1939
|
+
.filter(function (e) { return e != null; })
|
|
1940
|
+
.map(function (entry) {
|
|
1941
|
+
if (entry === null) {
|
|
1942
|
+
return null;
|
|
1943
|
+
}
|
|
1944
|
+
return deserializeAws_json1_1IdentityDocument(entry, context);
|
|
1945
|
+
});
|
|
1946
|
+
};
|
|
1742
1947
|
var deserializeAws_json1_1IdList = function (output, context) {
|
|
1743
1948
|
return (output || [])
|
|
1744
1949
|
.filter(function (e) { return e != null; })
|
|
@@ -1820,6 +2025,12 @@ var deserializeAws_json1_1LineItemList = function (output, context) {
|
|
|
1820
2025
|
return deserializeAws_json1_1LineItemFields(entry, context);
|
|
1821
2026
|
});
|
|
1822
2027
|
};
|
|
2028
|
+
var deserializeAws_json1_1NormalizedValue = function (output, context) {
|
|
2029
|
+
return {
|
|
2030
|
+
Value: __expectString(output.Value),
|
|
2031
|
+
ValueType: __expectString(output.ValueType),
|
|
2032
|
+
};
|
|
2033
|
+
};
|
|
1823
2034
|
var deserializeAws_json1_1Pages = function (output, context) {
|
|
1824
2035
|
return (output || [])
|
|
1825
2036
|
.filter(function (e) { return e != null; })
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
2
|
import packageInfo from "../package.json";
|
|
3
3
|
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
4
4
|
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@aws-sdk/config-resolver";
|
|
5
|
-
import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
|
|
5
|
+
import { FetchHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
|
|
6
6
|
import { invalidProvider } from "@aws-sdk/invalid-dependency";
|
|
7
7
|
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry";
|
|
8
8
|
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser";
|
|
@@ -10,8 +10,17 @@ import { calculateBodyLength } from "@aws-sdk/util-body-length-browser";
|
|
|
10
10
|
import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
|
|
11
11
|
import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
|
|
12
12
|
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
13
|
+
import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
|
|
14
|
+
import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-browser";
|
|
13
15
|
export var getRuntimeConfig = function (config) {
|
|
14
16
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
17
|
+
var defaultsMode = resolveDefaultsModeConfig(config);
|
|
18
|
+
var defaultConfigProvider = function () { return defaultsMode().then(loadConfigsForDefaultMode); };
|
|
15
19
|
var clientSharedValues = getSharedRuntimeConfig(config);
|
|
16
|
-
return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "browser", base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : fromBase64, base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : toBase64, bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : calculateBodyLength, credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : (function (_) { return function () { return Promise.reject(new Error("Credential is missing")); }; }), defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : DEFAULT_MAX_ATTEMPTS, region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : invalidProvider("Region is missing"), requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new
|
|
20
|
+
return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "browser", defaultsMode: defaultsMode, base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : fromBase64, base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : toBase64, bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : calculateBodyLength, credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : (function (_) { return function () { return Promise.reject(new Error("Credential is missing")); }; }), defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : DEFAULT_MAX_ATTEMPTS, region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : invalidProvider("Region is missing"), requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new RequestHandler(defaultConfigProvider), retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : (function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
21
|
+
switch (_a.label) {
|
|
22
|
+
case 0: return [4, defaultConfigProvider()];
|
|
23
|
+
case 1: return [2, (_a.sent()).retryMode || DEFAULT_RETRY_MODE];
|
|
24
|
+
}
|
|
25
|
+
}); }); }), sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : Sha256, streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : streamCollector, useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : (function () { return Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT); }), useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : (function () { return Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT); }), utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : fromUtf8, utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : toUtf8 });
|
|
17
26
|
};
|
package/dist-es/runtimeConfig.js
CHANGED
|
@@ -1,21 +1,28 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
2
|
import packageInfo from "../package.json";
|
|
3
3
|
import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
|
|
4
4
|
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@aws-sdk/config-resolver";
|
|
5
5
|
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
|
|
6
6
|
import { Hash } from "@aws-sdk/hash-node";
|
|
7
|
-
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry";
|
|
7
|
+
import { DEFAULT_RETRY_MODE, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS, } from "@aws-sdk/middleware-retry";
|
|
8
8
|
import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider";
|
|
9
|
-
import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler";
|
|
9
|
+
import { NodeHttpHandler as RequestHandler, streamCollector } from "@aws-sdk/node-http-handler";
|
|
10
10
|
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node";
|
|
11
11
|
import { calculateBodyLength } from "@aws-sdk/util-body-length-node";
|
|
12
12
|
import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
|
|
13
13
|
import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node";
|
|
14
14
|
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
15
|
-
import {
|
|
15
|
+
import { loadConfigsForDefaultMode } from "@aws-sdk/smithy-client";
|
|
16
|
+
import { resolveDefaultsModeConfig } from "@aws-sdk/util-defaults-mode-node";
|
|
16
17
|
export var getRuntimeConfig = function (config) {
|
|
17
18
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
18
|
-
|
|
19
|
+
var defaultsMode = resolveDefaultsModeConfig(config);
|
|
20
|
+
var defaultConfigProvider = function () { return defaultsMode().then(loadConfigsForDefaultMode); };
|
|
19
21
|
var clientSharedValues = getSharedRuntimeConfig(config);
|
|
20
|
-
return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "node", base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : fromBase64, base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : toBase64, bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : calculateBodyLength, credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : decorateDefaultCredentialProvider(credentialDefaultProvider), defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new
|
|
22
|
+
return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "node", defaultsMode: defaultsMode, base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : fromBase64, base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : toBase64, bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : calculateBodyLength, credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : decorateDefaultCredentialProvider(credentialDefaultProvider), defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new RequestHandler(defaultConfigProvider), retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : loadNodeConfig(__assign(__assign({}, NODE_RETRY_MODE_CONFIG_OPTIONS), { default: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
23
|
+
switch (_a.label) {
|
|
24
|
+
case 0: return [4, defaultConfigProvider()];
|
|
25
|
+
case 1: return [2, (_a.sent()).retryMode || DEFAULT_RETRY_MODE];
|
|
26
|
+
}
|
|
27
|
+
}); }); } })), sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : Hash.bind(null, "sha256"), streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : streamCollector, useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : fromUtf8, utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : toUtf8 });
|
|
21
28
|
};
|