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