@aws-sdk/client-textract 3.41.0 → 3.46.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.
@@ -23,6 +23,17 @@ export var serializeAws_json1_1AnalyzeExpenseCommand = function (input, context)
23
23
  return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
24
24
  });
25
25
  }); };
26
+ export var serializeAws_json1_1AnalyzeIDCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
27
+ var headers, body;
28
+ return __generator(this, function (_a) {
29
+ headers = {
30
+ "content-type": "application/x-amz-json-1.1",
31
+ "x-amz-target": "Textract.AnalyzeID",
32
+ };
33
+ body = JSON.stringify(serializeAws_json1_1AnalyzeIDRequest(input, context));
34
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
35
+ });
36
+ }); };
26
37
  export var serializeAws_json1_1DetectDocumentTextCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
27
38
  var headers, body;
28
39
  return __generator(this, function (_a) {
@@ -348,6 +359,126 @@ var deserializeAws_json1_1AnalyzeExpenseCommandError = function (output, context
348
359
  }
349
360
  });
350
361
  }); };
362
+ export var deserializeAws_json1_1AnalyzeIDCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
363
+ var data, contents, response;
364
+ return __generator(this, function (_a) {
365
+ switch (_a.label) {
366
+ case 0:
367
+ if (output.statusCode >= 300) {
368
+ return [2, deserializeAws_json1_1AnalyzeIDCommandError(output, context)];
369
+ }
370
+ return [4, parseBody(output.body, context)];
371
+ case 1:
372
+ data = _a.sent();
373
+ contents = {};
374
+ contents = deserializeAws_json1_1AnalyzeIDResponse(data, context);
375
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
376
+ return [2, Promise.resolve(response)];
377
+ }
378
+ });
379
+ }); };
380
+ var deserializeAws_json1_1AnalyzeIDCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
381
+ var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, parsedBody, message;
382
+ var _m;
383
+ return __generator(this, function (_o) {
384
+ switch (_o.label) {
385
+ case 0:
386
+ _a = [__assign({}, output)];
387
+ _m = {};
388
+ return [4, parseBody(output.body, context)];
389
+ case 1:
390
+ parsedOutput = __assign.apply(void 0, _a.concat([(_m.body = _o.sent(), _m)]));
391
+ errorCode = "UnknownError";
392
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
393
+ _b = errorCode;
394
+ switch (_b) {
395
+ case "AccessDeniedException": return [3, 2];
396
+ case "com.amazonaws.textract#AccessDeniedException": return [3, 2];
397
+ case "BadDocumentException": return [3, 4];
398
+ case "com.amazonaws.textract#BadDocumentException": return [3, 4];
399
+ case "DocumentTooLargeException": return [3, 6];
400
+ case "com.amazonaws.textract#DocumentTooLargeException": return [3, 6];
401
+ case "InternalServerError": return [3, 8];
402
+ case "com.amazonaws.textract#InternalServerError": return [3, 8];
403
+ case "InvalidParameterException": return [3, 10];
404
+ case "com.amazonaws.textract#InvalidParameterException": return [3, 10];
405
+ case "InvalidS3ObjectException": return [3, 12];
406
+ case "com.amazonaws.textract#InvalidS3ObjectException": return [3, 12];
407
+ case "ProvisionedThroughputExceededException": return [3, 14];
408
+ case "com.amazonaws.textract#ProvisionedThroughputExceededException": return [3, 14];
409
+ case "ThrottlingException": return [3, 16];
410
+ case "com.amazonaws.textract#ThrottlingException": return [3, 16];
411
+ case "UnsupportedDocumentException": return [3, 18];
412
+ case "com.amazonaws.textract#UnsupportedDocumentException": return [3, 18];
413
+ }
414
+ return [3, 20];
415
+ case 2:
416
+ _c = [{}];
417
+ return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
418
+ case 3:
419
+ response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
420
+ return [3, 21];
421
+ case 4:
422
+ _d = [{}];
423
+ return [4, deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context)];
424
+ case 5:
425
+ response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
426
+ return [3, 21];
427
+ case 6:
428
+ _e = [{}];
429
+ return [4, deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context)];
430
+ case 7:
431
+ response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
432
+ return [3, 21];
433
+ case 8:
434
+ _f = [{}];
435
+ return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
436
+ case 9:
437
+ response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
438
+ return [3, 21];
439
+ case 10:
440
+ _g = [{}];
441
+ return [4, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];
442
+ case 11:
443
+ response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
444
+ return [3, 21];
445
+ case 12:
446
+ _h = [{}];
447
+ return [4, deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)];
448
+ case 13:
449
+ response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
450
+ return [3, 21];
451
+ case 14:
452
+ _j = [{}];
453
+ return [4, deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)];
454
+ case 15:
455
+ response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
456
+ return [3, 21];
457
+ case 16:
458
+ _k = [{}];
459
+ return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
460
+ case 17:
461
+ response = __assign.apply(void 0, [__assign.apply(void 0, _k.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
462
+ return [3, 21];
463
+ case 18:
464
+ _l = [{}];
465
+ return [4, deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context)];
466
+ case 19:
467
+ response = __assign.apply(void 0, [__assign.apply(void 0, _l.concat([(_o.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
468
+ return [3, 21];
469
+ case 20:
470
+ parsedBody = parsedOutput.body;
471
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
472
+ response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
473
+ _o.label = 21;
474
+ case 21:
475
+ message = response.message || response.Message || errorCode;
476
+ response.message = message;
477
+ delete response.Message;
478
+ return [2, Promise.reject(Object.assign(new Error(message), response))];
479
+ }
480
+ });
481
+ }); };
351
482
  export var deserializeAws_json1_1DetectDocumentTextCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
352
483
  var data, contents, response;
353
484
  return __generator(this, function (_a) {
@@ -1374,6 +1505,12 @@ var serializeAws_json1_1AnalyzeExpenseRequest = function (input, context) {
1374
1505
  return __assign({}, (input.Document !== undefined &&
1375
1506
  input.Document !== null && { Document: serializeAws_json1_1Document(input.Document, context) }));
1376
1507
  };
1508
+ var serializeAws_json1_1AnalyzeIDRequest = function (input, context) {
1509
+ return __assign({}, (input.DocumentPages !== undefined &&
1510
+ input.DocumentPages !== null && {
1511
+ DocumentPages: serializeAws_json1_1DocumentPages(input.DocumentPages, context),
1512
+ }));
1513
+ };
1377
1514
  var serializeAws_json1_1ContentClassifiers = function (input, context) {
1378
1515
  return input
1379
1516
  .filter(function (e) { return e != null; })
@@ -1396,6 +1533,16 @@ var serializeAws_json1_1DocumentLocation = function (input, context) {
1396
1533
  return __assign({}, (input.S3Object !== undefined &&
1397
1534
  input.S3Object !== null && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }));
1398
1535
  };
1536
+ var serializeAws_json1_1DocumentPages = function (input, context) {
1537
+ return input
1538
+ .filter(function (e) { return e != null; })
1539
+ .map(function (entry) {
1540
+ if (entry === null) {
1541
+ return null;
1542
+ }
1543
+ return serializeAws_json1_1Document(entry, context);
1544
+ });
1545
+ };
1399
1546
  var serializeAws_json1_1FeatureTypes = function (input, context) {
1400
1547
  return input
1401
1548
  .filter(function (e) { return e != null; })
@@ -1501,6 +1648,26 @@ var deserializeAws_json1_1AnalyzeExpenseResponse = function (output, context) {
1501
1648
  : undefined,
1502
1649
  };
1503
1650
  };
1651
+ var deserializeAws_json1_1AnalyzeIDDetections = function (output, context) {
1652
+ return {
1653
+ Confidence: __limitedParseFloat32(output.Confidence),
1654
+ NormalizedValue: output.NormalizedValue !== undefined && output.NormalizedValue !== null
1655
+ ? deserializeAws_json1_1NormalizedValue(output.NormalizedValue, context)
1656
+ : undefined,
1657
+ Text: __expectString(output.Text),
1658
+ };
1659
+ };
1660
+ var deserializeAws_json1_1AnalyzeIDResponse = function (output, context) {
1661
+ return {
1662
+ AnalyzeIDModelVersion: __expectString(output.AnalyzeIDModelVersion),
1663
+ DocumentMetadata: output.DocumentMetadata !== undefined && output.DocumentMetadata !== null
1664
+ ? deserializeAws_json1_1DocumentMetadata(output.DocumentMetadata, context)
1665
+ : undefined,
1666
+ IdentityDocuments: output.IdentityDocuments !== undefined && output.IdentityDocuments !== null
1667
+ ? deserializeAws_json1_1IdentityDocumentList(output.IdentityDocuments, context)
1668
+ : undefined,
1669
+ };
1670
+ };
1504
1671
  var deserializeAws_json1_1BadDocumentException = function (output, context) {
1505
1672
  return {
1506
1673
  Code: __expectString(output.Code),
@@ -1739,6 +1906,44 @@ var deserializeAws_json1_1IdempotentParameterMismatchException = function (outpu
1739
1906
  Message: __expectString(output.Message),
1740
1907
  };
1741
1908
  };
1909
+ var deserializeAws_json1_1IdentityDocument = function (output, context) {
1910
+ return {
1911
+ DocumentIndex: __expectInt32(output.DocumentIndex),
1912
+ IdentityDocumentFields: output.IdentityDocumentFields !== undefined && output.IdentityDocumentFields !== null
1913
+ ? deserializeAws_json1_1IdentityDocumentFieldList(output.IdentityDocumentFields, context)
1914
+ : undefined,
1915
+ };
1916
+ };
1917
+ var deserializeAws_json1_1IdentityDocumentField = function (output, context) {
1918
+ return {
1919
+ Type: output.Type !== undefined && output.Type !== null
1920
+ ? deserializeAws_json1_1AnalyzeIDDetections(output.Type, context)
1921
+ : undefined,
1922
+ ValueDetection: output.ValueDetection !== undefined && output.ValueDetection !== null
1923
+ ? deserializeAws_json1_1AnalyzeIDDetections(output.ValueDetection, context)
1924
+ : undefined,
1925
+ };
1926
+ };
1927
+ var deserializeAws_json1_1IdentityDocumentFieldList = function (output, context) {
1928
+ return (output || [])
1929
+ .filter(function (e) { return e != null; })
1930
+ .map(function (entry) {
1931
+ if (entry === null) {
1932
+ return null;
1933
+ }
1934
+ return deserializeAws_json1_1IdentityDocumentField(entry, context);
1935
+ });
1936
+ };
1937
+ var deserializeAws_json1_1IdentityDocumentList = function (output, context) {
1938
+ return (output || [])
1939
+ .filter(function (e) { return e != null; })
1940
+ .map(function (entry) {
1941
+ if (entry === null) {
1942
+ return null;
1943
+ }
1944
+ return deserializeAws_json1_1IdentityDocument(entry, context);
1945
+ });
1946
+ };
1742
1947
  var deserializeAws_json1_1IdList = function (output, context) {
1743
1948
  return (output || [])
1744
1949
  .filter(function (e) { return e != null; })
@@ -1820,6 +2025,12 @@ var deserializeAws_json1_1LineItemList = function (output, context) {
1820
2025
  return deserializeAws_json1_1LineItemFields(entry, context);
1821
2026
  });
1822
2027
  };
2028
+ var deserializeAws_json1_1NormalizedValue = function (output, context) {
2029
+ return {
2030
+ Value: __expectString(output.Value),
2031
+ ValueType: __expectString(output.ValueType),
2032
+ };
2033
+ };
1823
2034
  var deserializeAws_json1_1Pages = function (output, context) {
1824
2035
  return (output || [])
1825
2036
  .filter(function (e) { return e != null; })
@@ -12,10 +12,8 @@ import { calculateBodyLength } from "@aws-sdk/util-body-length-node";
12
12
  import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
13
13
  import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node";
14
14
  import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
15
- import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client";
16
15
  export var getRuntimeConfig = function (config) {
17
16
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
18
- emitWarningIfUnsupportedVersion(process.version);
19
17
  var clientSharedValues = getSharedRuntimeConfig(config);
20
18
  return __assign(__assign(__assign({}, clientSharedValues), config), { runtime: "node", base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : fromBase64, base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : toBase64, bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : calculateBodyLength, credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : decorateDefaultCredentialProvider(credentialDefaultProvider), defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new NodeHttpHandler(), retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : Hash.bind(null, "sha256"), streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : streamCollector, useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : fromUtf8, utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : toUtf8 });
21
19
  };
@@ -1,6 +1,7 @@
1
1
  import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
2
2
  import { AnalyzeDocumentCommandInput, AnalyzeDocumentCommandOutput } from "./commands/AnalyzeDocumentCommand";
3
3
  import { AnalyzeExpenseCommandInput, AnalyzeExpenseCommandOutput } from "./commands/AnalyzeExpenseCommand";
4
+ import { AnalyzeIDCommandInput, AnalyzeIDCommandOutput } from "./commands/AnalyzeIDCommand";
4
5
  import { DetectDocumentTextCommandInput, DetectDocumentTextCommandOutput } from "./commands/DetectDocumentTextCommand";
5
6
  import { GetDocumentAnalysisCommandInput, GetDocumentAnalysisCommandOutput } from "./commands/GetDocumentAnalysisCommand";
6
7
  import { GetDocumentTextDetectionCommandInput, GetDocumentTextDetectionCommandOutput } from "./commands/GetDocumentTextDetectionCommand";
@@ -52,7 +53,8 @@ export declare class Textract extends TextractClient {
52
53
  analyzeDocument(args: AnalyzeDocumentCommandInput, cb: (err: any, data?: AnalyzeDocumentCommandOutput) => void): void;
53
54
  analyzeDocument(args: AnalyzeDocumentCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: AnalyzeDocumentCommandOutput) => void): void;
54
55
  /**
55
- * <p>Analyzes an input document for financially related relationships between text.</p>
56
+ * <p>
57
+ * <code>AnalyzeExpense</code> synchronously analyzes an input document for financially related relationships between text.</p>
56
58
  * <p>Information is returned as <code>ExpenseDocuments</code> and seperated as follows.</p>
57
59
  * <ul>
58
60
  * <li>
@@ -70,6 +72,14 @@ export declare class Textract extends TextractClient {
70
72
  analyzeExpense(args: AnalyzeExpenseCommandInput, options?: __HttpHandlerOptions): Promise<AnalyzeExpenseCommandOutput>;
71
73
  analyzeExpense(args: AnalyzeExpenseCommandInput, cb: (err: any, data?: AnalyzeExpenseCommandOutput) => void): void;
72
74
  analyzeExpense(args: AnalyzeExpenseCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: AnalyzeExpenseCommandOutput) => void): void;
75
+ /**
76
+ * <p>Analyzes identity documents for relevant information. This information is extracted
77
+ * and returned as <code>IdentityDocumentFields</code>, which records both the normalized
78
+ * field and value of the extracted text.</p>
79
+ */
80
+ analyzeID(args: AnalyzeIDCommandInput, options?: __HttpHandlerOptions): Promise<AnalyzeIDCommandOutput>;
81
+ analyzeID(args: AnalyzeIDCommandInput, cb: (err: any, data?: AnalyzeIDCommandOutput) => void): void;
82
+ analyzeID(args: AnalyzeIDCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: AnalyzeIDCommandOutput) => void): void;
73
83
  /**
74
84
  * <p>Detects text in the input document. Amazon Textract can detect lines of text and the
75
85
  * words that make up a line of text. The input document must be an image in JPEG or PNG
@@ -8,6 +8,7 @@ import { Client as __Client, SmithyConfiguration as __SmithyConfiguration, Smith
8
8
  import { Credentials as __Credentials, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, RegionInfoProvider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@aws-sdk/types";
9
9
  import { AnalyzeDocumentCommandInput, AnalyzeDocumentCommandOutput } from "./commands/AnalyzeDocumentCommand";
10
10
  import { AnalyzeExpenseCommandInput, AnalyzeExpenseCommandOutput } from "./commands/AnalyzeExpenseCommand";
11
+ import { AnalyzeIDCommandInput, AnalyzeIDCommandOutput } from "./commands/AnalyzeIDCommand";
11
12
  import { DetectDocumentTextCommandInput, DetectDocumentTextCommandOutput } from "./commands/DetectDocumentTextCommand";
12
13
  import { GetDocumentAnalysisCommandInput, GetDocumentAnalysisCommandOutput } from "./commands/GetDocumentAnalysisCommand";
13
14
  import { GetDocumentTextDetectionCommandInput, GetDocumentTextDetectionCommandOutput } from "./commands/GetDocumentTextDetectionCommand";
@@ -15,8 +16,8 @@ import { GetExpenseAnalysisCommandInput, GetExpenseAnalysisCommandOutput } from
15
16
  import { StartDocumentAnalysisCommandInput, StartDocumentAnalysisCommandOutput } from "./commands/StartDocumentAnalysisCommand";
16
17
  import { StartDocumentTextDetectionCommandInput, StartDocumentTextDetectionCommandOutput } from "./commands/StartDocumentTextDetectionCommand";
17
18
  import { StartExpenseAnalysisCommandInput, StartExpenseAnalysisCommandOutput } from "./commands/StartExpenseAnalysisCommand";
18
- export declare type ServiceInputTypes = AnalyzeDocumentCommandInput | AnalyzeExpenseCommandInput | DetectDocumentTextCommandInput | GetDocumentAnalysisCommandInput | GetDocumentTextDetectionCommandInput | GetExpenseAnalysisCommandInput | StartDocumentAnalysisCommandInput | StartDocumentTextDetectionCommandInput | StartExpenseAnalysisCommandInput;
19
- export declare type ServiceOutputTypes = AnalyzeDocumentCommandOutput | AnalyzeExpenseCommandOutput | DetectDocumentTextCommandOutput | GetDocumentAnalysisCommandOutput | GetDocumentTextDetectionCommandOutput | GetExpenseAnalysisCommandOutput | StartDocumentAnalysisCommandOutput | StartDocumentTextDetectionCommandOutput | StartExpenseAnalysisCommandOutput;
19
+ export declare type ServiceInputTypes = AnalyzeDocumentCommandInput | AnalyzeExpenseCommandInput | AnalyzeIDCommandInput | DetectDocumentTextCommandInput | GetDocumentAnalysisCommandInput | GetDocumentTextDetectionCommandInput | GetExpenseAnalysisCommandInput | StartDocumentAnalysisCommandInput | StartDocumentTextDetectionCommandInput | StartExpenseAnalysisCommandInput;
20
+ export declare type ServiceOutputTypes = AnalyzeDocumentCommandOutput | AnalyzeExpenseCommandOutput | AnalyzeIDCommandOutput | DetectDocumentTextCommandOutput | GetDocumentAnalysisCommandOutput | GetDocumentTextDetectionCommandOutput | GetExpenseAnalysisCommandOutput | StartDocumentAnalysisCommandOutput | StartDocumentTextDetectionCommandOutput | StartExpenseAnalysisCommandOutput;
20
21
  export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
21
22
  /**
22
23
  * The HTTP handler to use. Fetch in browser and Https in Nodejs.
@@ -7,7 +7,8 @@ export interface AnalyzeExpenseCommandInput extends AnalyzeExpenseRequest {
7
7
  export interface AnalyzeExpenseCommandOutput extends AnalyzeExpenseResponse, __MetadataBearer {
8
8
  }
9
9
  /**
10
- * <p>Analyzes an input document for financially related relationships between text.</p>
10
+ * <p>
11
+ * <code>AnalyzeExpense</code> synchronously analyzes an input document for financially related relationships between text.</p>
11
12
  * <p>Information is returned as <code>ExpenseDocuments</code> and seperated as follows.</p>
12
13
  * <ul>
13
14
  * <li>
@@ -0,0 +1,37 @@
1
+ import { Command as $Command } from "@aws-sdk/smithy-client";
2
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
3
+ import { AnalyzeIDRequest, AnalyzeIDResponse } from "../models/models_0";
4
+ import { ServiceInputTypes, ServiceOutputTypes, TextractClientResolvedConfig } from "../TextractClient";
5
+ export interface AnalyzeIDCommandInput extends AnalyzeIDRequest {
6
+ }
7
+ export interface AnalyzeIDCommandOutput extends AnalyzeIDResponse, __MetadataBearer {
8
+ }
9
+ /**
10
+ * <p>Analyzes identity documents for relevant information. This information is extracted
11
+ * and returned as <code>IdentityDocumentFields</code>, which records both the normalized
12
+ * field and value of the extracted text.</p>
13
+ * @example
14
+ * Use a bare-bones client and the command you need to make an API call.
15
+ * ```javascript
16
+ * import { TextractClient, AnalyzeIDCommand } from "@aws-sdk/client-textract"; // ES Modules import
17
+ * // const { TextractClient, AnalyzeIDCommand } = require("@aws-sdk/client-textract"); // CommonJS import
18
+ * const client = new TextractClient(config);
19
+ * const command = new AnalyzeIDCommand(input);
20
+ * const response = await client.send(command);
21
+ * ```
22
+ *
23
+ * @see {@link AnalyzeIDCommandInput} for command's `input` shape.
24
+ * @see {@link AnalyzeIDCommandOutput} for command's `response` shape.
25
+ * @see {@link TextractClientResolvedConfig | config} for TextractClient's `config` shape.
26
+ *
27
+ */
28
+ export declare class AnalyzeIDCommand extends $Command<AnalyzeIDCommandInput, AnalyzeIDCommandOutput, TextractClientResolvedConfig> {
29
+ readonly input: AnalyzeIDCommandInput;
30
+ constructor(input: AnalyzeIDCommandInput);
31
+ /**
32
+ * @internal
33
+ */
34
+ resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: TextractClientResolvedConfig, options?: __HttpHandlerOptions): Handler<AnalyzeIDCommandInput, AnalyzeIDCommandOutput>;
35
+ private serialize;
36
+ private deserialize;
37
+ }
@@ -1,5 +1,6 @@
1
1
  export * from "./AnalyzeDocumentCommand";
2
2
  export * from "./AnalyzeExpenseCommand";
3
+ export * from "./AnalyzeIDCommand";
3
4
  export * from "./DetectDocumentTextCommand";
4
5
  export * from "./GetDocumentAnalysisCommand";
5
6
  export * from "./GetDocumentTextDetectionCommand";
@@ -702,7 +702,7 @@ export declare namespace ThrottlingException {
702
702
  }
703
703
  /**
704
704
  * <p>The format of the input document isn't supported. Documents for synchronous operations can be in
705
- * PNG or JPEG format. Documents for asynchronous operations can also be in PDF format.</p>
705
+ * PNG or JPEG format only. Documents for asynchronous operations can be in PDF format.</p>
706
706
  */
707
707
  export interface UnsupportedDocumentException extends __SmithyException, $MetadataBearer {
708
708
  name: "UnsupportedDocumentException";
@@ -789,7 +789,7 @@ export declare namespace ExpenseType {
789
789
  }
790
790
  /**
791
791
  * <p>Breakdown of detected information, seperated into
792
- * the catagories Type, LableDetection, and ValueDetection</p>
792
+ * the catagories Type, LabelDetection, and ValueDetection</p>
793
793
  */
794
794
  export interface ExpenseField {
795
795
  /**
@@ -889,6 +889,127 @@ export declare namespace AnalyzeExpenseResponse {
889
889
  */
890
890
  const filterSensitiveLog: (obj: AnalyzeExpenseResponse) => any;
891
891
  }
892
+ export interface AnalyzeIDRequest {
893
+ /**
894
+ * <p>The document being passed to AnalyzeID.</p>
895
+ */
896
+ DocumentPages: Document[] | undefined;
897
+ }
898
+ export declare namespace AnalyzeIDRequest {
899
+ /**
900
+ * @internal
901
+ */
902
+ const filterSensitiveLog: (obj: AnalyzeIDRequest) => any;
903
+ }
904
+ export declare enum ValueType {
905
+ DATE = "DATE"
906
+ }
907
+ /**
908
+ * <p>Contains information relating to dates in a document, including the type
909
+ * of value, and the value.</p>
910
+ */
911
+ export interface NormalizedValue {
912
+ /**
913
+ * <p>The value of the date, written as Year-Month-DayTHour:Minute:Second.</p>
914
+ */
915
+ Value?: string;
916
+ /**
917
+ * <p>The normalized type of the value detected. In this case, DATE.</p>
918
+ */
919
+ ValueType?: ValueType | string;
920
+ }
921
+ export declare namespace NormalizedValue {
922
+ /**
923
+ * @internal
924
+ */
925
+ const filterSensitiveLog: (obj: NormalizedValue) => any;
926
+ }
927
+ /**
928
+ * <p>Used to contain the information detected by an AnalyzeID operation.</p>
929
+ */
930
+ export interface AnalyzeIDDetections {
931
+ /**
932
+ * <p>Text of either the normalized field or value associated with it.</p>
933
+ */
934
+ Text: string | undefined;
935
+ /**
936
+ * <p>Only returned for dates, returns the type of value detected and the date
937
+ * written in a more machine readable way.</p>
938
+ */
939
+ NormalizedValue?: NormalizedValue;
940
+ /**
941
+ * <p>The confidence score of the detected text.</p>
942
+ */
943
+ Confidence?: number;
944
+ }
945
+ export declare namespace AnalyzeIDDetections {
946
+ /**
947
+ * @internal
948
+ */
949
+ const filterSensitiveLog: (obj: AnalyzeIDDetections) => any;
950
+ }
951
+ /**
952
+ * <p>Structure containing both the normalized type of the extracted information
953
+ * and the text associated with it. These are extracted as Type and Value respectively.</p>
954
+ */
955
+ export interface IdentityDocumentField {
956
+ /**
957
+ * <p>Used to contain the information detected by an AnalyzeID operation.</p>
958
+ */
959
+ Type?: AnalyzeIDDetections;
960
+ /**
961
+ * <p>Used to contain the information detected by an AnalyzeID operation.</p>
962
+ */
963
+ ValueDetection?: AnalyzeIDDetections;
964
+ }
965
+ export declare namespace IdentityDocumentField {
966
+ /**
967
+ * @internal
968
+ */
969
+ const filterSensitiveLog: (obj: IdentityDocumentField) => any;
970
+ }
971
+ /**
972
+ * <p>The structure that lists each document processed in an AnalyzeID operation.</p>
973
+ */
974
+ export interface IdentityDocument {
975
+ /**
976
+ * <p>Denotes the placement of a document in the IdentityDocument list. The first document
977
+ * is marked 1, the second 2 and so on.</p>
978
+ */
979
+ DocumentIndex?: number;
980
+ /**
981
+ * <p>The structure used to record information extracted from identity documents.
982
+ * Contains both normalized field and value of the extracted text.</p>
983
+ */
984
+ IdentityDocumentFields?: IdentityDocumentField[];
985
+ }
986
+ export declare namespace IdentityDocument {
987
+ /**
988
+ * @internal
989
+ */
990
+ const filterSensitiveLog: (obj: IdentityDocument) => any;
991
+ }
992
+ export interface AnalyzeIDResponse {
993
+ /**
994
+ * <p>The list of documents processed by AnalyzeID. Includes a number denoting their
995
+ * place in the list and the response structure for the document.</p>
996
+ */
997
+ IdentityDocuments?: IdentityDocument[];
998
+ /**
999
+ * <p>Information about the input document.</p>
1000
+ */
1001
+ DocumentMetadata?: DocumentMetadata;
1002
+ /**
1003
+ * <p>The version of the AnalyzeIdentity API being used to process documents.</p>
1004
+ */
1005
+ AnalyzeIDModelVersion?: string;
1006
+ }
1007
+ export declare namespace AnalyzeIDResponse {
1008
+ /**
1009
+ * @internal
1010
+ */
1011
+ const filterSensitiveLog: (obj: AnalyzeIDResponse) => any;
1012
+ }
892
1013
  export interface DetectDocumentTextRequest {
893
1014
  /**
894
1015
  * <p>The input document as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI
@@ -2,6 +2,7 @@ import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@a
2
2
  import { SerdeContext as __SerdeContext } from "@aws-sdk/types";
3
3
  import { AnalyzeDocumentCommandInput, AnalyzeDocumentCommandOutput } from "../commands/AnalyzeDocumentCommand";
4
4
  import { AnalyzeExpenseCommandInput, AnalyzeExpenseCommandOutput } from "../commands/AnalyzeExpenseCommand";
5
+ import { AnalyzeIDCommandInput, AnalyzeIDCommandOutput } from "../commands/AnalyzeIDCommand";
5
6
  import { DetectDocumentTextCommandInput, DetectDocumentTextCommandOutput } from "../commands/DetectDocumentTextCommand";
6
7
  import { GetDocumentAnalysisCommandInput, GetDocumentAnalysisCommandOutput } from "../commands/GetDocumentAnalysisCommand";
7
8
  import { GetDocumentTextDetectionCommandInput, GetDocumentTextDetectionCommandOutput } from "../commands/GetDocumentTextDetectionCommand";
@@ -11,6 +12,7 @@ import { StartDocumentTextDetectionCommandInput, StartDocumentTextDetectionComma
11
12
  import { StartExpenseAnalysisCommandInput, StartExpenseAnalysisCommandOutput } from "../commands/StartExpenseAnalysisCommand";
12
13
  export declare const serializeAws_json1_1AnalyzeDocumentCommand: (input: AnalyzeDocumentCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
13
14
  export declare const serializeAws_json1_1AnalyzeExpenseCommand: (input: AnalyzeExpenseCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
15
+ export declare const serializeAws_json1_1AnalyzeIDCommand: (input: AnalyzeIDCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
14
16
  export declare const serializeAws_json1_1DetectDocumentTextCommand: (input: DetectDocumentTextCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
15
17
  export declare const serializeAws_json1_1GetDocumentAnalysisCommand: (input: GetDocumentAnalysisCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
16
18
  export declare const serializeAws_json1_1GetDocumentTextDetectionCommand: (input: GetDocumentTextDetectionCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
@@ -20,6 +22,7 @@ export declare const serializeAws_json1_1StartDocumentTextDetectionCommand: (inp
20
22
  export declare const serializeAws_json1_1StartExpenseAnalysisCommand: (input: StartExpenseAnalysisCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
21
23
  export declare const deserializeAws_json1_1AnalyzeDocumentCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<AnalyzeDocumentCommandOutput>;
22
24
  export declare const deserializeAws_json1_1AnalyzeExpenseCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<AnalyzeExpenseCommandOutput>;
25
+ export declare const deserializeAws_json1_1AnalyzeIDCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<AnalyzeIDCommandOutput>;
23
26
  export declare const deserializeAws_json1_1DetectDocumentTextCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<DetectDocumentTextCommandOutput>;
24
27
  export declare const deserializeAws_json1_1GetDocumentAnalysisCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetDocumentAnalysisCommandOutput>;
25
28
  export declare const deserializeAws_json1_1GetDocumentTextDetectionCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<GetDocumentTextDetectionCommandOutput>;
@@ -1,6 +1,7 @@
1
1
  import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
2
2
  import { AnalyzeDocumentCommandInput, AnalyzeDocumentCommandOutput } from "./commands/AnalyzeDocumentCommand";
3
3
  import { AnalyzeExpenseCommandInput, AnalyzeExpenseCommandOutput } from "./commands/AnalyzeExpenseCommand";
4
+ import { AnalyzeIDCommandInput, AnalyzeIDCommandOutput } from "./commands/AnalyzeIDCommand";
4
5
  import { DetectDocumentTextCommandInput, DetectDocumentTextCommandOutput } from "./commands/DetectDocumentTextCommand";
5
6
  import { GetDocumentAnalysisCommandInput, GetDocumentAnalysisCommandOutput } from "./commands/GetDocumentAnalysisCommand";
6
7
  import { GetDocumentTextDetectionCommandInput, GetDocumentTextDetectionCommandOutput } from "./commands/GetDocumentTextDetectionCommand";
@@ -20,6 +21,10 @@ export declare class Textract extends TextractClient {
20
21
  analyzeExpense(args: AnalyzeExpenseCommandInput, cb: (err: any, data?: AnalyzeExpenseCommandOutput) => void): void;
21
22
  analyzeExpense(args: AnalyzeExpenseCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: AnalyzeExpenseCommandOutput) => void): void;
22
23
 
24
+ analyzeID(args: AnalyzeIDCommandInput, options?: __HttpHandlerOptions): Promise<AnalyzeIDCommandOutput>;
25
+ analyzeID(args: AnalyzeIDCommandInput, cb: (err: any, data?: AnalyzeIDCommandOutput) => void): void;
26
+ analyzeID(args: AnalyzeIDCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: AnalyzeIDCommandOutput) => void): void;
27
+
23
28
  detectDocumentText(args: DetectDocumentTextCommandInput, options?: __HttpHandlerOptions): Promise<DetectDocumentTextCommandOutput>;
24
29
  detectDocumentText(args: DetectDocumentTextCommandInput, cb: (err: any, data?: DetectDocumentTextCommandOutput) => void): void;
25
30
  detectDocumentText(args: DetectDocumentTextCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DetectDocumentTextCommandOutput) => void): void;
@@ -8,6 +8,7 @@ import { Client as __Client, SmithyConfiguration as __SmithyConfiguration, Smith
8
8
  import { Credentials as __Credentials, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, RegionInfoProvider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@aws-sdk/types";
9
9
  import { AnalyzeDocumentCommandInput, AnalyzeDocumentCommandOutput } from "./commands/AnalyzeDocumentCommand";
10
10
  import { AnalyzeExpenseCommandInput, AnalyzeExpenseCommandOutput } from "./commands/AnalyzeExpenseCommand";
11
+ import { AnalyzeIDCommandInput, AnalyzeIDCommandOutput } from "./commands/AnalyzeIDCommand";
11
12
  import { DetectDocumentTextCommandInput, DetectDocumentTextCommandOutput } from "./commands/DetectDocumentTextCommand";
12
13
  import { GetDocumentAnalysisCommandInput, GetDocumentAnalysisCommandOutput } from "./commands/GetDocumentAnalysisCommand";
13
14
  import { GetDocumentTextDetectionCommandInput, GetDocumentTextDetectionCommandOutput } from "./commands/GetDocumentTextDetectionCommand";
@@ -15,8 +16,8 @@ import { GetExpenseAnalysisCommandInput, GetExpenseAnalysisCommandOutput } from
15
16
  import { StartDocumentAnalysisCommandInput, StartDocumentAnalysisCommandOutput } from "./commands/StartDocumentAnalysisCommand";
16
17
  import { StartDocumentTextDetectionCommandInput, StartDocumentTextDetectionCommandOutput } from "./commands/StartDocumentTextDetectionCommand";
17
18
  import { StartExpenseAnalysisCommandInput, StartExpenseAnalysisCommandOutput } from "./commands/StartExpenseAnalysisCommand";
18
- export declare type ServiceInputTypes = AnalyzeDocumentCommandInput | AnalyzeExpenseCommandInput | DetectDocumentTextCommandInput | GetDocumentAnalysisCommandInput | GetDocumentTextDetectionCommandInput | GetExpenseAnalysisCommandInput | StartDocumentAnalysisCommandInput | StartDocumentTextDetectionCommandInput | StartExpenseAnalysisCommandInput;
19
- export declare type ServiceOutputTypes = AnalyzeDocumentCommandOutput | AnalyzeExpenseCommandOutput | DetectDocumentTextCommandOutput | GetDocumentAnalysisCommandOutput | GetDocumentTextDetectionCommandOutput | GetExpenseAnalysisCommandOutput | StartDocumentAnalysisCommandOutput | StartDocumentTextDetectionCommandOutput | StartExpenseAnalysisCommandOutput;
19
+ export declare type ServiceInputTypes = AnalyzeDocumentCommandInput | AnalyzeExpenseCommandInput | AnalyzeIDCommandInput | DetectDocumentTextCommandInput | GetDocumentAnalysisCommandInput | GetDocumentTextDetectionCommandInput | GetExpenseAnalysisCommandInput | StartDocumentAnalysisCommandInput | StartDocumentTextDetectionCommandInput | StartExpenseAnalysisCommandInput;
20
+ export declare type ServiceOutputTypes = AnalyzeDocumentCommandOutput | AnalyzeExpenseCommandOutput | AnalyzeIDCommandOutput | DetectDocumentTextCommandOutput | GetDocumentAnalysisCommandOutput | GetDocumentTextDetectionCommandOutput | GetExpenseAnalysisCommandOutput | StartDocumentAnalysisCommandOutput | StartDocumentTextDetectionCommandOutput | StartExpenseAnalysisCommandOutput;
20
21
  export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
21
22
 
22
23
  requestHandler?: __HttpHandler;
@@ -0,0 +1,17 @@
1
+ import { Command as $Command } from "@aws-sdk/smithy-client";
2
+ import { Handler, HttpHandlerOptions as __HttpHandlerOptions, MetadataBearer as __MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
3
+ import { AnalyzeIDRequest, AnalyzeIDResponse } from "../models/models_0";
4
+ import { ServiceInputTypes, ServiceOutputTypes, TextractClientResolvedConfig } from "../TextractClient";
5
+ export interface AnalyzeIDCommandInput extends AnalyzeIDRequest {
6
+ }
7
+ export interface AnalyzeIDCommandOutput extends AnalyzeIDResponse, __MetadataBearer {
8
+ }
9
+
10
+ export declare class AnalyzeIDCommand extends $Command<AnalyzeIDCommandInput, AnalyzeIDCommandOutput, TextractClientResolvedConfig> {
11
+ readonly input: AnalyzeIDCommandInput;
12
+ constructor(input: AnalyzeIDCommandInput);
13
+
14
+ resolveMiddleware(clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, configuration: TextractClientResolvedConfig, options?: __HttpHandlerOptions): Handler<AnalyzeIDCommandInput, AnalyzeIDCommandOutput>;
15
+ private serialize;
16
+ private deserialize;
17
+ }
@@ -1,5 +1,6 @@
1
1
  export * from "./AnalyzeDocumentCommand";
2
2
  export * from "./AnalyzeExpenseCommand";
3
+ export * from "./AnalyzeIDCommand";
3
4
  export * from "./DetectDocumentTextCommand";
4
5
  export * from "./GetDocumentAnalysisCommand";
5
6
  export * from "./GetDocumentTextDetectionCommand";