@aws-sdk/client-textract 3.33.0 → 3.36.1

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.
Files changed (155) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/{dist/cjs → dist-cjs}/Textract.js +1 -7
  3. package/{dist/cjs → dist-cjs}/TextractClient.js +8 -19
  4. package/dist-cjs/commands/AnalyzeDocumentCommand.js +36 -0
  5. package/dist-cjs/commands/AnalyzeExpenseCommand.js +36 -0
  6. package/dist-cjs/commands/DetectDocumentTextCommand.js +36 -0
  7. package/dist-cjs/commands/GetDocumentAnalysisCommand.js +36 -0
  8. package/dist-cjs/commands/GetDocumentTextDetectionCommand.js +36 -0
  9. package/dist-cjs/commands/StartDocumentAnalysisCommand.js +36 -0
  10. package/dist-cjs/commands/StartDocumentTextDetectionCommand.js +36 -0
  11. package/{dist/cjs → dist-cjs}/endpoints.js +0 -1
  12. package/{dist/cjs → dist-cjs}/index.js +0 -1
  13. package/{dist/cjs → dist-cjs}/models/index.js +0 -1
  14. package/{dist/cjs → dist-cjs}/models/models_0.js +0 -148
  15. package/{dist/cjs → dist-cjs}/protocols/Aws_json1_1.js +0 -6
  16. package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +1 -5
  17. package/{dist/cjs → dist-cjs}/runtimeConfig.js +1 -5
  18. package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -4
  19. package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -5
  20. package/{dist/es → dist-es}/Textract.js +2 -8
  21. package/{dist/es → dist-es}/TextractClient.js +2 -13
  22. package/dist-es/commands/AnalyzeDocumentCommand.js +39 -0
  23. package/{dist/es → dist-es}/commands/AnalyzeExpenseCommand.js +4 -43
  24. package/dist-es/commands/DetectDocumentTextCommand.js +39 -0
  25. package/dist-es/commands/GetDocumentAnalysisCommand.js +39 -0
  26. package/dist-es/commands/GetDocumentTextDetectionCommand.js +39 -0
  27. package/dist-es/commands/StartDocumentAnalysisCommand.js +39 -0
  28. package/dist-es/commands/StartDocumentTextDetectionCommand.js +39 -0
  29. package/{dist/es → dist-es}/endpoints.js +1 -2
  30. package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
  31. package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
  32. package/{dist/es → dist-es}/models/models_0.js +0 -148
  33. package/{dist/es → dist-es}/protocols/Aws_json1_1.js +338 -344
  34. package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -5
  35. package/{dist/es → dist-es}/runtimeConfig.js +1 -5
  36. package/{dist/es → dist-es}/runtimeConfig.native.js +0 -4
  37. package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -5
  38. package/{dist/types → dist-types}/Textract.d.ts +2 -2
  39. package/{dist/types → dist-types}/TextractClient.d.ts +8 -8
  40. package/{dist/types → dist-types}/commands/AnalyzeDocumentCommand.d.ts +3 -3
  41. package/{dist/types → dist-types}/commands/AnalyzeExpenseCommand.d.ts +3 -3
  42. package/{dist/types → dist-types}/commands/DetectDocumentTextCommand.d.ts +3 -3
  43. package/{dist/types → dist-types}/commands/GetDocumentAnalysisCommand.d.ts +3 -3
  44. package/{dist/types → dist-types}/commands/GetDocumentTextDetectionCommand.d.ts +3 -3
  45. package/{dist/types → dist-types}/commands/StartDocumentAnalysisCommand.d.ts +3 -3
  46. package/{dist/types → dist-types}/commands/StartDocumentTextDetectionCommand.d.ts +3 -3
  47. package/{dist/types → dist-types}/endpoints.d.ts +0 -0
  48. package/{index.ts → dist-types/index.d.ts} +0 -0
  49. package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
  50. package/{dist/types → dist-types}/models/models_0.d.ts +0 -0
  51. package/{dist/types → dist-types}/protocols/Aws_json1_1.d.ts +2 -2
  52. package/{dist/types → dist-types}/runtimeConfig.browser.d.ts +0 -0
  53. package/{dist/types → dist-types}/runtimeConfig.d.ts +1 -1
  54. package/{dist/types → dist-types}/runtimeConfig.native.d.ts +0 -0
  55. package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
  56. package/dist-types/ts3.4/Textract.d.ts +40 -0
  57. package/{dist/types → dist-types}/ts3.4/TextractClient.d.ts +32 -99
  58. package/dist-types/ts3.4/commands/AnalyzeDocumentCommand.d.ts +17 -0
  59. package/dist-types/ts3.4/commands/AnalyzeExpenseCommand.d.ts +17 -0
  60. package/dist-types/ts3.4/commands/DetectDocumentTextCommand.d.ts +17 -0
  61. package/dist-types/ts3.4/commands/GetDocumentAnalysisCommand.d.ts +17 -0
  62. package/dist-types/ts3.4/commands/GetDocumentTextDetectionCommand.d.ts +17 -0
  63. package/dist-types/ts3.4/commands/StartDocumentAnalysisCommand.d.ts +17 -0
  64. package/dist-types/ts3.4/commands/StartDocumentTextDetectionCommand.d.ts +17 -0
  65. package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
  66. package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
  67. package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
  68. package/dist-types/ts3.4/models/models_0.d.ts +649 -0
  69. package/{dist/types → dist-types}/ts3.4/protocols/Aws_json1_1.d.ts +2 -2
  70. package/{dist/types → dist-types}/ts3.4/runtimeConfig.browser.d.ts +1 -3
  71. package/{dist/types → dist-types}/ts3.4/runtimeConfig.d.ts +2 -4
  72. package/{dist/types → dist-types}/ts3.4/runtimeConfig.native.d.ts +1 -3
  73. package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +1 -3
  74. package/package.json +52 -49
  75. package/Textract.ts +0 -422
  76. package/TextractClient.ts +0 -270
  77. package/commands/AnalyzeDocumentCommand.ts +0 -124
  78. package/commands/AnalyzeExpenseCommand.ts +0 -107
  79. package/commands/DetectDocumentTextCommand.ts +0 -104
  80. package/commands/GetDocumentAnalysisCommand.ts +0 -138
  81. package/commands/GetDocumentTextDetectionCommand.ts +0 -118
  82. package/commands/StartDocumentAnalysisCommand.ts +0 -111
  83. package/commands/StartDocumentTextDetectionCommand.ts +0 -113
  84. package/dist/cjs/Textract.js.map +0 -1
  85. package/dist/cjs/TextractClient.js.map +0 -1
  86. package/dist/cjs/commands/AnalyzeDocumentCommand.js +0 -91
  87. package/dist/cjs/commands/AnalyzeDocumentCommand.js.map +0 -1
  88. package/dist/cjs/commands/AnalyzeExpenseCommand.js +0 -74
  89. package/dist/cjs/commands/AnalyzeExpenseCommand.js.map +0 -1
  90. package/dist/cjs/commands/DetectDocumentTextCommand.js +0 -71
  91. package/dist/cjs/commands/DetectDocumentTextCommand.js.map +0 -1
  92. package/dist/cjs/commands/GetDocumentAnalysisCommand.js +0 -105
  93. package/dist/cjs/commands/GetDocumentAnalysisCommand.js.map +0 -1
  94. package/dist/cjs/commands/GetDocumentTextDetectionCommand.js +0 -85
  95. package/dist/cjs/commands/GetDocumentTextDetectionCommand.js.map +0 -1
  96. package/dist/cjs/commands/StartDocumentAnalysisCommand.js +0 -78
  97. package/dist/cjs/commands/StartDocumentAnalysisCommand.js.map +0 -1
  98. package/dist/cjs/commands/StartDocumentTextDetectionCommand.js +0 -77
  99. package/dist/cjs/commands/StartDocumentTextDetectionCommand.js.map +0 -1
  100. package/dist/cjs/endpoints.js.map +0 -1
  101. package/dist/cjs/index.js.map +0 -1
  102. package/dist/cjs/models/index.js.map +0 -1
  103. package/dist/cjs/models/models_0.js.map +0 -1
  104. package/dist/cjs/package.json +0 -91
  105. package/dist/cjs/protocols/Aws_json1_1.js.map +0 -1
  106. package/dist/cjs/runtimeConfig.browser.js.map +0 -1
  107. package/dist/cjs/runtimeConfig.js.map +0 -1
  108. package/dist/cjs/runtimeConfig.native.js.map +0 -1
  109. package/dist/cjs/runtimeConfig.shared.js.map +0 -1
  110. package/dist/es/Textract.js.map +0 -1
  111. package/dist/es/TextractClient.js.map +0 -1
  112. package/dist/es/commands/AnalyzeDocumentCommand.js +0 -95
  113. package/dist/es/commands/AnalyzeDocumentCommand.js.map +0 -1
  114. package/dist/es/commands/AnalyzeExpenseCommand.js.map +0 -1
  115. package/dist/es/commands/DetectDocumentTextCommand.js +0 -75
  116. package/dist/es/commands/DetectDocumentTextCommand.js.map +0 -1
  117. package/dist/es/commands/GetDocumentAnalysisCommand.js +0 -109
  118. package/dist/es/commands/GetDocumentAnalysisCommand.js.map +0 -1
  119. package/dist/es/commands/GetDocumentTextDetectionCommand.js +0 -89
  120. package/dist/es/commands/GetDocumentTextDetectionCommand.js.map +0 -1
  121. package/dist/es/commands/StartDocumentAnalysisCommand.js +0 -82
  122. package/dist/es/commands/StartDocumentAnalysisCommand.js.map +0 -1
  123. package/dist/es/commands/StartDocumentTextDetectionCommand.js +0 -81
  124. package/dist/es/commands/StartDocumentTextDetectionCommand.js.map +0 -1
  125. package/dist/es/endpoints.js.map +0 -1
  126. package/dist/es/index.js +0 -11
  127. package/dist/es/index.js.map +0 -1
  128. package/dist/es/models/index.js +0 -2
  129. package/dist/es/models/index.js.map +0 -1
  130. package/dist/es/models/models_0.js.map +0 -1
  131. package/dist/es/package.json +0 -91
  132. package/dist/es/protocols/Aws_json1_1.js.map +0 -1
  133. package/dist/es/runtimeConfig.browser.js.map +0 -1
  134. package/dist/es/runtimeConfig.js.map +0 -1
  135. package/dist/es/runtimeConfig.native.js.map +0 -1
  136. package/dist/es/runtimeConfig.shared.js.map +0 -1
  137. package/dist/types/ts3.4/Textract.d.ts +0 -212
  138. package/dist/types/ts3.4/commands/AnalyzeDocumentCommand.d.ts +0 -65
  139. package/dist/types/ts3.4/commands/AnalyzeExpenseCommand.d.ts +0 -48
  140. package/dist/types/ts3.4/commands/DetectDocumentTextCommand.d.ts +0 -45
  141. package/dist/types/ts3.4/commands/GetDocumentAnalysisCommand.d.ts +0 -79
  142. package/dist/types/ts3.4/commands/GetDocumentTextDetectionCommand.d.ts +0 -59
  143. package/dist/types/ts3.4/commands/StartDocumentAnalysisCommand.d.ts +0 -52
  144. package/dist/types/ts3.4/commands/StartDocumentTextDetectionCommand.d.ts +0 -51
  145. package/dist/types/ts3.4/models/models_0.d.ts +0 -1347
  146. package/endpoints.ts +0 -57
  147. package/jest.config.js +0 -4
  148. package/models/models_0.ts +0 -1627
  149. package/protocols/Aws_json1_1.ts +0 -2060
  150. package/runtimeConfig.browser.ts +0 -40
  151. package/runtimeConfig.native.ts +0 -16
  152. package/runtimeConfig.shared.ts +0 -16
  153. package/runtimeConfig.ts +0 -45
  154. package/tsconfig.es.json +0 -12
  155. package/tsconfig.json +0 -32
package/TextractClient.ts DELETED
@@ -1,270 +0,0 @@
1
- import { AnalyzeDocumentCommandInput, AnalyzeDocumentCommandOutput } from "./commands/AnalyzeDocumentCommand";
2
- import { AnalyzeExpenseCommandInput, AnalyzeExpenseCommandOutput } from "./commands/AnalyzeExpenseCommand";
3
- import { DetectDocumentTextCommandInput, DetectDocumentTextCommandOutput } from "./commands/DetectDocumentTextCommand";
4
- import {
5
- GetDocumentAnalysisCommandInput,
6
- GetDocumentAnalysisCommandOutput,
7
- } from "./commands/GetDocumentAnalysisCommand";
8
- import {
9
- GetDocumentTextDetectionCommandInput,
10
- GetDocumentTextDetectionCommandOutput,
11
- } from "./commands/GetDocumentTextDetectionCommand";
12
- import {
13
- StartDocumentAnalysisCommandInput,
14
- StartDocumentAnalysisCommandOutput,
15
- } from "./commands/StartDocumentAnalysisCommand";
16
- import {
17
- StartDocumentTextDetectionCommandInput,
18
- StartDocumentTextDetectionCommandOutput,
19
- } from "./commands/StartDocumentTextDetectionCommand";
20
- import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
21
- import {
22
- EndpointsInputConfig,
23
- EndpointsResolvedConfig,
24
- RegionInputConfig,
25
- RegionResolvedConfig,
26
- resolveEndpointsConfig,
27
- resolveRegionConfig,
28
- } from "@aws-sdk/config-resolver";
29
- import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length";
30
- import {
31
- HostHeaderInputConfig,
32
- HostHeaderResolvedConfig,
33
- getHostHeaderPlugin,
34
- resolveHostHeaderConfig,
35
- } from "@aws-sdk/middleware-host-header";
36
- import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
37
- import { RetryInputConfig, RetryResolvedConfig, getRetryPlugin, resolveRetryConfig } from "@aws-sdk/middleware-retry";
38
- import {
39
- AwsAuthInputConfig,
40
- AwsAuthResolvedConfig,
41
- getAwsAuthPlugin,
42
- resolveAwsAuthConfig,
43
- } from "@aws-sdk/middleware-signing";
44
- import {
45
- UserAgentInputConfig,
46
- UserAgentResolvedConfig,
47
- getUserAgentPlugin,
48
- resolveUserAgentConfig,
49
- } from "@aws-sdk/middleware-user-agent";
50
- import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http";
51
- import {
52
- Client as __Client,
53
- SmithyConfiguration as __SmithyConfiguration,
54
- SmithyResolvedConfiguration as __SmithyResolvedConfiguration,
55
- } from "@aws-sdk/smithy-client";
56
- import {
57
- Provider,
58
- RegionInfoProvider,
59
- Credentials as __Credentials,
60
- Decoder as __Decoder,
61
- Encoder as __Encoder,
62
- Hash as __Hash,
63
- HashConstructor as __HashConstructor,
64
- HttpHandlerOptions as __HttpHandlerOptions,
65
- Logger as __Logger,
66
- Provider as __Provider,
67
- StreamCollector as __StreamCollector,
68
- UrlParser as __UrlParser,
69
- UserAgent as __UserAgent,
70
- } from "@aws-sdk/types";
71
-
72
- export type ServiceInputTypes =
73
- | AnalyzeDocumentCommandInput
74
- | AnalyzeExpenseCommandInput
75
- | DetectDocumentTextCommandInput
76
- | GetDocumentAnalysisCommandInput
77
- | GetDocumentTextDetectionCommandInput
78
- | StartDocumentAnalysisCommandInput
79
- | StartDocumentTextDetectionCommandInput;
80
-
81
- export type ServiceOutputTypes =
82
- | AnalyzeDocumentCommandOutput
83
- | AnalyzeExpenseCommandOutput
84
- | DetectDocumentTextCommandOutput
85
- | GetDocumentAnalysisCommandOutput
86
- | GetDocumentTextDetectionCommandOutput
87
- | StartDocumentAnalysisCommandOutput
88
- | StartDocumentTextDetectionCommandOutput;
89
-
90
- export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
91
- /**
92
- * The HTTP handler to use. Fetch in browser and Https in Nodejs.
93
- */
94
- requestHandler?: __HttpHandler;
95
-
96
- /**
97
- * A constructor for a class implementing the {@link __Hash} interface
98
- * that computes the SHA-256 HMAC or checksum of a string or binary buffer.
99
- * @internal
100
- */
101
- sha256?: __HashConstructor;
102
-
103
- /**
104
- * The function that will be used to convert strings into HTTP endpoints.
105
- * @internal
106
- */
107
- urlParser?: __UrlParser;
108
-
109
- /**
110
- * A function that can calculate the length of a request body.
111
- * @internal
112
- */
113
- bodyLengthChecker?: (body: any) => number | undefined;
114
-
115
- /**
116
- * A function that converts a stream into an array of bytes.
117
- * @internal
118
- */
119
- streamCollector?: __StreamCollector;
120
-
121
- /**
122
- * The function that will be used to convert a base64-encoded string to a byte array.
123
- * @internal
124
- */
125
- base64Decoder?: __Decoder;
126
-
127
- /**
128
- * The function that will be used to convert binary data to a base64-encoded string.
129
- * @internal
130
- */
131
- base64Encoder?: __Encoder;
132
-
133
- /**
134
- * The function that will be used to convert a UTF8-encoded string to a byte array.
135
- * @internal
136
- */
137
- utf8Decoder?: __Decoder;
138
-
139
- /**
140
- * The function that will be used to convert binary data to a UTF-8 encoded string.
141
- * @internal
142
- */
143
- utf8Encoder?: __Encoder;
144
-
145
- /**
146
- * The runtime environment.
147
- * @internal
148
- */
149
- runtime?: string;
150
-
151
- /**
152
- * Disable dyanamically changing the endpoint of the client based on the hostPrefix
153
- * trait of an operation.
154
- */
155
- disableHostPrefix?: boolean;
156
-
157
- /**
158
- * Value for how many times a request will be made at most in case of retry.
159
- */
160
- maxAttempts?: number | __Provider<number>;
161
-
162
- /**
163
- * Specifies which retry algorithm to use.
164
- */
165
- retryMode?: string | __Provider<string>;
166
-
167
- /**
168
- * Optional logger for logging debug/info/warn/error.
169
- */
170
- logger?: __Logger;
171
-
172
- /**
173
- * Unique service identifier.
174
- * @internal
175
- */
176
- serviceId?: string;
177
-
178
- /**
179
- * The AWS region to which this client will send requests
180
- */
181
- region?: string | __Provider<string>;
182
-
183
- /**
184
- * Default credentials provider; Not available in browser runtime.
185
- * @internal
186
- */
187
- credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;
188
-
189
- /**
190
- * Fetch related hostname, signing name or signing region with given region.
191
- * @internal
192
- */
193
- regionInfoProvider?: RegionInfoProvider;
194
-
195
- /**
196
- * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
197
- * @internal
198
- */
199
- defaultUserAgentProvider?: Provider<__UserAgent>;
200
- }
201
-
202
- type TextractClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
203
- ClientDefaults &
204
- RegionInputConfig &
205
- EndpointsInputConfig &
206
- RetryInputConfig &
207
- HostHeaderInputConfig &
208
- AwsAuthInputConfig &
209
- UserAgentInputConfig;
210
- /**
211
- * The configuration interface of TextractClient class constructor that set the region, credentials and other options.
212
- */
213
- export interface TextractClientConfig extends TextractClientConfigType {}
214
-
215
- type TextractClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
216
- Required<ClientDefaults> &
217
- RegionResolvedConfig &
218
- EndpointsResolvedConfig &
219
- RetryResolvedConfig &
220
- HostHeaderResolvedConfig &
221
- AwsAuthResolvedConfig &
222
- UserAgentResolvedConfig;
223
- /**
224
- * The resolved configuration interface of TextractClient class. This is resolved and normalized from the {@link TextractClientConfig | constructor configuration interface}.
225
- */
226
- export interface TextractClientResolvedConfig extends TextractClientResolvedConfigType {}
227
-
228
- /**
229
- * <p>Amazon Textract detects and analyzes text in documents and converts it
230
- * into machine-readable text. This is the API reference documentation for
231
- * Amazon Textract.</p>
232
- */
233
- export class TextractClient extends __Client<
234
- __HttpHandlerOptions,
235
- ServiceInputTypes,
236
- ServiceOutputTypes,
237
- TextractClientResolvedConfig
238
- > {
239
- /**
240
- * The resolved configuration of TextractClient class. This is resolved and normalized from the {@link TextractClientConfig | constructor configuration interface}.
241
- */
242
- readonly config: TextractClientResolvedConfig;
243
-
244
- constructor(configuration: TextractClientConfig) {
245
- let _config_0 = __getRuntimeConfig(configuration);
246
- let _config_1 = resolveRegionConfig(_config_0);
247
- let _config_2 = resolveEndpointsConfig(_config_1);
248
- let _config_3 = resolveRetryConfig(_config_2);
249
- let _config_4 = resolveHostHeaderConfig(_config_3);
250
- let _config_5 = resolveAwsAuthConfig(_config_4);
251
- let _config_6 = resolveUserAgentConfig(_config_5);
252
- super(_config_6);
253
- this.config = _config_6;
254
- this.middlewareStack.use(getRetryPlugin(this.config));
255
- this.middlewareStack.use(getContentLengthPlugin(this.config));
256
- this.middlewareStack.use(getHostHeaderPlugin(this.config));
257
- this.middlewareStack.use(getLoggerPlugin(this.config));
258
- this.middlewareStack.use(getAwsAuthPlugin(this.config));
259
- this.middlewareStack.use(getUserAgentPlugin(this.config));
260
- }
261
-
262
- /**
263
- * Destroy underlying resources, like sockets. It's usually not necessary to do this.
264
- * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
265
- * Otherwise, sockets might stay open for quite a long time before the server terminates them.
266
- */
267
- destroy(): void {
268
- super.destroy();
269
- }
270
- }
@@ -1,124 +0,0 @@
1
- import { ServiceInputTypes, ServiceOutputTypes, TextractClientResolvedConfig } from "../TextractClient";
2
- import { AnalyzeDocumentRequest, AnalyzeDocumentResponse } from "../models/models_0";
3
- import {
4
- deserializeAws_json1_1AnalyzeDocumentCommand,
5
- serializeAws_json1_1AnalyzeDocumentCommand,
6
- } from "../protocols/Aws_json1_1";
7
- import { getSerdePlugin } from "@aws-sdk/middleware-serde";
8
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
9
- import { Command as $Command } from "@aws-sdk/smithy-client";
10
- import {
11
- FinalizeHandlerArguments,
12
- Handler,
13
- HandlerExecutionContext,
14
- MiddlewareStack,
15
- HttpHandlerOptions as __HttpHandlerOptions,
16
- MetadataBearer as __MetadataBearer,
17
- SerdeContext as __SerdeContext,
18
- } from "@aws-sdk/types";
19
-
20
- export interface AnalyzeDocumentCommandInput extends AnalyzeDocumentRequest {}
21
- export interface AnalyzeDocumentCommandOutput extends AnalyzeDocumentResponse, __MetadataBearer {}
22
-
23
- /**
24
- * <p>Analyzes an input document for relationships between detected items. </p>
25
- * <p>The types of information returned are as follows: </p>
26
- * <ul>
27
- * <li>
28
- * <p>Form data (key-value pairs). The related information is returned in two <a>Block</a> objects, each of type <code>KEY_VALUE_SET</code>: a KEY
29
- * <code>Block</code> object and a VALUE <code>Block</code> object. For example,
30
- * <i>Name: Ana Silva Carolina</i> contains a key and value.
31
- * <i>Name:</i> is the key. <i>Ana Silva Carolina</i> is
32
- * the value.</p>
33
- * </li>
34
- * <li>
35
- * <p>Table and table cell data. A TABLE <code>Block</code> object contains information about a detected table. A CELL
36
- * <code>Block</code> object is returned for each cell in a table.</p>
37
- * </li>
38
- * <li>
39
- * <p>Lines and words of text. A LINE <code>Block</code> object contains one or more WORD <code>Block</code> objects.
40
- * All lines and words that are detected in the document are returned (including text that doesn't have a
41
- * relationship with the value of <code>FeatureTypes</code>). </p>
42
- * </li>
43
- * </ul>
44
- *
45
- * <p>Selection elements such as check boxes and option buttons (radio buttons) can be detected in form data and in tables.
46
- * A SELECTION_ELEMENT <code>Block</code> object contains information about a selection element,
47
- * including the selection status.</p>
48
- * <p>You can choose which type of analysis to perform by specifying the <code>FeatureTypes</code> list.
49
- * </p>
50
- * <p>The output is returned in a list of <code>Block</code> objects.</p>
51
- * <p>
52
- * <code>AnalyzeDocument</code> is a synchronous operation. To analyze documents
53
- * asynchronously, use <a>StartDocumentAnalysis</a>.</p>
54
- * <p>For more information, see <a href="https://docs.aws.amazon.com/textract/latest/dg/how-it-works-analyzing.html">Document Text Analysis</a>.</p>
55
- * @example
56
- * Use a bare-bones client and the command you need to make an API call.
57
- * ```javascript
58
- * import { TextractClient, AnalyzeDocumentCommand } from "@aws-sdk/client-textract"; // ES Modules import
59
- * // const { TextractClient, AnalyzeDocumentCommand } = require("@aws-sdk/client-textract"); // CommonJS import
60
- * const client = new TextractClient(config);
61
- * const command = new AnalyzeDocumentCommand(input);
62
- * const response = await client.send(command);
63
- * ```
64
- *
65
- * @see {@link AnalyzeDocumentCommandInput} for command's `input` shape.
66
- * @see {@link AnalyzeDocumentCommandOutput} for command's `response` shape.
67
- * @see {@link TextractClientResolvedConfig | config} for command's `input` shape.
68
- *
69
- */
70
- export class AnalyzeDocumentCommand extends $Command<
71
- AnalyzeDocumentCommandInput,
72
- AnalyzeDocumentCommandOutput,
73
- TextractClientResolvedConfig
74
- > {
75
- // Start section: command_properties
76
- // End section: command_properties
77
-
78
- constructor(readonly input: AnalyzeDocumentCommandInput) {
79
- // Start section: command_constructor
80
- super();
81
- // End section: command_constructor
82
- }
83
-
84
- /**
85
- * @internal
86
- */
87
- resolveMiddleware(
88
- clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
89
- configuration: TextractClientResolvedConfig,
90
- options?: __HttpHandlerOptions
91
- ): Handler<AnalyzeDocumentCommandInput, AnalyzeDocumentCommandOutput> {
92
- this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
93
-
94
- const stack = clientStack.concat(this.middlewareStack);
95
-
96
- const { logger } = configuration;
97
- const clientName = "TextractClient";
98
- const commandName = "AnalyzeDocumentCommand";
99
- const handlerExecutionContext: HandlerExecutionContext = {
100
- logger,
101
- clientName,
102
- commandName,
103
- inputFilterSensitiveLog: AnalyzeDocumentRequest.filterSensitiveLog,
104
- outputFilterSensitiveLog: AnalyzeDocumentResponse.filterSensitiveLog,
105
- };
106
- const { requestHandler } = configuration;
107
- return stack.resolve(
108
- (request: FinalizeHandlerArguments<any>) =>
109
- requestHandler.handle(request.request as __HttpRequest, options || {}),
110
- handlerExecutionContext
111
- );
112
- }
113
-
114
- private serialize(input: AnalyzeDocumentCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
115
- return serializeAws_json1_1AnalyzeDocumentCommand(input, context);
116
- }
117
-
118
- private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<AnalyzeDocumentCommandOutput> {
119
- return deserializeAws_json1_1AnalyzeDocumentCommand(output, context);
120
- }
121
-
122
- // Start section: command_body_extra
123
- // End section: command_body_extra
124
- }
@@ -1,107 +0,0 @@
1
- import { ServiceInputTypes, ServiceOutputTypes, TextractClientResolvedConfig } from "../TextractClient";
2
- import { AnalyzeExpenseRequest, AnalyzeExpenseResponse } from "../models/models_0";
3
- import {
4
- deserializeAws_json1_1AnalyzeExpenseCommand,
5
- serializeAws_json1_1AnalyzeExpenseCommand,
6
- } from "../protocols/Aws_json1_1";
7
- import { getSerdePlugin } from "@aws-sdk/middleware-serde";
8
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
9
- import { Command as $Command } from "@aws-sdk/smithy-client";
10
- import {
11
- FinalizeHandlerArguments,
12
- Handler,
13
- HandlerExecutionContext,
14
- MiddlewareStack,
15
- HttpHandlerOptions as __HttpHandlerOptions,
16
- MetadataBearer as __MetadataBearer,
17
- SerdeContext as __SerdeContext,
18
- } from "@aws-sdk/types";
19
-
20
- export interface AnalyzeExpenseCommandInput extends AnalyzeExpenseRequest {}
21
- export interface AnalyzeExpenseCommandOutput extends AnalyzeExpenseResponse, __MetadataBearer {}
22
-
23
- /**
24
- * <p>Analyzes an input document for financially related relationships between text.</p>
25
- * <p>Information is returned as <code>ExpenseDocuments</code> and seperated as follows.</p>
26
- * <ul>
27
- * <li>
28
- * <p>
29
- * <code>LineItemGroups</code>- A data set containing <code>LineItems</code> which
30
- * store information about the lines of text, such as an item purchased and its price on a receipt.</p>
31
- * </li>
32
- * <li>
33
- * <p>
34
- * <code>SummaryFields</code>- Contains all other information a receipt, such as header information
35
- * or the vendors name.</p>
36
- * </li>
37
- * </ul>
38
- * @example
39
- * Use a bare-bones client and the command you need to make an API call.
40
- * ```javascript
41
- * import { TextractClient, AnalyzeExpenseCommand } from "@aws-sdk/client-textract"; // ES Modules import
42
- * // const { TextractClient, AnalyzeExpenseCommand } = require("@aws-sdk/client-textract"); // CommonJS import
43
- * const client = new TextractClient(config);
44
- * const command = new AnalyzeExpenseCommand(input);
45
- * const response = await client.send(command);
46
- * ```
47
- *
48
- * @see {@link AnalyzeExpenseCommandInput} for command's `input` shape.
49
- * @see {@link AnalyzeExpenseCommandOutput} for command's `response` shape.
50
- * @see {@link TextractClientResolvedConfig | config} for command's `input` shape.
51
- *
52
- */
53
- export class AnalyzeExpenseCommand extends $Command<
54
- AnalyzeExpenseCommandInput,
55
- AnalyzeExpenseCommandOutput,
56
- TextractClientResolvedConfig
57
- > {
58
- // Start section: command_properties
59
- // End section: command_properties
60
-
61
- constructor(readonly input: AnalyzeExpenseCommandInput) {
62
- // Start section: command_constructor
63
- super();
64
- // End section: command_constructor
65
- }
66
-
67
- /**
68
- * @internal
69
- */
70
- resolveMiddleware(
71
- clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
72
- configuration: TextractClientResolvedConfig,
73
- options?: __HttpHandlerOptions
74
- ): Handler<AnalyzeExpenseCommandInput, AnalyzeExpenseCommandOutput> {
75
- this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
76
-
77
- const stack = clientStack.concat(this.middlewareStack);
78
-
79
- const { logger } = configuration;
80
- const clientName = "TextractClient";
81
- const commandName = "AnalyzeExpenseCommand";
82
- const handlerExecutionContext: HandlerExecutionContext = {
83
- logger,
84
- clientName,
85
- commandName,
86
- inputFilterSensitiveLog: AnalyzeExpenseRequest.filterSensitiveLog,
87
- outputFilterSensitiveLog: AnalyzeExpenseResponse.filterSensitiveLog,
88
- };
89
- const { requestHandler } = configuration;
90
- return stack.resolve(
91
- (request: FinalizeHandlerArguments<any>) =>
92
- requestHandler.handle(request.request as __HttpRequest, options || {}),
93
- handlerExecutionContext
94
- );
95
- }
96
-
97
- private serialize(input: AnalyzeExpenseCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
98
- return serializeAws_json1_1AnalyzeExpenseCommand(input, context);
99
- }
100
-
101
- private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<AnalyzeExpenseCommandOutput> {
102
- return deserializeAws_json1_1AnalyzeExpenseCommand(output, context);
103
- }
104
-
105
- // Start section: command_body_extra
106
- // End section: command_body_extra
107
- }
@@ -1,104 +0,0 @@
1
- import { ServiceInputTypes, ServiceOutputTypes, TextractClientResolvedConfig } from "../TextractClient";
2
- import { DetectDocumentTextRequest, DetectDocumentTextResponse } from "../models/models_0";
3
- import {
4
- deserializeAws_json1_1DetectDocumentTextCommand,
5
- serializeAws_json1_1DetectDocumentTextCommand,
6
- } from "../protocols/Aws_json1_1";
7
- import { getSerdePlugin } from "@aws-sdk/middleware-serde";
8
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
9
- import { Command as $Command } from "@aws-sdk/smithy-client";
10
- import {
11
- FinalizeHandlerArguments,
12
- Handler,
13
- HandlerExecutionContext,
14
- MiddlewareStack,
15
- HttpHandlerOptions as __HttpHandlerOptions,
16
- MetadataBearer as __MetadataBearer,
17
- SerdeContext as __SerdeContext,
18
- } from "@aws-sdk/types";
19
-
20
- export interface DetectDocumentTextCommandInput extends DetectDocumentTextRequest {}
21
- export interface DetectDocumentTextCommandOutput extends DetectDocumentTextResponse, __MetadataBearer {}
22
-
23
- /**
24
- * <p>Detects text in the input document. Amazon Textract can detect lines of text and the
25
- * words that make up a line of text. The input document must be an image in JPEG or PNG
26
- * format. <code>DetectDocumentText</code> returns the detected text in an array of <a>Block</a> objects. </p>
27
- * <p>Each document page has as an associated <code>Block</code> of type PAGE. Each PAGE <code>Block</code> object
28
- * is the parent of LINE <code>Block</code> objects that represent the lines of detected text on a page. A LINE <code>Block</code> object is
29
- * a parent for each word that makes up the line. Words are represented by <code>Block</code> objects of type WORD.</p>
30
- *
31
- * <p>
32
- * <code>DetectDocumentText</code> is a synchronous operation. To analyze documents
33
- * asynchronously, use <a>StartDocumentTextDetection</a>.</p>
34
- * <p>For more information, see <a href="https://docs.aws.amazon.com/textract/latest/dg/how-it-works-detecting.html">Document Text Detection</a>.</p>
35
- * @example
36
- * Use a bare-bones client and the command you need to make an API call.
37
- * ```javascript
38
- * import { TextractClient, DetectDocumentTextCommand } from "@aws-sdk/client-textract"; // ES Modules import
39
- * // const { TextractClient, DetectDocumentTextCommand } = require("@aws-sdk/client-textract"); // CommonJS import
40
- * const client = new TextractClient(config);
41
- * const command = new DetectDocumentTextCommand(input);
42
- * const response = await client.send(command);
43
- * ```
44
- *
45
- * @see {@link DetectDocumentTextCommandInput} for command's `input` shape.
46
- * @see {@link DetectDocumentTextCommandOutput} for command's `response` shape.
47
- * @see {@link TextractClientResolvedConfig | config} for command's `input` shape.
48
- *
49
- */
50
- export class DetectDocumentTextCommand extends $Command<
51
- DetectDocumentTextCommandInput,
52
- DetectDocumentTextCommandOutput,
53
- TextractClientResolvedConfig
54
- > {
55
- // Start section: command_properties
56
- // End section: command_properties
57
-
58
- constructor(readonly input: DetectDocumentTextCommandInput) {
59
- // Start section: command_constructor
60
- super();
61
- // End section: command_constructor
62
- }
63
-
64
- /**
65
- * @internal
66
- */
67
- resolveMiddleware(
68
- clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
69
- configuration: TextractClientResolvedConfig,
70
- options?: __HttpHandlerOptions
71
- ): Handler<DetectDocumentTextCommandInput, DetectDocumentTextCommandOutput> {
72
- this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
73
-
74
- const stack = clientStack.concat(this.middlewareStack);
75
-
76
- const { logger } = configuration;
77
- const clientName = "TextractClient";
78
- const commandName = "DetectDocumentTextCommand";
79
- const handlerExecutionContext: HandlerExecutionContext = {
80
- logger,
81
- clientName,
82
- commandName,
83
- inputFilterSensitiveLog: DetectDocumentTextRequest.filterSensitiveLog,
84
- outputFilterSensitiveLog: DetectDocumentTextResponse.filterSensitiveLog,
85
- };
86
- const { requestHandler } = configuration;
87
- return stack.resolve(
88
- (request: FinalizeHandlerArguments<any>) =>
89
- requestHandler.handle(request.request as __HttpRequest, options || {}),
90
- handlerExecutionContext
91
- );
92
- }
93
-
94
- private serialize(input: DetectDocumentTextCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
95
- return serializeAws_json1_1DetectDocumentTextCommand(input, context);
96
- }
97
-
98
- private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DetectDocumentTextCommandOutput> {
99
- return deserializeAws_json1_1DetectDocumentTextCommand(output, context);
100
- }
101
-
102
- // Start section: command_body_extra
103
- // End section: command_body_extra
104
- }