@aws-sdk/client-textract 3.312.0 → 3.316.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/dist-cjs/Textract.js +17 -182
- package/dist-cjs/protocols/Aws_json1_1.js +247 -822
- package/dist-es/Textract.js +17 -182
- package/dist-es/protocols/Aws_json1_1.js +248 -823
- package/dist-types/Textract.d.ts +22 -305
- package/dist-types/ts3.4/Textract.d.ts +2 -1
- package/package.json +6 -6
package/dist-es/Textract.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createAggregatedClient } from "@aws-sdk/smithy-client";
|
|
1
2
|
import { AnalyzeDocumentCommand, } from "./commands/AnalyzeDocumentCommand";
|
|
2
3
|
import { AnalyzeExpenseCommand, } from "./commands/AnalyzeExpenseCommand";
|
|
3
4
|
import { AnalyzeIDCommand } from "./commands/AnalyzeIDCommand";
|
|
@@ -12,187 +13,21 @@ import { StartDocumentTextDetectionCommand, } from "./commands/StartDocumentText
|
|
|
12
13
|
import { StartExpenseAnalysisCommand, } from "./commands/StartExpenseAnalysisCommand";
|
|
13
14
|
import { StartLendingAnalysisCommand, } from "./commands/StartLendingAnalysisCommand";
|
|
14
15
|
import { TextractClient } from "./TextractClient";
|
|
16
|
+
const commands = {
|
|
17
|
+
AnalyzeDocumentCommand,
|
|
18
|
+
AnalyzeExpenseCommand,
|
|
19
|
+
AnalyzeIDCommand,
|
|
20
|
+
DetectDocumentTextCommand,
|
|
21
|
+
GetDocumentAnalysisCommand,
|
|
22
|
+
GetDocumentTextDetectionCommand,
|
|
23
|
+
GetExpenseAnalysisCommand,
|
|
24
|
+
GetLendingAnalysisCommand,
|
|
25
|
+
GetLendingAnalysisSummaryCommand,
|
|
26
|
+
StartDocumentAnalysisCommand,
|
|
27
|
+
StartDocumentTextDetectionCommand,
|
|
28
|
+
StartExpenseAnalysisCommand,
|
|
29
|
+
StartLendingAnalysisCommand,
|
|
30
|
+
};
|
|
15
31
|
export class Textract extends TextractClient {
|
|
16
|
-
analyzeDocument(args, optionsOrCb, cb) {
|
|
17
|
-
const command = new AnalyzeDocumentCommand(args);
|
|
18
|
-
if (typeof optionsOrCb === "function") {
|
|
19
|
-
this.send(command, optionsOrCb);
|
|
20
|
-
}
|
|
21
|
-
else if (typeof cb === "function") {
|
|
22
|
-
if (typeof optionsOrCb !== "object")
|
|
23
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
24
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
return this.send(command, optionsOrCb);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
analyzeExpense(args, optionsOrCb, cb) {
|
|
31
|
-
const command = new AnalyzeExpenseCommand(args);
|
|
32
|
-
if (typeof optionsOrCb === "function") {
|
|
33
|
-
this.send(command, optionsOrCb);
|
|
34
|
-
}
|
|
35
|
-
else if (typeof cb === "function") {
|
|
36
|
-
if (typeof optionsOrCb !== "object")
|
|
37
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
38
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
return this.send(command, optionsOrCb);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
analyzeID(args, optionsOrCb, cb) {
|
|
45
|
-
const command = new AnalyzeIDCommand(args);
|
|
46
|
-
if (typeof optionsOrCb === "function") {
|
|
47
|
-
this.send(command, optionsOrCb);
|
|
48
|
-
}
|
|
49
|
-
else if (typeof cb === "function") {
|
|
50
|
-
if (typeof optionsOrCb !== "object")
|
|
51
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
52
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
return this.send(command, optionsOrCb);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
detectDocumentText(args, optionsOrCb, cb) {
|
|
59
|
-
const command = new DetectDocumentTextCommand(args);
|
|
60
|
-
if (typeof optionsOrCb === "function") {
|
|
61
|
-
this.send(command, optionsOrCb);
|
|
62
|
-
}
|
|
63
|
-
else if (typeof cb === "function") {
|
|
64
|
-
if (typeof optionsOrCb !== "object")
|
|
65
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
66
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
return this.send(command, optionsOrCb);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
getDocumentAnalysis(args, optionsOrCb, cb) {
|
|
73
|
-
const command = new GetDocumentAnalysisCommand(args);
|
|
74
|
-
if (typeof optionsOrCb === "function") {
|
|
75
|
-
this.send(command, optionsOrCb);
|
|
76
|
-
}
|
|
77
|
-
else if (typeof cb === "function") {
|
|
78
|
-
if (typeof optionsOrCb !== "object")
|
|
79
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
80
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
return this.send(command, optionsOrCb);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
getDocumentTextDetection(args, optionsOrCb, cb) {
|
|
87
|
-
const command = new GetDocumentTextDetectionCommand(args);
|
|
88
|
-
if (typeof optionsOrCb === "function") {
|
|
89
|
-
this.send(command, optionsOrCb);
|
|
90
|
-
}
|
|
91
|
-
else if (typeof cb === "function") {
|
|
92
|
-
if (typeof optionsOrCb !== "object")
|
|
93
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
94
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
return this.send(command, optionsOrCb);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
getExpenseAnalysis(args, optionsOrCb, cb) {
|
|
101
|
-
const command = new GetExpenseAnalysisCommand(args);
|
|
102
|
-
if (typeof optionsOrCb === "function") {
|
|
103
|
-
this.send(command, optionsOrCb);
|
|
104
|
-
}
|
|
105
|
-
else if (typeof cb === "function") {
|
|
106
|
-
if (typeof optionsOrCb !== "object")
|
|
107
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
108
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
return this.send(command, optionsOrCb);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
getLendingAnalysis(args, optionsOrCb, cb) {
|
|
115
|
-
const command = new GetLendingAnalysisCommand(args);
|
|
116
|
-
if (typeof optionsOrCb === "function") {
|
|
117
|
-
this.send(command, optionsOrCb);
|
|
118
|
-
}
|
|
119
|
-
else if (typeof cb === "function") {
|
|
120
|
-
if (typeof optionsOrCb !== "object")
|
|
121
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
122
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
return this.send(command, optionsOrCb);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
getLendingAnalysisSummary(args, optionsOrCb, cb) {
|
|
129
|
-
const command = new GetLendingAnalysisSummaryCommand(args);
|
|
130
|
-
if (typeof optionsOrCb === "function") {
|
|
131
|
-
this.send(command, optionsOrCb);
|
|
132
|
-
}
|
|
133
|
-
else if (typeof cb === "function") {
|
|
134
|
-
if (typeof optionsOrCb !== "object")
|
|
135
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
136
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
return this.send(command, optionsOrCb);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
startDocumentAnalysis(args, optionsOrCb, cb) {
|
|
143
|
-
const command = new StartDocumentAnalysisCommand(args);
|
|
144
|
-
if (typeof optionsOrCb === "function") {
|
|
145
|
-
this.send(command, optionsOrCb);
|
|
146
|
-
}
|
|
147
|
-
else if (typeof cb === "function") {
|
|
148
|
-
if (typeof optionsOrCb !== "object")
|
|
149
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
150
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
return this.send(command, optionsOrCb);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
startDocumentTextDetection(args, optionsOrCb, cb) {
|
|
157
|
-
const command = new StartDocumentTextDetectionCommand(args);
|
|
158
|
-
if (typeof optionsOrCb === "function") {
|
|
159
|
-
this.send(command, optionsOrCb);
|
|
160
|
-
}
|
|
161
|
-
else if (typeof cb === "function") {
|
|
162
|
-
if (typeof optionsOrCb !== "object")
|
|
163
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
164
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
return this.send(command, optionsOrCb);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
startExpenseAnalysis(args, optionsOrCb, cb) {
|
|
171
|
-
const command = new StartExpenseAnalysisCommand(args);
|
|
172
|
-
if (typeof optionsOrCb === "function") {
|
|
173
|
-
this.send(command, optionsOrCb);
|
|
174
|
-
}
|
|
175
|
-
else if (typeof cb === "function") {
|
|
176
|
-
if (typeof optionsOrCb !== "object")
|
|
177
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
178
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
return this.send(command, optionsOrCb);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
startLendingAnalysis(args, optionsOrCb, cb) {
|
|
185
|
-
const command = new StartLendingAnalysisCommand(args);
|
|
186
|
-
if (typeof optionsOrCb === "function") {
|
|
187
|
-
this.send(command, optionsOrCb);
|
|
188
|
-
}
|
|
189
|
-
else if (typeof cb === "function") {
|
|
190
|
-
if (typeof optionsOrCb !== "object")
|
|
191
|
-
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
192
|
-
this.send(command, optionsOrCb || {}, cb);
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
return this.send(command, optionsOrCb);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
32
|
}
|
|
33
|
+
createAggregatedClient(commands, Textract);
|