@aws-sdk/client-textract 3.38.0 → 3.42.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 +41 -0
- package/dist-cjs/Textract.js +30 -0
- package/dist-cjs/commands/GetExpenseAnalysisCommand.js +36 -0
- package/dist-cjs/commands/StartExpenseAnalysisCommand.js +36 -0
- package/dist-cjs/commands/index.js +2 -0
- package/dist-cjs/endpoints.js +156 -26
- package/dist-cjs/models/models_0.js +26 -2
- package/dist-cjs/protocols/Aws_json1_1.js +306 -1
- package/dist-cjs/runtimeConfig.browser.js +6 -3
- package/dist-cjs/runtimeConfig.js +5 -3
- package/dist-es/Textract.js +30 -0
- package/dist-es/commands/GetExpenseAnalysisCommand.js +39 -0
- package/dist-es/commands/StartExpenseAnalysisCommand.js +39 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/endpoints.js +156 -26
- package/dist-es/models/models_0.js +16 -0
- package/dist-es/protocols/Aws_json1_1.js +314 -0
- package/dist-es/runtimeConfig.browser.js +3 -2
- package/dist-es/runtimeConfig.js +3 -3
- package/dist-types/Textract.d.ts +47 -2
- package/dist-types/TextractClient.d.ts +12 -2
- package/dist-types/commands/AnalyzeDocumentCommand.d.ts +1 -1
- package/dist-types/commands/AnalyzeExpenseCommand.d.ts +1 -1
- package/dist-types/commands/DetectDocumentTextCommand.d.ts +1 -1
- package/dist-types/commands/GetDocumentAnalysisCommand.d.ts +1 -1
- package/dist-types/commands/GetDocumentTextDetectionCommand.d.ts +1 -1
- package/dist-types/commands/GetExpenseAnalysisCommand.d.ts +51 -0
- package/dist-types/commands/StartDocumentAnalysisCommand.d.ts +2 -2
- package/dist-types/commands/StartDocumentTextDetectionCommand.d.ts +2 -2
- package/dist-types/commands/StartExpenseAnalysisCommand.d.ts +50 -0
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/models/models_0.d.ts +123 -2
- package/dist-types/protocols/Aws_json1_1.d.ts +6 -0
- package/dist-types/runtimeConfig.browser.d.ts +2 -0
- package/dist-types/runtimeConfig.d.ts +2 -0
- package/dist-types/runtimeConfig.native.d.ts +2 -0
- package/dist-types/ts3.4/Textract.d.ts +10 -0
- package/dist-types/ts3.4/TextractClient.d.ts +8 -2
- package/dist-types/ts3.4/commands/GetExpenseAnalysisCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/StartExpenseAnalysisCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/index.d.ts +2 -0
- package/dist-types/ts3.4/models/models_0.d.ts +58 -0
- package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +6 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
- package/package.json +25 -25
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deserializeAws_json1_1StartDocumentTextDetectionCommand = exports.deserializeAws_json1_1StartDocumentAnalysisCommand = exports.deserializeAws_json1_1GetDocumentTextDetectionCommand = exports.deserializeAws_json1_1GetDocumentAnalysisCommand = exports.deserializeAws_json1_1DetectDocumentTextCommand = exports.deserializeAws_json1_1AnalyzeExpenseCommand = exports.deserializeAws_json1_1AnalyzeDocumentCommand = exports.serializeAws_json1_1StartDocumentTextDetectionCommand = exports.serializeAws_json1_1StartDocumentAnalysisCommand = exports.serializeAws_json1_1GetDocumentTextDetectionCommand = exports.serializeAws_json1_1GetDocumentAnalysisCommand = exports.serializeAws_json1_1DetectDocumentTextCommand = exports.serializeAws_json1_1AnalyzeExpenseCommand = exports.serializeAws_json1_1AnalyzeDocumentCommand = void 0;
|
|
3
|
+
exports.deserializeAws_json1_1StartExpenseAnalysisCommand = exports.deserializeAws_json1_1StartDocumentTextDetectionCommand = exports.deserializeAws_json1_1StartDocumentAnalysisCommand = exports.deserializeAws_json1_1GetExpenseAnalysisCommand = exports.deserializeAws_json1_1GetDocumentTextDetectionCommand = exports.deserializeAws_json1_1GetDocumentAnalysisCommand = exports.deserializeAws_json1_1DetectDocumentTextCommand = exports.deserializeAws_json1_1AnalyzeExpenseCommand = exports.deserializeAws_json1_1AnalyzeDocumentCommand = exports.serializeAws_json1_1StartExpenseAnalysisCommand = exports.serializeAws_json1_1StartDocumentTextDetectionCommand = exports.serializeAws_json1_1StartDocumentAnalysisCommand = exports.serializeAws_json1_1GetExpenseAnalysisCommand = exports.serializeAws_json1_1GetDocumentTextDetectionCommand = exports.serializeAws_json1_1GetDocumentAnalysisCommand = exports.serializeAws_json1_1DetectDocumentTextCommand = exports.serializeAws_json1_1AnalyzeExpenseCommand = exports.serializeAws_json1_1AnalyzeDocumentCommand = void 0;
|
|
4
4
|
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
5
5
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
6
|
const serializeAws_json1_1AnalyzeDocumentCommand = async (input, context) => {
|
|
@@ -53,6 +53,16 @@ const serializeAws_json1_1GetDocumentTextDetectionCommand = async (input, contex
|
|
|
53
53
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
54
54
|
};
|
|
55
55
|
exports.serializeAws_json1_1GetDocumentTextDetectionCommand = serializeAws_json1_1GetDocumentTextDetectionCommand;
|
|
56
|
+
const serializeAws_json1_1GetExpenseAnalysisCommand = async (input, context) => {
|
|
57
|
+
const headers = {
|
|
58
|
+
"content-type": "application/x-amz-json-1.1",
|
|
59
|
+
"x-amz-target": "Textract.GetExpenseAnalysis",
|
|
60
|
+
};
|
|
61
|
+
let body;
|
|
62
|
+
body = JSON.stringify(serializeAws_json1_1GetExpenseAnalysisRequest(input, context));
|
|
63
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
64
|
+
};
|
|
65
|
+
exports.serializeAws_json1_1GetExpenseAnalysisCommand = serializeAws_json1_1GetExpenseAnalysisCommand;
|
|
56
66
|
const serializeAws_json1_1StartDocumentAnalysisCommand = async (input, context) => {
|
|
57
67
|
const headers = {
|
|
58
68
|
"content-type": "application/x-amz-json-1.1",
|
|
@@ -73,6 +83,16 @@ const serializeAws_json1_1StartDocumentTextDetectionCommand = async (input, cont
|
|
|
73
83
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
74
84
|
};
|
|
75
85
|
exports.serializeAws_json1_1StartDocumentTextDetectionCommand = serializeAws_json1_1StartDocumentTextDetectionCommand;
|
|
86
|
+
const serializeAws_json1_1StartExpenseAnalysisCommand = async (input, context) => {
|
|
87
|
+
const headers = {
|
|
88
|
+
"content-type": "application/x-amz-json-1.1",
|
|
89
|
+
"x-amz-target": "Textract.StartExpenseAnalysis",
|
|
90
|
+
};
|
|
91
|
+
let body;
|
|
92
|
+
body = JSON.stringify(serializeAws_json1_1StartExpenseAnalysisRequest(input, context));
|
|
93
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
94
|
+
};
|
|
95
|
+
exports.serializeAws_json1_1StartExpenseAnalysisCommand = serializeAws_json1_1StartExpenseAnalysisCommand;
|
|
76
96
|
const deserializeAws_json1_1AnalyzeDocumentCommand = async (output, context) => {
|
|
77
97
|
if (output.statusCode >= 300) {
|
|
78
98
|
return deserializeAws_json1_1AnalyzeDocumentCommandError(output, context);
|
|
@@ -620,6 +640,109 @@ const deserializeAws_json1_1GetDocumentTextDetectionCommandError = async (output
|
|
|
620
640
|
delete response.Message;
|
|
621
641
|
return Promise.reject(Object.assign(new Error(message), response));
|
|
622
642
|
};
|
|
643
|
+
const deserializeAws_json1_1GetExpenseAnalysisCommand = async (output, context) => {
|
|
644
|
+
if (output.statusCode >= 300) {
|
|
645
|
+
return deserializeAws_json1_1GetExpenseAnalysisCommandError(output, context);
|
|
646
|
+
}
|
|
647
|
+
const data = await parseBody(output.body, context);
|
|
648
|
+
let contents = {};
|
|
649
|
+
contents = deserializeAws_json1_1GetExpenseAnalysisResponse(data, context);
|
|
650
|
+
const response = {
|
|
651
|
+
$metadata: deserializeMetadata(output),
|
|
652
|
+
...contents,
|
|
653
|
+
};
|
|
654
|
+
return Promise.resolve(response);
|
|
655
|
+
};
|
|
656
|
+
exports.deserializeAws_json1_1GetExpenseAnalysisCommand = deserializeAws_json1_1GetExpenseAnalysisCommand;
|
|
657
|
+
const deserializeAws_json1_1GetExpenseAnalysisCommandError = async (output, context) => {
|
|
658
|
+
const parsedOutput = {
|
|
659
|
+
...output,
|
|
660
|
+
body: await parseBody(output.body, context),
|
|
661
|
+
};
|
|
662
|
+
let response;
|
|
663
|
+
let errorCode = "UnknownError";
|
|
664
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
665
|
+
switch (errorCode) {
|
|
666
|
+
case "AccessDeniedException":
|
|
667
|
+
case "com.amazonaws.textract#AccessDeniedException":
|
|
668
|
+
response = {
|
|
669
|
+
...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
670
|
+
name: errorCode,
|
|
671
|
+
$metadata: deserializeMetadata(output),
|
|
672
|
+
};
|
|
673
|
+
break;
|
|
674
|
+
case "InternalServerError":
|
|
675
|
+
case "com.amazonaws.textract#InternalServerError":
|
|
676
|
+
response = {
|
|
677
|
+
...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
|
|
678
|
+
name: errorCode,
|
|
679
|
+
$metadata: deserializeMetadata(output),
|
|
680
|
+
};
|
|
681
|
+
break;
|
|
682
|
+
case "InvalidJobIdException":
|
|
683
|
+
case "com.amazonaws.textract#InvalidJobIdException":
|
|
684
|
+
response = {
|
|
685
|
+
...(await deserializeAws_json1_1InvalidJobIdExceptionResponse(parsedOutput, context)),
|
|
686
|
+
name: errorCode,
|
|
687
|
+
$metadata: deserializeMetadata(output),
|
|
688
|
+
};
|
|
689
|
+
break;
|
|
690
|
+
case "InvalidKMSKeyException":
|
|
691
|
+
case "com.amazonaws.textract#InvalidKMSKeyException":
|
|
692
|
+
response = {
|
|
693
|
+
...(await deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context)),
|
|
694
|
+
name: errorCode,
|
|
695
|
+
$metadata: deserializeMetadata(output),
|
|
696
|
+
};
|
|
697
|
+
break;
|
|
698
|
+
case "InvalidParameterException":
|
|
699
|
+
case "com.amazonaws.textract#InvalidParameterException":
|
|
700
|
+
response = {
|
|
701
|
+
...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
702
|
+
name: errorCode,
|
|
703
|
+
$metadata: deserializeMetadata(output),
|
|
704
|
+
};
|
|
705
|
+
break;
|
|
706
|
+
case "InvalidS3ObjectException":
|
|
707
|
+
case "com.amazonaws.textract#InvalidS3ObjectException":
|
|
708
|
+
response = {
|
|
709
|
+
...(await deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)),
|
|
710
|
+
name: errorCode,
|
|
711
|
+
$metadata: deserializeMetadata(output),
|
|
712
|
+
};
|
|
713
|
+
break;
|
|
714
|
+
case "ProvisionedThroughputExceededException":
|
|
715
|
+
case "com.amazonaws.textract#ProvisionedThroughputExceededException":
|
|
716
|
+
response = {
|
|
717
|
+
...(await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)),
|
|
718
|
+
name: errorCode,
|
|
719
|
+
$metadata: deserializeMetadata(output),
|
|
720
|
+
};
|
|
721
|
+
break;
|
|
722
|
+
case "ThrottlingException":
|
|
723
|
+
case "com.amazonaws.textract#ThrottlingException":
|
|
724
|
+
response = {
|
|
725
|
+
...(await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
726
|
+
name: errorCode,
|
|
727
|
+
$metadata: deserializeMetadata(output),
|
|
728
|
+
};
|
|
729
|
+
break;
|
|
730
|
+
default:
|
|
731
|
+
const parsedBody = parsedOutput.body;
|
|
732
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
733
|
+
response = {
|
|
734
|
+
...parsedBody,
|
|
735
|
+
name: `${errorCode}`,
|
|
736
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
737
|
+
$fault: "client",
|
|
738
|
+
$metadata: deserializeMetadata(output),
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
const message = response.message || response.Message || errorCode;
|
|
742
|
+
response.message = message;
|
|
743
|
+
delete response.Message;
|
|
744
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
745
|
+
};
|
|
623
746
|
const deserializeAws_json1_1StartDocumentAnalysisCommand = async (output, context) => {
|
|
624
747
|
if (output.statusCode >= 300) {
|
|
625
748
|
return deserializeAws_json1_1StartDocumentAnalysisCommandError(output, context);
|
|
@@ -890,6 +1013,141 @@ const deserializeAws_json1_1StartDocumentTextDetectionCommandError = async (outp
|
|
|
890
1013
|
delete response.Message;
|
|
891
1014
|
return Promise.reject(Object.assign(new Error(message), response));
|
|
892
1015
|
};
|
|
1016
|
+
const deserializeAws_json1_1StartExpenseAnalysisCommand = async (output, context) => {
|
|
1017
|
+
if (output.statusCode >= 300) {
|
|
1018
|
+
return deserializeAws_json1_1StartExpenseAnalysisCommandError(output, context);
|
|
1019
|
+
}
|
|
1020
|
+
const data = await parseBody(output.body, context);
|
|
1021
|
+
let contents = {};
|
|
1022
|
+
contents = deserializeAws_json1_1StartExpenseAnalysisResponse(data, context);
|
|
1023
|
+
const response = {
|
|
1024
|
+
$metadata: deserializeMetadata(output),
|
|
1025
|
+
...contents,
|
|
1026
|
+
};
|
|
1027
|
+
return Promise.resolve(response);
|
|
1028
|
+
};
|
|
1029
|
+
exports.deserializeAws_json1_1StartExpenseAnalysisCommand = deserializeAws_json1_1StartExpenseAnalysisCommand;
|
|
1030
|
+
const deserializeAws_json1_1StartExpenseAnalysisCommandError = async (output, context) => {
|
|
1031
|
+
const parsedOutput = {
|
|
1032
|
+
...output,
|
|
1033
|
+
body: await parseBody(output.body, context),
|
|
1034
|
+
};
|
|
1035
|
+
let response;
|
|
1036
|
+
let errorCode = "UnknownError";
|
|
1037
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1038
|
+
switch (errorCode) {
|
|
1039
|
+
case "AccessDeniedException":
|
|
1040
|
+
case "com.amazonaws.textract#AccessDeniedException":
|
|
1041
|
+
response = {
|
|
1042
|
+
...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1043
|
+
name: errorCode,
|
|
1044
|
+
$metadata: deserializeMetadata(output),
|
|
1045
|
+
};
|
|
1046
|
+
break;
|
|
1047
|
+
case "BadDocumentException":
|
|
1048
|
+
case "com.amazonaws.textract#BadDocumentException":
|
|
1049
|
+
response = {
|
|
1050
|
+
...(await deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context)),
|
|
1051
|
+
name: errorCode,
|
|
1052
|
+
$metadata: deserializeMetadata(output),
|
|
1053
|
+
};
|
|
1054
|
+
break;
|
|
1055
|
+
case "DocumentTooLargeException":
|
|
1056
|
+
case "com.amazonaws.textract#DocumentTooLargeException":
|
|
1057
|
+
response = {
|
|
1058
|
+
...(await deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context)),
|
|
1059
|
+
name: errorCode,
|
|
1060
|
+
$metadata: deserializeMetadata(output),
|
|
1061
|
+
};
|
|
1062
|
+
break;
|
|
1063
|
+
case "IdempotentParameterMismatchException":
|
|
1064
|
+
case "com.amazonaws.textract#IdempotentParameterMismatchException":
|
|
1065
|
+
response = {
|
|
1066
|
+
...(await deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)),
|
|
1067
|
+
name: errorCode,
|
|
1068
|
+
$metadata: deserializeMetadata(output),
|
|
1069
|
+
};
|
|
1070
|
+
break;
|
|
1071
|
+
case "InternalServerError":
|
|
1072
|
+
case "com.amazonaws.textract#InternalServerError":
|
|
1073
|
+
response = {
|
|
1074
|
+
...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
|
|
1075
|
+
name: errorCode,
|
|
1076
|
+
$metadata: deserializeMetadata(output),
|
|
1077
|
+
};
|
|
1078
|
+
break;
|
|
1079
|
+
case "InvalidKMSKeyException":
|
|
1080
|
+
case "com.amazonaws.textract#InvalidKMSKeyException":
|
|
1081
|
+
response = {
|
|
1082
|
+
...(await deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context)),
|
|
1083
|
+
name: errorCode,
|
|
1084
|
+
$metadata: deserializeMetadata(output),
|
|
1085
|
+
};
|
|
1086
|
+
break;
|
|
1087
|
+
case "InvalidParameterException":
|
|
1088
|
+
case "com.amazonaws.textract#InvalidParameterException":
|
|
1089
|
+
response = {
|
|
1090
|
+
...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
1091
|
+
name: errorCode,
|
|
1092
|
+
$metadata: deserializeMetadata(output),
|
|
1093
|
+
};
|
|
1094
|
+
break;
|
|
1095
|
+
case "InvalidS3ObjectException":
|
|
1096
|
+
case "com.amazonaws.textract#InvalidS3ObjectException":
|
|
1097
|
+
response = {
|
|
1098
|
+
...(await deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)),
|
|
1099
|
+
name: errorCode,
|
|
1100
|
+
$metadata: deserializeMetadata(output),
|
|
1101
|
+
};
|
|
1102
|
+
break;
|
|
1103
|
+
case "LimitExceededException":
|
|
1104
|
+
case "com.amazonaws.textract#LimitExceededException":
|
|
1105
|
+
response = {
|
|
1106
|
+
...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
|
|
1107
|
+
name: errorCode,
|
|
1108
|
+
$metadata: deserializeMetadata(output),
|
|
1109
|
+
};
|
|
1110
|
+
break;
|
|
1111
|
+
case "ProvisionedThroughputExceededException":
|
|
1112
|
+
case "com.amazonaws.textract#ProvisionedThroughputExceededException":
|
|
1113
|
+
response = {
|
|
1114
|
+
...(await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)),
|
|
1115
|
+
name: errorCode,
|
|
1116
|
+
$metadata: deserializeMetadata(output),
|
|
1117
|
+
};
|
|
1118
|
+
break;
|
|
1119
|
+
case "ThrottlingException":
|
|
1120
|
+
case "com.amazonaws.textract#ThrottlingException":
|
|
1121
|
+
response = {
|
|
1122
|
+
...(await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
1123
|
+
name: errorCode,
|
|
1124
|
+
$metadata: deserializeMetadata(output),
|
|
1125
|
+
};
|
|
1126
|
+
break;
|
|
1127
|
+
case "UnsupportedDocumentException":
|
|
1128
|
+
case "com.amazonaws.textract#UnsupportedDocumentException":
|
|
1129
|
+
response = {
|
|
1130
|
+
...(await deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context)),
|
|
1131
|
+
name: errorCode,
|
|
1132
|
+
$metadata: deserializeMetadata(output),
|
|
1133
|
+
};
|
|
1134
|
+
break;
|
|
1135
|
+
default:
|
|
1136
|
+
const parsedBody = parsedOutput.body;
|
|
1137
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1138
|
+
response = {
|
|
1139
|
+
...parsedBody,
|
|
1140
|
+
name: `${errorCode}`,
|
|
1141
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1142
|
+
$fault: "client",
|
|
1143
|
+
$metadata: deserializeMetadata(output),
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
1146
|
+
const message = response.message || response.Message || errorCode;
|
|
1147
|
+
response.message = message;
|
|
1148
|
+
delete response.Message;
|
|
1149
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1150
|
+
};
|
|
893
1151
|
const deserializeAws_json1_1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
894
1152
|
const body = parsedOutput.body;
|
|
895
1153
|
const deserialized = deserializeAws_json1_1AccessDeniedException(body, context);
|
|
@@ -1115,6 +1373,13 @@ const serializeAws_json1_1GetDocumentTextDetectionRequest = (input, context) =>
|
|
|
1115
1373
|
...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
|
|
1116
1374
|
};
|
|
1117
1375
|
};
|
|
1376
|
+
const serializeAws_json1_1GetExpenseAnalysisRequest = (input, context) => {
|
|
1377
|
+
return {
|
|
1378
|
+
...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }),
|
|
1379
|
+
...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
|
|
1380
|
+
...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
|
|
1381
|
+
};
|
|
1382
|
+
};
|
|
1118
1383
|
const serializeAws_json1_1HumanLoopConfig = (input, context) => {
|
|
1119
1384
|
return {
|
|
1120
1385
|
...(input.DataAttributes !== undefined &&
|
|
@@ -1191,6 +1456,24 @@ const serializeAws_json1_1StartDocumentTextDetectionRequest = (input, context) =
|
|
|
1191
1456
|
input.OutputConfig !== null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }),
|
|
1192
1457
|
};
|
|
1193
1458
|
};
|
|
1459
|
+
const serializeAws_json1_1StartExpenseAnalysisRequest = (input, context) => {
|
|
1460
|
+
return {
|
|
1461
|
+
...(input.ClientRequestToken !== undefined &&
|
|
1462
|
+
input.ClientRequestToken !== null && { ClientRequestToken: input.ClientRequestToken }),
|
|
1463
|
+
...(input.DocumentLocation !== undefined &&
|
|
1464
|
+
input.DocumentLocation !== null && {
|
|
1465
|
+
DocumentLocation: serializeAws_json1_1DocumentLocation(input.DocumentLocation, context),
|
|
1466
|
+
}),
|
|
1467
|
+
...(input.JobTag !== undefined && input.JobTag !== null && { JobTag: input.JobTag }),
|
|
1468
|
+
...(input.KMSKeyId !== undefined && input.KMSKeyId !== null && { KMSKeyId: input.KMSKeyId }),
|
|
1469
|
+
...(input.NotificationChannel !== undefined &&
|
|
1470
|
+
input.NotificationChannel !== null && {
|
|
1471
|
+
NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context),
|
|
1472
|
+
}),
|
|
1473
|
+
...(input.OutputConfig !== undefined &&
|
|
1474
|
+
input.OutputConfig !== null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }),
|
|
1475
|
+
};
|
|
1476
|
+
};
|
|
1194
1477
|
const deserializeAws_json1_1AccessDeniedException = (output, context) => {
|
|
1195
1478
|
return {
|
|
1196
1479
|
Code: smithy_client_1.expectString(output.Code),
|
|
@@ -1405,6 +1688,23 @@ const deserializeAws_json1_1GetDocumentTextDetectionResponse = (output, context)
|
|
|
1405
1688
|
: undefined,
|
|
1406
1689
|
};
|
|
1407
1690
|
};
|
|
1691
|
+
const deserializeAws_json1_1GetExpenseAnalysisResponse = (output, context) => {
|
|
1692
|
+
return {
|
|
1693
|
+
AnalyzeExpenseModelVersion: smithy_client_1.expectString(output.AnalyzeExpenseModelVersion),
|
|
1694
|
+
DocumentMetadata: output.DocumentMetadata !== undefined && output.DocumentMetadata !== null
|
|
1695
|
+
? deserializeAws_json1_1DocumentMetadata(output.DocumentMetadata, context)
|
|
1696
|
+
: undefined,
|
|
1697
|
+
ExpenseDocuments: output.ExpenseDocuments !== undefined && output.ExpenseDocuments !== null
|
|
1698
|
+
? deserializeAws_json1_1ExpenseDocumentList(output.ExpenseDocuments, context)
|
|
1699
|
+
: undefined,
|
|
1700
|
+
JobStatus: smithy_client_1.expectString(output.JobStatus),
|
|
1701
|
+
NextToken: smithy_client_1.expectString(output.NextToken),
|
|
1702
|
+
StatusMessage: smithy_client_1.expectString(output.StatusMessage),
|
|
1703
|
+
Warnings: output.Warnings !== undefined && output.Warnings !== null
|
|
1704
|
+
? deserializeAws_json1_1Warnings(output.Warnings, context)
|
|
1705
|
+
: undefined,
|
|
1706
|
+
};
|
|
1707
|
+
};
|
|
1408
1708
|
const deserializeAws_json1_1HumanLoopActivationOutput = (output, context) => {
|
|
1409
1709
|
return {
|
|
1410
1710
|
HumanLoopActivationConditionsEvaluationResults: output.HumanLoopActivationConditionsEvaluationResults !== undefined &&
|
|
@@ -1581,6 +1881,11 @@ const deserializeAws_json1_1StartDocumentTextDetectionResponse = (output, contex
|
|
|
1581
1881
|
JobId: smithy_client_1.expectString(output.JobId),
|
|
1582
1882
|
};
|
|
1583
1883
|
};
|
|
1884
|
+
const deserializeAws_json1_1StartExpenseAnalysisResponse = (output, context) => {
|
|
1885
|
+
return {
|
|
1886
|
+
JobId: smithy_client_1.expectString(output.JobId),
|
|
1887
|
+
};
|
|
1888
|
+
};
|
|
1584
1889
|
const deserializeAws_json1_1ThrottlingException = (output, context) => {
|
|
1585
1890
|
return {
|
|
1586
1891
|
Code: smithy_client_1.expectString(output.Code),
|
|
@@ -4,6 +4,7 @@ exports.getRuntimeConfig = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
6
6
|
const sha256_browser_1 = require("@aws-crypto/sha256-browser");
|
|
7
|
+
const config_resolver_1 = require("@aws-sdk/config-resolver");
|
|
7
8
|
const fetch_http_handler_1 = require("@aws-sdk/fetch-http-handler");
|
|
8
9
|
const invalid_dependency_1 = require("@aws-sdk/invalid-dependency");
|
|
9
10
|
const middleware_retry_1 = require("@aws-sdk/middleware-retry");
|
|
@@ -13,7 +14,7 @@ const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser");
|
|
|
13
14
|
const util_utf8_browser_1 = require("@aws-sdk/util-utf8-browser");
|
|
14
15
|
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
|
15
16
|
const getRuntimeConfig = (config) => {
|
|
16
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
17
18
|
const clientSharedValues = runtimeConfig_shared_1.getRuntimeConfig(config);
|
|
18
19
|
return {
|
|
19
20
|
...clientSharedValues,
|
|
@@ -30,8 +31,10 @@ const getRuntimeConfig = (config) => {
|
|
|
30
31
|
retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : (() => Promise.resolve(middleware_retry_1.DEFAULT_RETRY_MODE)),
|
|
31
32
|
sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : sha256_browser_1.Sha256,
|
|
32
33
|
streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : fetch_http_handler_1.streamCollector,
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : (() => Promise.resolve(config_resolver_1.DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
35
|
+
useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : (() => Promise.resolve(config_resolver_1.DEFAULT_USE_FIPS_ENDPOINT)),
|
|
36
|
+
utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : util_utf8_browser_1.fromUtf8,
|
|
37
|
+
utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : util_utf8_browser_1.toUtf8,
|
|
35
38
|
};
|
|
36
39
|
};
|
|
37
40
|
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -17,7 +17,7 @@ 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
19
|
const getRuntimeConfig = (config) => {
|
|
20
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
20
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
21
21
|
smithy_client_1.emitWarningIfUnsupportedVersion(process.version);
|
|
22
22
|
const clientSharedValues = runtimeConfig_shared_1.getRuntimeConfig(config);
|
|
23
23
|
return {
|
|
@@ -35,8 +35,10 @@ const getRuntimeConfig = (config) => {
|
|
|
35
35
|
retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : node_config_provider_1.loadConfig(middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS),
|
|
36
36
|
sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : hash_node_1.Hash.bind(null, "sha256"),
|
|
37
37
|
streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : node_http_handler_1.streamCollector,
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
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),
|
|
39
|
+
useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : node_config_provider_1.loadConfig(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
|
|
40
|
+
utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : util_utf8_node_1.fromUtf8,
|
|
41
|
+
utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : util_utf8_node_1.toUtf8,
|
|
40
42
|
};
|
|
41
43
|
};
|
|
42
44
|
exports.getRuntimeConfig = getRuntimeConfig;
|
package/dist-es/Textract.js
CHANGED
|
@@ -4,8 +4,10 @@ import { AnalyzeExpenseCommand, } from "./commands/AnalyzeExpenseCommand";
|
|
|
4
4
|
import { DetectDocumentTextCommand, } from "./commands/DetectDocumentTextCommand";
|
|
5
5
|
import { GetDocumentAnalysisCommand, } from "./commands/GetDocumentAnalysisCommand";
|
|
6
6
|
import { GetDocumentTextDetectionCommand, } from "./commands/GetDocumentTextDetectionCommand";
|
|
7
|
+
import { GetExpenseAnalysisCommand, } from "./commands/GetExpenseAnalysisCommand";
|
|
7
8
|
import { StartDocumentAnalysisCommand, } from "./commands/StartDocumentAnalysisCommand";
|
|
8
9
|
import { StartDocumentTextDetectionCommand, } from "./commands/StartDocumentTextDetectionCommand";
|
|
10
|
+
import { StartExpenseAnalysisCommand, } from "./commands/StartExpenseAnalysisCommand";
|
|
9
11
|
import { TextractClient } from "./TextractClient";
|
|
10
12
|
var Textract = (function (_super) {
|
|
11
13
|
__extends(Textract, _super);
|
|
@@ -82,6 +84,20 @@ var Textract = (function (_super) {
|
|
|
82
84
|
return this.send(command, optionsOrCb);
|
|
83
85
|
}
|
|
84
86
|
};
|
|
87
|
+
Textract.prototype.getExpenseAnalysis = function (args, optionsOrCb, cb) {
|
|
88
|
+
var command = new GetExpenseAnalysisCommand(args);
|
|
89
|
+
if (typeof optionsOrCb === "function") {
|
|
90
|
+
this.send(command, optionsOrCb);
|
|
91
|
+
}
|
|
92
|
+
else if (typeof cb === "function") {
|
|
93
|
+
if (typeof optionsOrCb !== "object")
|
|
94
|
+
throw new Error("Expect http options but get " + typeof optionsOrCb);
|
|
95
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
return this.send(command, optionsOrCb);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
85
101
|
Textract.prototype.startDocumentAnalysis = function (args, optionsOrCb, cb) {
|
|
86
102
|
var command = new StartDocumentAnalysisCommand(args);
|
|
87
103
|
if (typeof optionsOrCb === "function") {
|
|
@@ -110,6 +126,20 @@ var Textract = (function (_super) {
|
|
|
110
126
|
return this.send(command, optionsOrCb);
|
|
111
127
|
}
|
|
112
128
|
};
|
|
129
|
+
Textract.prototype.startExpenseAnalysis = function (args, optionsOrCb, cb) {
|
|
130
|
+
var command = new StartExpenseAnalysisCommand(args);
|
|
131
|
+
if (typeof optionsOrCb === "function") {
|
|
132
|
+
this.send(command, optionsOrCb);
|
|
133
|
+
}
|
|
134
|
+
else if (typeof cb === "function") {
|
|
135
|
+
if (typeof optionsOrCb !== "object")
|
|
136
|
+
throw new Error("Expect http options but get " + typeof optionsOrCb);
|
|
137
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
return this.send(command, optionsOrCb);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
113
143
|
return Textract;
|
|
114
144
|
}(TextractClient));
|
|
115
145
|
export { Textract };
|
|
@@ -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 { GetExpenseAnalysisRequest, GetExpenseAnalysisResponse } from "../models/models_0";
|
|
5
|
+
import { deserializeAws_json1_1GetExpenseAnalysisCommand, serializeAws_json1_1GetExpenseAnalysisCommand, } from "../protocols/Aws_json1_1";
|
|
6
|
+
var GetExpenseAnalysisCommand = (function (_super) {
|
|
7
|
+
__extends(GetExpenseAnalysisCommand, _super);
|
|
8
|
+
function GetExpenseAnalysisCommand(input) {
|
|
9
|
+
var _this = _super.call(this) || this;
|
|
10
|
+
_this.input = input;
|
|
11
|
+
return _this;
|
|
12
|
+
}
|
|
13
|
+
GetExpenseAnalysisCommand.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 = "GetExpenseAnalysisCommand";
|
|
19
|
+
var handlerExecutionContext = {
|
|
20
|
+
logger: logger,
|
|
21
|
+
clientName: clientName,
|
|
22
|
+
commandName: commandName,
|
|
23
|
+
inputFilterSensitiveLog: GetExpenseAnalysisRequest.filterSensitiveLog,
|
|
24
|
+
outputFilterSensitiveLog: GetExpenseAnalysisResponse.filterSensitiveLog,
|
|
25
|
+
};
|
|
26
|
+
var requestHandler = configuration.requestHandler;
|
|
27
|
+
return stack.resolve(function (request) {
|
|
28
|
+
return requestHandler.handle(request.request, options || {});
|
|
29
|
+
}, handlerExecutionContext);
|
|
30
|
+
};
|
|
31
|
+
GetExpenseAnalysisCommand.prototype.serialize = function (input, context) {
|
|
32
|
+
return serializeAws_json1_1GetExpenseAnalysisCommand(input, context);
|
|
33
|
+
};
|
|
34
|
+
GetExpenseAnalysisCommand.prototype.deserialize = function (output, context) {
|
|
35
|
+
return deserializeAws_json1_1GetExpenseAnalysisCommand(output, context);
|
|
36
|
+
};
|
|
37
|
+
return GetExpenseAnalysisCommand;
|
|
38
|
+
}($Command));
|
|
39
|
+
export { GetExpenseAnalysisCommand };
|
|
@@ -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 { StartExpenseAnalysisRequest, StartExpenseAnalysisResponse } from "../models/models_0";
|
|
5
|
+
import { deserializeAws_json1_1StartExpenseAnalysisCommand, serializeAws_json1_1StartExpenseAnalysisCommand, } from "../protocols/Aws_json1_1";
|
|
6
|
+
var StartExpenseAnalysisCommand = (function (_super) {
|
|
7
|
+
__extends(StartExpenseAnalysisCommand, _super);
|
|
8
|
+
function StartExpenseAnalysisCommand(input) {
|
|
9
|
+
var _this = _super.call(this) || this;
|
|
10
|
+
_this.input = input;
|
|
11
|
+
return _this;
|
|
12
|
+
}
|
|
13
|
+
StartExpenseAnalysisCommand.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 = "StartExpenseAnalysisCommand";
|
|
19
|
+
var handlerExecutionContext = {
|
|
20
|
+
logger: logger,
|
|
21
|
+
clientName: clientName,
|
|
22
|
+
commandName: commandName,
|
|
23
|
+
inputFilterSensitiveLog: StartExpenseAnalysisRequest.filterSensitiveLog,
|
|
24
|
+
outputFilterSensitiveLog: StartExpenseAnalysisResponse.filterSensitiveLog,
|
|
25
|
+
};
|
|
26
|
+
var requestHandler = configuration.requestHandler;
|
|
27
|
+
return stack.resolve(function (request) {
|
|
28
|
+
return requestHandler.handle(request.request, options || {});
|
|
29
|
+
}, handlerExecutionContext);
|
|
30
|
+
};
|
|
31
|
+
StartExpenseAnalysisCommand.prototype.serialize = function (input, context) {
|
|
32
|
+
return serializeAws_json1_1StartExpenseAnalysisCommand(input, context);
|
|
33
|
+
};
|
|
34
|
+
StartExpenseAnalysisCommand.prototype.deserialize = function (output, context) {
|
|
35
|
+
return deserializeAws_json1_1StartExpenseAnalysisCommand(output, context);
|
|
36
|
+
};
|
|
37
|
+
return StartExpenseAnalysisCommand;
|
|
38
|
+
}($Command));
|
|
39
|
+
export { StartExpenseAnalysisCommand };
|
|
@@ -3,5 +3,7 @@ export * from "./AnalyzeExpenseCommand";
|
|
|
3
3
|
export * from "./DetectDocumentTextCommand";
|
|
4
4
|
export * from "./GetDocumentAnalysisCommand";
|
|
5
5
|
export * from "./GetDocumentTextDetectionCommand";
|
|
6
|
+
export * from "./GetExpenseAnalysisCommand";
|
|
6
7
|
export * from "./StartDocumentAnalysisCommand";
|
|
7
8
|
export * from "./StartDocumentTextDetectionCommand";
|
|
9
|
+
export * from "./StartExpenseAnalysisCommand";
|