@aws-sdk/client-textract 3.179.0 → 3.181.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 +20 -0
- package/dist-cjs/protocols/Aws_json1_1.js +16 -10
- package/dist-es/protocols/Aws_json1_1.js +23 -10
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.181.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.180.0...v3.181.0) (2022-09-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **clients:** make parseErrorBody async ([#3999](https://github.com/aws/aws-sdk-js-v3/issues/3999)) ([2558c93](https://github.com/aws/aws-sdk-js-v3/commit/2558c93c050357ac6dc47aa0452b15b12ebfd676))
|
|
12
|
+
* **clients:** populate message field when parsing errors ([#3995](https://github.com/aws/aws-sdk-js-v3/issues/3995)) ([02e47f1](https://github.com/aws/aws-sdk-js-v3/commit/02e47f14397ae0a5d2e2883350d038b307fdcdb4))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# [3.180.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.179.0...v3.180.0) (2022-09-27)
|
|
19
|
+
|
|
20
|
+
**Note:** Version bump only for package @aws-sdk/client-textract
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
# [3.179.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.178.0...v3.179.0) (2022-09-26)
|
|
7
27
|
|
|
8
28
|
**Note:** Version bump only for package @aws-sdk/client-textract
|
|
@@ -122,7 +122,7 @@ exports.deserializeAws_json1_1AnalyzeDocumentCommand = deserializeAws_json1_1Ana
|
|
|
122
122
|
const deserializeAws_json1_1AnalyzeDocumentCommandError = async (output, context) => {
|
|
123
123
|
const parsedOutput = {
|
|
124
124
|
...output,
|
|
125
|
-
body: await
|
|
125
|
+
body: await parseErrorBody(output.body, context),
|
|
126
126
|
};
|
|
127
127
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
128
128
|
switch (errorCode) {
|
|
@@ -183,7 +183,7 @@ exports.deserializeAws_json1_1AnalyzeExpenseCommand = deserializeAws_json1_1Anal
|
|
|
183
183
|
const deserializeAws_json1_1AnalyzeExpenseCommandError = async (output, context) => {
|
|
184
184
|
const parsedOutput = {
|
|
185
185
|
...output,
|
|
186
|
-
body: await
|
|
186
|
+
body: await parseErrorBody(output.body, context),
|
|
187
187
|
};
|
|
188
188
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
189
189
|
switch (errorCode) {
|
|
@@ -241,7 +241,7 @@ exports.deserializeAws_json1_1AnalyzeIDCommand = deserializeAws_json1_1AnalyzeID
|
|
|
241
241
|
const deserializeAws_json1_1AnalyzeIDCommandError = async (output, context) => {
|
|
242
242
|
const parsedOutput = {
|
|
243
243
|
...output,
|
|
244
|
-
body: await
|
|
244
|
+
body: await parseErrorBody(output.body, context),
|
|
245
245
|
};
|
|
246
246
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
247
247
|
switch (errorCode) {
|
|
@@ -299,7 +299,7 @@ exports.deserializeAws_json1_1DetectDocumentTextCommand = deserializeAws_json1_1
|
|
|
299
299
|
const deserializeAws_json1_1DetectDocumentTextCommandError = async (output, context) => {
|
|
300
300
|
const parsedOutput = {
|
|
301
301
|
...output,
|
|
302
|
-
body: await
|
|
302
|
+
body: await parseErrorBody(output.body, context),
|
|
303
303
|
};
|
|
304
304
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
305
305
|
switch (errorCode) {
|
|
@@ -357,7 +357,7 @@ exports.deserializeAws_json1_1GetDocumentAnalysisCommand = deserializeAws_json1_
|
|
|
357
357
|
const deserializeAws_json1_1GetDocumentAnalysisCommandError = async (output, context) => {
|
|
358
358
|
const parsedOutput = {
|
|
359
359
|
...output,
|
|
360
|
-
body: await
|
|
360
|
+
body: await parseErrorBody(output.body, context),
|
|
361
361
|
};
|
|
362
362
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
363
363
|
switch (errorCode) {
|
|
@@ -412,7 +412,7 @@ exports.deserializeAws_json1_1GetDocumentTextDetectionCommand = deserializeAws_j
|
|
|
412
412
|
const deserializeAws_json1_1GetDocumentTextDetectionCommandError = async (output, context) => {
|
|
413
413
|
const parsedOutput = {
|
|
414
414
|
...output,
|
|
415
|
-
body: await
|
|
415
|
+
body: await parseErrorBody(output.body, context),
|
|
416
416
|
};
|
|
417
417
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
418
418
|
switch (errorCode) {
|
|
@@ -467,7 +467,7 @@ exports.deserializeAws_json1_1GetExpenseAnalysisCommand = deserializeAws_json1_1
|
|
|
467
467
|
const deserializeAws_json1_1GetExpenseAnalysisCommandError = async (output, context) => {
|
|
468
468
|
const parsedOutput = {
|
|
469
469
|
...output,
|
|
470
|
-
body: await
|
|
470
|
+
body: await parseErrorBody(output.body, context),
|
|
471
471
|
};
|
|
472
472
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
473
473
|
switch (errorCode) {
|
|
@@ -522,7 +522,7 @@ exports.deserializeAws_json1_1StartDocumentAnalysisCommand = deserializeAws_json
|
|
|
522
522
|
const deserializeAws_json1_1StartDocumentAnalysisCommandError = async (output, context) => {
|
|
523
523
|
const parsedOutput = {
|
|
524
524
|
...output,
|
|
525
|
-
body: await
|
|
525
|
+
body: await parseErrorBody(output.body, context),
|
|
526
526
|
};
|
|
527
527
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
528
528
|
switch (errorCode) {
|
|
@@ -589,7 +589,7 @@ exports.deserializeAws_json1_1StartDocumentTextDetectionCommand = deserializeAws
|
|
|
589
589
|
const deserializeAws_json1_1StartDocumentTextDetectionCommandError = async (output, context) => {
|
|
590
590
|
const parsedOutput = {
|
|
591
591
|
...output,
|
|
592
|
-
body: await
|
|
592
|
+
body: await parseErrorBody(output.body, context),
|
|
593
593
|
};
|
|
594
594
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
595
595
|
switch (errorCode) {
|
|
@@ -656,7 +656,7 @@ exports.deserializeAws_json1_1StartExpenseAnalysisCommand = deserializeAws_json1
|
|
|
656
656
|
const deserializeAws_json1_1StartExpenseAnalysisCommandError = async (output, context) => {
|
|
657
657
|
const parsedOutput = {
|
|
658
658
|
...output,
|
|
659
|
-
body: await
|
|
659
|
+
body: await parseErrorBody(output.body, context),
|
|
660
660
|
};
|
|
661
661
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
662
662
|
switch (errorCode) {
|
|
@@ -1563,6 +1563,12 @@ const parseBody = (streamBody, context) => collectBodyString(streamBody, context
|
|
|
1563
1563
|
}
|
|
1564
1564
|
return {};
|
|
1565
1565
|
});
|
|
1566
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
1567
|
+
var _a;
|
|
1568
|
+
const value = await parseBody(errorBody, context);
|
|
1569
|
+
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
1570
|
+
return value;
|
|
1571
|
+
};
|
|
1566
1572
|
const loadRestJsonErrorCode = (output, data) => {
|
|
1567
1573
|
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
1568
1574
|
const sanitizeErrorCode = (rawValue) => {
|
|
@@ -139,7 +139,7 @@ var deserializeAws_json1_1AnalyzeDocumentCommandError = function (output, contex
|
|
|
139
139
|
case 0:
|
|
140
140
|
_a = [__assign({}, output)];
|
|
141
141
|
_c = {};
|
|
142
|
-
return [4,
|
|
142
|
+
return [4, parseErrorBody(output.body, context)];
|
|
143
143
|
case 1:
|
|
144
144
|
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
145
145
|
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
@@ -226,7 +226,7 @@ var deserializeAws_json1_1AnalyzeExpenseCommandError = function (output, context
|
|
|
226
226
|
case 0:
|
|
227
227
|
_a = [__assign({}, output)];
|
|
228
228
|
_c = {};
|
|
229
|
-
return [4,
|
|
229
|
+
return [4, parseErrorBody(output.body, context)];
|
|
230
230
|
case 1:
|
|
231
231
|
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
232
232
|
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
@@ -309,7 +309,7 @@ var deserializeAws_json1_1AnalyzeIDCommandError = function (output, context) { r
|
|
|
309
309
|
case 0:
|
|
310
310
|
_a = [__assign({}, output)];
|
|
311
311
|
_c = {};
|
|
312
|
-
return [4,
|
|
312
|
+
return [4, parseErrorBody(output.body, context)];
|
|
313
313
|
case 1:
|
|
314
314
|
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
315
315
|
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
@@ -392,7 +392,7 @@ var deserializeAws_json1_1DetectDocumentTextCommandError = function (output, con
|
|
|
392
392
|
case 0:
|
|
393
393
|
_a = [__assign({}, output)];
|
|
394
394
|
_c = {};
|
|
395
|
-
return [4,
|
|
395
|
+
return [4, parseErrorBody(output.body, context)];
|
|
396
396
|
case 1:
|
|
397
397
|
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
398
398
|
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
@@ -475,7 +475,7 @@ var deserializeAws_json1_1GetDocumentAnalysisCommandError = function (output, co
|
|
|
475
475
|
case 0:
|
|
476
476
|
_a = [__assign({}, output)];
|
|
477
477
|
_c = {};
|
|
478
|
-
return [4,
|
|
478
|
+
return [4, parseErrorBody(output.body, context)];
|
|
479
479
|
case 1:
|
|
480
480
|
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
481
481
|
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
@@ -554,7 +554,7 @@ var deserializeAws_json1_1GetDocumentTextDetectionCommandError = function (outpu
|
|
|
554
554
|
case 0:
|
|
555
555
|
_a = [__assign({}, output)];
|
|
556
556
|
_c = {};
|
|
557
|
-
return [4,
|
|
557
|
+
return [4, parseErrorBody(output.body, context)];
|
|
558
558
|
case 1:
|
|
559
559
|
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
560
560
|
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
@@ -633,7 +633,7 @@ var deserializeAws_json1_1GetExpenseAnalysisCommandError = function (output, con
|
|
|
633
633
|
case 0:
|
|
634
634
|
_a = [__assign({}, output)];
|
|
635
635
|
_c = {};
|
|
636
|
-
return [4,
|
|
636
|
+
return [4, parseErrorBody(output.body, context)];
|
|
637
637
|
case 1:
|
|
638
638
|
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
639
639
|
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
@@ -712,7 +712,7 @@ var deserializeAws_json1_1StartDocumentAnalysisCommandError = function (output,
|
|
|
712
712
|
case 0:
|
|
713
713
|
_a = [__assign({}, output)];
|
|
714
714
|
_c = {};
|
|
715
|
-
return [4,
|
|
715
|
+
return [4, parseErrorBody(output.body, context)];
|
|
716
716
|
case 1:
|
|
717
717
|
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
718
718
|
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
@@ -807,7 +807,7 @@ var deserializeAws_json1_1StartDocumentTextDetectionCommandError = function (out
|
|
|
807
807
|
case 0:
|
|
808
808
|
_a = [__assign({}, output)];
|
|
809
809
|
_c = {};
|
|
810
|
-
return [4,
|
|
810
|
+
return [4, parseErrorBody(output.body, context)];
|
|
811
811
|
case 1:
|
|
812
812
|
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
813
813
|
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
@@ -902,7 +902,7 @@ var deserializeAws_json1_1StartExpenseAnalysisCommandError = function (output, c
|
|
|
902
902
|
case 0:
|
|
903
903
|
_a = [__assign({}, output)];
|
|
904
904
|
_c = {};
|
|
905
|
-
return [4,
|
|
905
|
+
return [4, parseErrorBody(output.body, context)];
|
|
906
906
|
case 1:
|
|
907
907
|
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
908
908
|
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
@@ -1767,6 +1767,19 @@ var parseBody = function (streamBody, context) {
|
|
|
1767
1767
|
return {};
|
|
1768
1768
|
});
|
|
1769
1769
|
};
|
|
1770
|
+
var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1771
|
+
var value;
|
|
1772
|
+
var _a;
|
|
1773
|
+
return __generator(this, function (_b) {
|
|
1774
|
+
switch (_b.label) {
|
|
1775
|
+
case 0: return [4, parseBody(errorBody, context)];
|
|
1776
|
+
case 1:
|
|
1777
|
+
value = _b.sent();
|
|
1778
|
+
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
1779
|
+
return [2, value];
|
|
1780
|
+
}
|
|
1781
|
+
});
|
|
1782
|
+
}); };
|
|
1770
1783
|
var loadRestJsonErrorCode = function (output, data) {
|
|
1771
1784
|
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
1772
1785
|
var sanitizeErrorCode = function (rawValue) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-textract",
|
|
3
3
|
"description": "AWS SDK for JavaScript Textract Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.181.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
7
7
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@aws-crypto/sha256-browser": "2.0.0",
|
|
21
21
|
"@aws-crypto/sha256-js": "2.0.0",
|
|
22
|
-
"@aws-sdk/client-sts": "3.
|
|
22
|
+
"@aws-sdk/client-sts": "3.181.0",
|
|
23
23
|
"@aws-sdk/config-resolver": "3.178.0",
|
|
24
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
24
|
+
"@aws-sdk/credential-provider-node": "3.181.0",
|
|
25
25
|
"@aws-sdk/fetch-http-handler": "3.178.0",
|
|
26
26
|
"@aws-sdk/hash-node": "3.178.0",
|
|
27
27
|
"@aws-sdk/invalid-dependency": "3.178.0",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"@aws-sdk/node-config-provider": "3.178.0",
|
|
38
38
|
"@aws-sdk/node-http-handler": "3.178.0",
|
|
39
39
|
"@aws-sdk/protocol-http": "3.178.0",
|
|
40
|
-
"@aws-sdk/smithy-client": "3.
|
|
40
|
+
"@aws-sdk/smithy-client": "3.180.0",
|
|
41
41
|
"@aws-sdk/types": "3.178.0",
|
|
42
42
|
"@aws-sdk/url-parser": "3.178.0",
|
|
43
43
|
"@aws-sdk/util-base64-browser": "3.170.0",
|
|
44
44
|
"@aws-sdk/util-base64-node": "3.170.0",
|
|
45
45
|
"@aws-sdk/util-body-length-browser": "3.170.0",
|
|
46
46
|
"@aws-sdk/util-body-length-node": "3.170.0",
|
|
47
|
-
"@aws-sdk/util-defaults-mode-browser": "3.
|
|
48
|
-
"@aws-sdk/util-defaults-mode-node": "3.
|
|
47
|
+
"@aws-sdk/util-defaults-mode-browser": "3.180.0",
|
|
48
|
+
"@aws-sdk/util-defaults-mode-node": "3.180.0",
|
|
49
49
|
"@aws-sdk/util-user-agent-browser": "3.178.0",
|
|
50
50
|
"@aws-sdk/util-user-agent-node": "3.178.0",
|
|
51
51
|
"@aws-sdk/util-utf8-browser": "3.170.0",
|