@aws-sdk/client-textract 3.58.0 → 3.73.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.73.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.72.0...v3.73.0) (2022-04-19)
7
+
8
+
9
+ ### Features
10
+
11
+ * **client-textract:** This release adds support for specifying and extracting information from documents using the Queries feature within Analyze Document API ([584f346](https://github.com/aws/aws-sdk-js-v3/commit/584f3463663dcdec6122e0c2128a4e9d7d866f46))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.72.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.71.0...v3.72.0) (2022-04-15)
18
+
19
+ **Note:** Version bump only for package @aws-sdk/client-textract
20
+
21
+
22
+
23
+
24
+
25
+ # [3.67.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.66.0...v3.67.0) (2022-04-08)
26
+
27
+ **Note:** Version bump only for package @aws-sdk/client-textract
28
+
29
+
30
+
31
+
32
+
6
33
  # [3.58.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.57.0...v3.58.0) (2022-03-28)
7
34
 
8
35
  **Note:** Version bump only for package @aws-sdk/client-textract
package/README.md CHANGED
@@ -117,7 +117,7 @@ but they are supported by the send operation.
117
117
  ```js
118
118
  // callbacks.
119
119
  client.send(command, (err, data) => {
120
- // proccess err and data.
120
+ // process err and data.
121
121
  });
122
122
  ```
123
123
 
@@ -151,7 +151,7 @@ client
151
151
 
152
152
  // callbacks.
153
153
  client.analyzeDocument(params, (err, data) => {
154
- // proccess err and data.
154
+ // process err and data.
155
155
  });
156
156
  ```
157
157
 
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JobStatus = exports.GetDocumentAnalysisRequest = exports.DocumentLocation = exports.DetectDocumentTextResponse = exports.DetectDocumentTextRequest = exports.AnalyzeIDResponse = exports.IdentityDocument = exports.IdentityDocumentField = exports.AnalyzeIDDetections = exports.NormalizedValue = exports.ValueType = exports.AnalyzeIDRequest = exports.AnalyzeExpenseResponse = exports.ExpenseDocument = exports.LineItemGroup = exports.LineItemFields = exports.ExpenseField = exports.ExpenseType = exports.ExpenseDetection = exports.AnalyzeExpenseRequest = exports.UnsupportedDocumentException = exports.ThrottlingException = exports.ProvisionedThroughputExceededException = exports.InvalidS3ObjectException = exports.InvalidParameterException = exports.InternalServerError = exports.HumanLoopQuotaExceededException = exports.DocumentTooLargeException = exports.BadDocumentException = exports.AnalyzeDocumentResponse = exports.HumanLoopActivationOutput = exports.DocumentMetadata = exports.Block = exports.TextType = exports.SelectionStatus = exports.Relationship = exports.RelationshipType = exports.Geometry = exports.Point = exports.BoundingBox = exports.EntityType = exports.BlockType = exports.AnalyzeDocumentRequest = exports.HumanLoopConfig = exports.HumanLoopDataAttributes = exports.ContentClassifier = exports.FeatureType = exports.Document = exports.S3Object = exports.AccessDeniedException = void 0;
4
- exports.StartExpenseAnalysisResponse = exports.StartExpenseAnalysisRequest = exports.StartDocumentTextDetectionResponse = exports.StartDocumentTextDetectionRequest = exports.StartDocumentAnalysisResponse = exports.StartDocumentAnalysisRequest = exports.OutputConfig = exports.NotificationChannel = exports.LimitExceededException = exports.IdempotentParameterMismatchException = exports.GetExpenseAnalysisResponse = exports.GetExpenseAnalysisRequest = exports.GetDocumentTextDetectionResponse = exports.GetDocumentTextDetectionRequest = exports.InvalidKMSKeyException = exports.InvalidJobIdException = exports.GetDocumentAnalysisResponse = exports.Warning = void 0;
3
+ exports.DocumentLocation = exports.DetectDocumentTextResponse = exports.DetectDocumentTextRequest = exports.AnalyzeIDResponse = exports.IdentityDocument = exports.IdentityDocumentField = exports.AnalyzeIDDetections = exports.NormalizedValue = exports.ValueType = exports.AnalyzeIDRequest = exports.AnalyzeExpenseResponse = exports.ExpenseDocument = exports.LineItemGroup = exports.LineItemFields = exports.ExpenseField = exports.ExpenseType = exports.ExpenseDetection = exports.AnalyzeExpenseRequest = exports.UnsupportedDocumentException = exports.ThrottlingException = exports.ProvisionedThroughputExceededException = exports.InvalidS3ObjectException = exports.InvalidParameterException = exports.InternalServerError = exports.HumanLoopQuotaExceededException = exports.DocumentTooLargeException = exports.BadDocumentException = exports.AnalyzeDocumentResponse = exports.HumanLoopActivationOutput = exports.DocumentMetadata = exports.Block = exports.TextType = exports.SelectionStatus = exports.Relationship = exports.RelationshipType = exports.Geometry = exports.Point = exports.BoundingBox = exports.EntityType = exports.BlockType = exports.AnalyzeDocumentRequest = exports.QueriesConfig = exports.Query = exports.HumanLoopConfig = exports.HumanLoopDataAttributes = exports.ContentClassifier = exports.FeatureType = exports.Document = exports.S3Object = exports.AccessDeniedException = void 0;
4
+ exports.StartExpenseAnalysisResponse = exports.StartExpenseAnalysisRequest = exports.StartDocumentTextDetectionResponse = exports.StartDocumentTextDetectionRequest = exports.StartDocumentAnalysisResponse = exports.StartDocumentAnalysisRequest = exports.OutputConfig = exports.NotificationChannel = exports.LimitExceededException = exports.IdempotentParameterMismatchException = exports.GetExpenseAnalysisResponse = exports.GetExpenseAnalysisRequest = exports.GetDocumentTextDetectionResponse = exports.GetDocumentTextDetectionRequest = exports.InvalidKMSKeyException = exports.InvalidJobIdException = exports.GetDocumentAnalysisResponse = exports.Warning = exports.JobStatus = exports.GetDocumentAnalysisRequest = void 0;
5
5
  const TextractServiceException_1 = require("./TextractServiceException");
6
6
  class AccessDeniedException extends TextractServiceException_1.TextractServiceException {
7
7
  constructor(opts) {
@@ -33,6 +33,7 @@ var Document;
33
33
  var FeatureType;
34
34
  (function (FeatureType) {
35
35
  FeatureType["FORMS"] = "FORMS";
36
+ FeatureType["QUERIES"] = "QUERIES";
36
37
  FeatureType["TABLES"] = "TABLES";
37
38
  })(FeatureType = exports.FeatureType || (exports.FeatureType = {}));
38
39
  var ContentClassifier;
@@ -52,6 +53,18 @@ var HumanLoopConfig;
52
53
  ...obj,
53
54
  });
54
55
  })(HumanLoopConfig = exports.HumanLoopConfig || (exports.HumanLoopConfig = {}));
56
+ var Query;
57
+ (function (Query) {
58
+ Query.filterSensitiveLog = (obj) => ({
59
+ ...obj,
60
+ });
61
+ })(Query = exports.Query || (exports.Query = {}));
62
+ var QueriesConfig;
63
+ (function (QueriesConfig) {
64
+ QueriesConfig.filterSensitiveLog = (obj) => ({
65
+ ...obj,
66
+ });
67
+ })(QueriesConfig = exports.QueriesConfig || (exports.QueriesConfig = {}));
55
68
  var AnalyzeDocumentRequest;
56
69
  (function (AnalyzeDocumentRequest) {
57
70
  AnalyzeDocumentRequest.filterSensitiveLog = (obj) => ({
@@ -65,6 +78,8 @@ var BlockType;
65
78
  BlockType["LINE"] = "LINE";
66
79
  BlockType["MERGED_CELL"] = "MERGED_CELL";
67
80
  BlockType["PAGE"] = "PAGE";
81
+ BlockType["QUERY"] = "QUERY";
82
+ BlockType["QUERY_RESULT"] = "QUERY_RESULT";
68
83
  BlockType["SELECTION_ELEMENT"] = "SELECTION_ELEMENT";
69
84
  BlockType["TABLE"] = "TABLE";
70
85
  BlockType["TITLE"] = "TITLE";
@@ -96,6 +111,7 @@ var Geometry;
96
111
  })(Geometry = exports.Geometry || (exports.Geometry = {}));
97
112
  var RelationshipType;
98
113
  (function (RelationshipType) {
114
+ RelationshipType["ANSWER"] = "ANSWER";
99
115
  RelationshipType["CHILD"] = "CHILD";
100
116
  RelationshipType["COMPLEX_FEATURES"] = "COMPLEX_FEATURES";
101
117
  RelationshipType["MERGED_CELL"] = "MERGED_CELL";
@@ -862,6 +862,10 @@ const serializeAws_json1_1AnalyzeDocumentRequest = (input, context) => {
862
862
  input.HumanLoopConfig !== null && {
863
863
  HumanLoopConfig: serializeAws_json1_1HumanLoopConfig(input.HumanLoopConfig, context),
864
864
  }),
865
+ ...(input.QueriesConfig !== undefined &&
866
+ input.QueriesConfig !== null && {
867
+ QueriesConfig: serializeAws_json1_1QueriesConfig(input.QueriesConfig, context),
868
+ }),
865
869
  };
866
870
  };
867
871
  const serializeAws_json1_1AnalyzeExpenseRequest = (input, context) => {
@@ -979,6 +983,40 @@ const serializeAws_json1_1OutputConfig = (input, context) => {
979
983
  ...(input.S3Prefix !== undefined && input.S3Prefix !== null && { S3Prefix: input.S3Prefix }),
980
984
  };
981
985
  };
986
+ const serializeAws_json1_1Queries = (input, context) => {
987
+ return input
988
+ .filter((e) => e != null)
989
+ .map((entry) => {
990
+ if (entry === null) {
991
+ return null;
992
+ }
993
+ return serializeAws_json1_1Query(entry, context);
994
+ });
995
+ };
996
+ const serializeAws_json1_1QueriesConfig = (input, context) => {
997
+ return {
998
+ ...(input.Queries !== undefined &&
999
+ input.Queries !== null && { Queries: serializeAws_json1_1Queries(input.Queries, context) }),
1000
+ };
1001
+ };
1002
+ const serializeAws_json1_1Query = (input, context) => {
1003
+ return {
1004
+ ...(input.Alias !== undefined && input.Alias !== null && { Alias: input.Alias }),
1005
+ ...(input.Pages !== undefined &&
1006
+ input.Pages !== null && { Pages: serializeAws_json1_1QueryPages(input.Pages, context) }),
1007
+ ...(input.Text !== undefined && input.Text !== null && { Text: input.Text }),
1008
+ };
1009
+ };
1010
+ const serializeAws_json1_1QueryPages = (input, context) => {
1011
+ return input
1012
+ .filter((e) => e != null)
1013
+ .map((entry) => {
1014
+ if (entry === null) {
1015
+ return null;
1016
+ }
1017
+ return entry;
1018
+ });
1019
+ };
982
1020
  const serializeAws_json1_1S3Object = (input, context) => {
983
1021
  return {
984
1022
  ...(input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket }),
@@ -1004,6 +1042,10 @@ const serializeAws_json1_1StartDocumentAnalysisRequest = (input, context) => {
1004
1042
  }),
1005
1043
  ...(input.OutputConfig !== undefined &&
1006
1044
  input.OutputConfig !== null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }),
1045
+ ...(input.QueriesConfig !== undefined &&
1046
+ input.QueriesConfig !== null && {
1047
+ QueriesConfig: serializeAws_json1_1QueriesConfig(input.QueriesConfig, context),
1048
+ }),
1007
1049
  };
1008
1050
  };
1009
1051
  const serializeAws_json1_1StartDocumentTextDetectionRequest = (input, context) => {
@@ -1112,6 +1154,9 @@ const deserializeAws_json1_1Block = (output, context) => {
1112
1154
  : undefined,
1113
1155
  Id: (0, smithy_client_1.expectString)(output.Id),
1114
1156
  Page: (0, smithy_client_1.expectInt32)(output.Page),
1157
+ Query: output.Query !== undefined && output.Query !== null
1158
+ ? deserializeAws_json1_1Query(output.Query, context)
1159
+ : undefined,
1115
1160
  Relationships: output.Relationships !== undefined && output.Relationships !== null
1116
1161
  ? deserializeAws_json1_1RelationshipList(output.Relationships, context)
1117
1162
  : undefined,
@@ -1499,6 +1544,26 @@ const deserializeAws_json1_1ProvisionedThroughputExceededException = (output, co
1499
1544
  Message: (0, smithy_client_1.expectString)(output.Message),
1500
1545
  };
1501
1546
  };
1547
+ const deserializeAws_json1_1Query = (output, context) => {
1548
+ return {
1549
+ Alias: (0, smithy_client_1.expectString)(output.Alias),
1550
+ Pages: output.Pages !== undefined && output.Pages !== null
1551
+ ? deserializeAws_json1_1QueryPages(output.Pages, context)
1552
+ : undefined,
1553
+ Text: (0, smithy_client_1.expectString)(output.Text),
1554
+ };
1555
+ };
1556
+ const deserializeAws_json1_1QueryPages = (output, context) => {
1557
+ const retVal = (output || [])
1558
+ .filter((e) => e != null)
1559
+ .map((entry) => {
1560
+ if (entry === null) {
1561
+ return null;
1562
+ }
1563
+ return (0, smithy_client_1.expectString)(entry);
1564
+ });
1565
+ return retVal;
1566
+ };
1502
1567
  const deserializeAws_json1_1Relationship = (output, context) => {
1503
1568
  return {
1504
1569
  Ids: output.Ids !== undefined && output.Ids !== null ? deserializeAws_json1_1IdList(output.Ids, context) : undefined,
@@ -25,6 +25,7 @@ export var Document;
25
25
  export var FeatureType;
26
26
  (function (FeatureType) {
27
27
  FeatureType["FORMS"] = "FORMS";
28
+ FeatureType["QUERIES"] = "QUERIES";
28
29
  FeatureType["TABLES"] = "TABLES";
29
30
  })(FeatureType || (FeatureType = {}));
30
31
  export var ContentClassifier;
@@ -40,6 +41,14 @@ export var HumanLoopConfig;
40
41
  (function (HumanLoopConfig) {
41
42
  HumanLoopConfig.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
42
43
  })(HumanLoopConfig || (HumanLoopConfig = {}));
44
+ export var Query;
45
+ (function (Query) {
46
+ Query.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
47
+ })(Query || (Query = {}));
48
+ export var QueriesConfig;
49
+ (function (QueriesConfig) {
50
+ QueriesConfig.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
51
+ })(QueriesConfig || (QueriesConfig = {}));
43
52
  export var AnalyzeDocumentRequest;
44
53
  (function (AnalyzeDocumentRequest) {
45
54
  AnalyzeDocumentRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
@@ -51,6 +60,8 @@ export var BlockType;
51
60
  BlockType["LINE"] = "LINE";
52
61
  BlockType["MERGED_CELL"] = "MERGED_CELL";
53
62
  BlockType["PAGE"] = "PAGE";
63
+ BlockType["QUERY"] = "QUERY";
64
+ BlockType["QUERY_RESULT"] = "QUERY_RESULT";
54
65
  BlockType["SELECTION_ELEMENT"] = "SELECTION_ELEMENT";
55
66
  BlockType["TABLE"] = "TABLE";
56
67
  BlockType["TITLE"] = "TITLE";
@@ -76,6 +87,7 @@ export var Geometry;
76
87
  })(Geometry || (Geometry = {}));
77
88
  export var RelationshipType;
78
89
  (function (RelationshipType) {
90
+ RelationshipType["ANSWER"] = "ANSWER";
79
91
  RelationshipType["CHILD"] = "CHILD";
80
92
  RelationshipType["COMPLEX_FEATURES"] = "COMPLEX_FEATURES";
81
93
  RelationshipType["MERGED_CELL"] = "MERGED_CELL";
@@ -1088,11 +1088,14 @@ var deserializeAws_json1_1UnsupportedDocumentExceptionResponse = function (parse
1088
1088
  });
1089
1089
  }); };
1090
1090
  var serializeAws_json1_1AnalyzeDocumentRequest = function (input, context) {
1091
- return __assign(__assign(__assign({}, (input.Document !== undefined &&
1091
+ return __assign(__assign(__assign(__assign({}, (input.Document !== undefined &&
1092
1092
  input.Document !== null && { Document: serializeAws_json1_1Document(input.Document, context) })), (input.FeatureTypes !== undefined &&
1093
1093
  input.FeatureTypes !== null && { FeatureTypes: serializeAws_json1_1FeatureTypes(input.FeatureTypes, context) })), (input.HumanLoopConfig !== undefined &&
1094
1094
  input.HumanLoopConfig !== null && {
1095
1095
  HumanLoopConfig: serializeAws_json1_1HumanLoopConfig(input.HumanLoopConfig, context),
1096
+ })), (input.QueriesConfig !== undefined &&
1097
+ input.QueriesConfig !== null && {
1098
+ QueriesConfig: serializeAws_json1_1QueriesConfig(input.QueriesConfig, context),
1096
1099
  }));
1097
1100
  };
1098
1101
  var serializeAws_json1_1AnalyzeExpenseRequest = function (input, context) {
@@ -1175,11 +1178,39 @@ var serializeAws_json1_1NotificationChannel = function (input, context) {
1175
1178
  var serializeAws_json1_1OutputConfig = function (input, context) {
1176
1179
  return __assign(__assign({}, (input.S3Bucket !== undefined && input.S3Bucket !== null && { S3Bucket: input.S3Bucket })), (input.S3Prefix !== undefined && input.S3Prefix !== null && { S3Prefix: input.S3Prefix }));
1177
1180
  };
1181
+ var serializeAws_json1_1Queries = function (input, context) {
1182
+ return input
1183
+ .filter(function (e) { return e != null; })
1184
+ .map(function (entry) {
1185
+ if (entry === null) {
1186
+ return null;
1187
+ }
1188
+ return serializeAws_json1_1Query(entry, context);
1189
+ });
1190
+ };
1191
+ var serializeAws_json1_1QueriesConfig = function (input, context) {
1192
+ return __assign({}, (input.Queries !== undefined &&
1193
+ input.Queries !== null && { Queries: serializeAws_json1_1Queries(input.Queries, context) }));
1194
+ };
1195
+ var serializeAws_json1_1Query = function (input, context) {
1196
+ return __assign(__assign(__assign({}, (input.Alias !== undefined && input.Alias !== null && { Alias: input.Alias })), (input.Pages !== undefined &&
1197
+ input.Pages !== null && { Pages: serializeAws_json1_1QueryPages(input.Pages, context) })), (input.Text !== undefined && input.Text !== null && { Text: input.Text }));
1198
+ };
1199
+ var serializeAws_json1_1QueryPages = function (input, context) {
1200
+ return input
1201
+ .filter(function (e) { return e != null; })
1202
+ .map(function (entry) {
1203
+ if (entry === null) {
1204
+ return null;
1205
+ }
1206
+ return entry;
1207
+ });
1208
+ };
1178
1209
  var serializeAws_json1_1S3Object = function (input, context) {
1179
1210
  return __assign(__assign(__assign({}, (input.Bucket !== undefined && input.Bucket !== null && { Bucket: input.Bucket })), (input.Name !== undefined && input.Name !== null && { Name: input.Name })), (input.Version !== undefined && input.Version !== null && { Version: input.Version }));
1180
1211
  };
1181
1212
  var serializeAws_json1_1StartDocumentAnalysisRequest = function (input, context) {
1182
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.ClientRequestToken !== undefined &&
1213
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.ClientRequestToken !== undefined &&
1183
1214
  input.ClientRequestToken !== null && { ClientRequestToken: input.ClientRequestToken })), (input.DocumentLocation !== undefined &&
1184
1215
  input.DocumentLocation !== null && {
1185
1216
  DocumentLocation: serializeAws_json1_1DocumentLocation(input.DocumentLocation, context),
@@ -1188,7 +1219,10 @@ var serializeAws_json1_1StartDocumentAnalysisRequest = function (input, context)
1188
1219
  input.NotificationChannel !== null && {
1189
1220
  NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context),
1190
1221
  })), (input.OutputConfig !== undefined &&
1191
- input.OutputConfig !== null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }));
1222
+ input.OutputConfig !== null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) })), (input.QueriesConfig !== undefined &&
1223
+ input.QueriesConfig !== null && {
1224
+ QueriesConfig: serializeAws_json1_1QueriesConfig(input.QueriesConfig, context),
1225
+ }));
1192
1226
  };
1193
1227
  var serializeAws_json1_1StartDocumentTextDetectionRequest = function (input, context) {
1194
1228
  return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.ClientRequestToken !== undefined &&
@@ -1282,6 +1316,9 @@ var deserializeAws_json1_1Block = function (output, context) {
1282
1316
  : undefined,
1283
1317
  Id: __expectString(output.Id),
1284
1318
  Page: __expectInt32(output.Page),
1319
+ Query: output.Query !== undefined && output.Query !== null
1320
+ ? deserializeAws_json1_1Query(output.Query, context)
1321
+ : undefined,
1285
1322
  Relationships: output.Relationships !== undefined && output.Relationships !== null
1286
1323
  ? deserializeAws_json1_1RelationshipList(output.Relationships, context)
1287
1324
  : undefined,
@@ -1669,6 +1706,26 @@ var deserializeAws_json1_1ProvisionedThroughputExceededException = function (out
1669
1706
  Message: __expectString(output.Message),
1670
1707
  };
1671
1708
  };
1709
+ var deserializeAws_json1_1Query = function (output, context) {
1710
+ return {
1711
+ Alias: __expectString(output.Alias),
1712
+ Pages: output.Pages !== undefined && output.Pages !== null
1713
+ ? deserializeAws_json1_1QueryPages(output.Pages, context)
1714
+ : undefined,
1715
+ Text: __expectString(output.Text),
1716
+ };
1717
+ };
1718
+ var deserializeAws_json1_1QueryPages = function (output, context) {
1719
+ var retVal = (output || [])
1720
+ .filter(function (e) { return e != null; })
1721
+ .map(function (entry) {
1722
+ if (entry === null) {
1723
+ return null;
1724
+ }
1725
+ return __expectString(entry);
1726
+ });
1727
+ return retVal;
1728
+ };
1672
1729
  var deserializeAws_json1_1Relationship = function (output, context) {
1673
1730
  return {
1674
1731
  Ids: output.Ids !== undefined && output.Ids !== null ? deserializeAws_json1_1IdList(output.Ids, context) : undefined,
@@ -36,11 +36,16 @@ export declare class Textract extends TextractClient {
36
36
  * All lines and words that are detected in the document are returned (including text that doesn't have a
37
37
  * relationship with the value of <code>FeatureTypes</code>). </p>
38
38
  * </li>
39
+ * <li>
40
+ * <p>Queries.A QUERIES_RESULT Block object contains the answer to the query, the alias associated and an ID that
41
+ * connect it to the query asked. This Block also contains a location and attached confidence score.</p>
42
+ * </li>
39
43
  * </ul>
40
44
  *
41
45
  * <p>Selection elements such as check boxes and option buttons (radio buttons) can be detected in form data and in tables.
42
46
  * A SELECTION_ELEMENT <code>Block</code> object contains information about a selection element,
43
47
  * including the selection status.</p>
48
+ *
44
49
  * <p>You can choose which type of analysis to perform by specifying the <code>FeatureTypes</code> list.
45
50
  * </p>
46
51
  * <p>The output is returned in a list of <code>Block</code> objects.</p>
@@ -75,14 +80,15 @@ export declare class Textract extends TextractClient {
75
80
  /**
76
81
  * <p>Analyzes identity documents for relevant information. This information is extracted
77
82
  * and returned as <code>IdentityDocumentFields</code>, which records both the normalized
78
- * field and value of the extracted text.</p>
83
+ * field and value of the extracted text.Unlike other Amazon Textract operations, <code>AnalyzeID</code>
84
+ * doesn't return any Geometry data.</p>
79
85
  */
80
86
  analyzeID(args: AnalyzeIDCommandInput, options?: __HttpHandlerOptions): Promise<AnalyzeIDCommandOutput>;
81
87
  analyzeID(args: AnalyzeIDCommandInput, cb: (err: any, data?: AnalyzeIDCommandOutput) => void): void;
82
88
  analyzeID(args: AnalyzeIDCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: AnalyzeIDCommandOutput) => void): void;
83
89
  /**
84
90
  * <p>Detects text in the input document. Amazon Textract can detect lines of text and the
85
- * words that make up a line of text. The input document must be an image in JPEG or PNG
91
+ * words that make up a line of text. The input document must be an image in JPEG, PNG, PDF, or TIFF
86
92
  * format. <code>DetectDocumentText</code> returns the detected text in an array of <a>Block</a> objects. </p>
87
93
  * <p>Each document page has as an associated <code>Block</code> of type PAGE. Each PAGE <code>Block</code> object
88
94
  * 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
@@ -126,6 +132,10 @@ export declare class Textract extends TextractClient {
126
132
  * relationship with the value of the <code>StartDocumentAnalysis</code>
127
133
  * <code>FeatureTypes</code> input parameter). </p>
128
134
  * </li>
135
+ * <li>
136
+ * <p>Queries. A QUERIES_RESULT Block object contains the answer to the query, the alias associated and an ID that
137
+ * connect it to the query asked. This Block also contains a location and attached confidence score</p>
138
+ * </li>
129
139
  * </ul>
130
140
  *
131
141
  * <p>Selection elements such as check boxes and option buttons (radio buttons) can be detected in form data and in tables.
@@ -133,7 +143,6 @@ export declare class Textract extends TextractClient {
133
143
  * including the selection status.</p>
134
144
  *
135
145
  *
136
- *
137
146
  * <p>Use the <code>MaxResults</code> parameter to limit the number of blocks that are
138
147
  * returned. If there are more results than specified in <code>MaxResults</code>, the value of
139
148
  * <code>NextToken</code> in the operation response contains a pagination token for getting
@@ -26,11 +26,16 @@ export interface AnalyzeDocumentCommandOutput extends AnalyzeDocumentResponse, _
26
26
  * All lines and words that are detected in the document are returned (including text that doesn't have a
27
27
  * relationship with the value of <code>FeatureTypes</code>). </p>
28
28
  * </li>
29
+ * <li>
30
+ * <p>Queries.A QUERIES_RESULT Block object contains the answer to the query, the alias associated and an ID that
31
+ * connect it to the query asked. This Block also contains a location and attached confidence score.</p>
32
+ * </li>
29
33
  * </ul>
30
34
  *
31
35
  * <p>Selection elements such as check boxes and option buttons (radio buttons) can be detected in form data and in tables.
32
36
  * A SELECTION_ELEMENT <code>Block</code> object contains information about a selection element,
33
37
  * including the selection status.</p>
38
+ *
34
39
  * <p>You can choose which type of analysis to perform by specifying the <code>FeatureTypes</code> list.
35
40
  * </p>
36
41
  * <p>The output is returned in a list of <code>Block</code> objects.</p>
@@ -9,7 +9,8 @@ export interface AnalyzeIDCommandOutput extends AnalyzeIDResponse, __MetadataBea
9
9
  /**
10
10
  * <p>Analyzes identity documents for relevant information. This information is extracted
11
11
  * and returned as <code>IdentityDocumentFields</code>, which records both the normalized
12
- * field and value of the extracted text.</p>
12
+ * field and value of the extracted text.Unlike other Amazon Textract operations, <code>AnalyzeID</code>
13
+ * doesn't return any Geometry data.</p>
13
14
  * @example
14
15
  * Use a bare-bones client and the command you need to make an API call.
15
16
  * ```javascript
@@ -8,7 +8,7 @@ export interface DetectDocumentTextCommandOutput extends DetectDocumentTextRespo
8
8
  }
9
9
  /**
10
10
  * <p>Detects text in the input document. Amazon Textract can detect lines of text and the
11
- * words that make up a line of text. The input document must be an image in JPEG or PNG
11
+ * words that make up a line of text. The input document must be an image in JPEG, PNG, PDF, or TIFF
12
12
  * format. <code>DetectDocumentText</code> returns the detected text in an array of <a>Block</a> objects. </p>
13
13
  * <p>Each document page has as an associated <code>Block</code> of type PAGE. Each PAGE <code>Block</code> object
14
14
  * 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
@@ -36,6 +36,10 @@ export interface GetDocumentAnalysisCommandOutput extends GetDocumentAnalysisRes
36
36
  * relationship with the value of the <code>StartDocumentAnalysis</code>
37
37
  * <code>FeatureTypes</code> input parameter). </p>
38
38
  * </li>
39
+ * <li>
40
+ * <p>Queries. A QUERIES_RESULT Block object contains the answer to the query, the alias associated and an ID that
41
+ * connect it to the query asked. This Block also contains a location and attached confidence score</p>
42
+ * </li>
39
43
  * </ul>
40
44
  *
41
45
  * <p>Selection elements such as check boxes and option buttons (radio buttons) can be detected in form data and in tables.
@@ -43,7 +47,6 @@ export interface GetDocumentAnalysisCommandOutput extends GetDocumentAnalysisRes
43
47
  * including the selection status.</p>
44
48
  *
45
49
  *
46
- *
47
50
  * <p>Use the <code>MaxResults</code> parameter to limit the number of blocks that are
48
51
  * returned. If there are more results than specified in <code>MaxResults</code>, the value of
49
52
  * <code>NextToken</code> in the operation response contains a pagination token for getting
@@ -87,6 +87,7 @@ export declare namespace Document {
87
87
  }
88
88
  export declare enum FeatureType {
89
89
  FORMS = "FORMS",
90
+ QUERIES = "QUERIES",
90
91
  TABLES = "TABLES"
91
92
  }
92
93
  export declare enum ContentClassifier {
@@ -135,11 +136,69 @@ export declare namespace HumanLoopConfig {
135
136
  */
136
137
  const filterSensitiveLog: (obj: HumanLoopConfig) => any;
137
138
  }
139
+ /**
140
+ * <p>Each query contains the question you want to ask in the Text and the alias you want to associate.</p>
141
+ */
142
+ export interface Query {
143
+ /**
144
+ * <p>Question that Amazon Textract will apply to the document. An example would be "What is the customer's SSN?"</p>
145
+ */
146
+ Text: string | undefined;
147
+ /**
148
+ * <p>Alias attached to the query, for ease of location.</p>
149
+ */
150
+ Alias?: string;
151
+ /**
152
+ * <p>List of pages associated with the query. The following is a list of rules for using this parameter.</p>
153
+ * <ul>
154
+ * <li>
155
+ * <p>If a page is not specified, it is set to <code>["1"]</code> by default.</p>
156
+ * </li>
157
+ * <li>
158
+ * <p>The following characters are allowed in the parameter's string:
159
+ * <code>0 1 2 3 4 5 6 7 8 9 - *</code>. No whitespace is allowed.</p>
160
+ * </li>
161
+ * <li>
162
+ * <p>When using <code>*</code> to indicate all pages, it must be the only element
163
+ * in the string.</p>
164
+ * </li>
165
+ * <li>
166
+ * <p>You can use page intervals, such as <code>[“1-3”, “1-1”, “4-*”]</code>. Where <code>*</code> indicates last page of
167
+ * document.</p>
168
+ * </li>
169
+ * <li>
170
+ * <p>Specified pages must be greater than 0 and less than or equal to the number of pages in the document.</p>
171
+ * </li>
172
+ * </ul>
173
+ */
174
+ Pages?: string[];
175
+ }
176
+ export declare namespace Query {
177
+ /**
178
+ * @internal
179
+ */
180
+ const filterSensitiveLog: (obj: Query) => any;
181
+ }
182
+ /**
183
+ * <p></p>
184
+ */
185
+ export interface QueriesConfig {
186
+ /**
187
+ * <p></p>
188
+ */
189
+ Queries: Query[] | undefined;
190
+ }
191
+ export declare namespace QueriesConfig {
192
+ /**
193
+ * @internal
194
+ */
195
+ const filterSensitiveLog: (obj: QueriesConfig) => any;
196
+ }
138
197
  export interface AnalyzeDocumentRequest {
139
198
  /**
140
199
  * <p>The input document as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI
141
200
  * to call Amazon Textract operations, you can't pass image bytes. The document must be an image
142
- * in JPEG or PNG format.</p>
201
+ * in JPEG, PNG, PDF, or TIFF format.</p>
143
202
  * <p>If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode
144
203
  * image bytes that are passed using the <code>Bytes</code> field. </p>
145
204
  */
@@ -156,6 +215,10 @@ export interface AnalyzeDocumentRequest {
156
215
  * <p>Sets the configuration for the human in the loop workflow for analyzing documents.</p>
157
216
  */
158
217
  HumanLoopConfig?: HumanLoopConfig;
218
+ /**
219
+ * <p>Contains Queries and the alias for those Queries, as determined by the input. </p>
220
+ */
221
+ QueriesConfig?: QueriesConfig;
159
222
  }
160
223
  export declare namespace AnalyzeDocumentRequest {
161
224
  /**
@@ -169,6 +232,8 @@ export declare enum BlockType {
169
232
  LINE = "LINE",
170
233
  MERGED_CELL = "MERGED_CELL",
171
234
  PAGE = "PAGE",
235
+ QUERY = "QUERY",
236
+ QUERY_RESULT = "QUERY_RESULT",
172
237
  SELECTION_ELEMENT = "SELECTION_ELEMENT",
173
238
  TABLE = "TABLE",
174
239
  TITLE = "TITLE",
@@ -270,6 +335,7 @@ export declare namespace Geometry {
270
335
  const filterSensitiveLog: (obj: Geometry) => any;
271
336
  }
272
337
  export declare enum RelationshipType {
338
+ ANSWER = "ANSWER",
273
339
  CHILD = "CHILD",
274
340
  COMPLEX_FEATURES = "COMPLEX_FEATURES",
275
341
  MERGED_CELL = "MERGED_CELL",
@@ -391,6 +457,17 @@ export interface Block {
391
457
  * value of <code>SelectionStatus</code> to determine the status of the selection
392
458
  * element.</p>
393
459
  * </li>
460
+ * <li>
461
+ * <p>
462
+ * <i>QUERY</i> - A question asked during the call of AnalyzeDocument. Contains an
463
+ * alias and an ID that attachs it to its answer.</p>
464
+ * </li>
465
+ * <li>
466
+ * <p>
467
+ * <i>QUERY_RESULT</i> - A response to a question asked during the call
468
+ * of analyze document. Comes with an alias and ID for ease of locating in a
469
+ * response. Also contains location and confidence score.</p>
470
+ * </li>
394
471
  * </ul>
395
472
  */
396
473
  BlockType?: BlockType | string;
@@ -489,6 +566,10 @@ export interface Block {
489
566
  * considered to be a single-page document.</p>
490
567
  */
491
568
  Page?: number;
569
+ /**
570
+ * <p></p>
571
+ */
572
+ Query?: Query;
492
573
  }
493
574
  export declare namespace Block {
494
575
  /**
@@ -688,8 +769,8 @@ export declare class ThrottlingException extends __BaseException {
688
769
  constructor(opts: __ExceptionOptionType<ThrottlingException, __BaseException>);
689
770
  }
690
771
  /**
691
- * <p>The format of the input document isn't supported. Documents for synchronous operations can be in
692
- * PNG or JPEG format only. Documents for asynchronous operations can be in PDF format.</p>
772
+ * <p>The format of the input document isn't supported. Documents for operations can be in
773
+ * PNG, JPEG, PDF, or TIFF format.</p>
693
774
  */
694
775
  export declare class UnsupportedDocumentException extends __BaseException {
695
776
  readonly name: "UnsupportedDocumentException";
@@ -1426,6 +1507,10 @@ export interface StartDocumentAnalysisRequest {
1426
1507
  * be encrypted server side,using SSE-S3.</p>
1427
1508
  */
1428
1509
  KMSKeyId?: string;
1510
+ /**
1511
+ * <p></p>
1512
+ */
1513
+ QueriesConfig?: QueriesConfig;
1429
1514
  }
1430
1515
  export declare namespace StartDocumentAnalysisRequest {
1431
1516
  /**
@@ -35,6 +35,7 @@ export declare namespace Document {
35
35
  }
36
36
  export declare enum FeatureType {
37
37
  FORMS = "FORMS",
38
+ QUERIES = "QUERIES",
38
39
  TABLES = "TABLES"
39
40
  }
40
41
  export declare enum ContentClassifier {
@@ -63,6 +64,28 @@ export declare namespace HumanLoopConfig {
63
64
 
64
65
  const filterSensitiveLog: (obj: HumanLoopConfig) => any;
65
66
  }
67
+
68
+ export interface Query {
69
+
70
+ Text: string | undefined;
71
+
72
+ Alias?: string;
73
+
74
+ Pages?: string[];
75
+ }
76
+ export declare namespace Query {
77
+
78
+ const filterSensitiveLog: (obj: Query) => any;
79
+ }
80
+
81
+ export interface QueriesConfig {
82
+
83
+ Queries: Query[] | undefined;
84
+ }
85
+ export declare namespace QueriesConfig {
86
+
87
+ const filterSensitiveLog: (obj: QueriesConfig) => any;
88
+ }
66
89
  export interface AnalyzeDocumentRequest {
67
90
 
68
91
  Document: Document | undefined;
@@ -70,6 +93,8 @@ export interface AnalyzeDocumentRequest {
70
93
  FeatureTypes: (FeatureType | string)[] | undefined;
71
94
 
72
95
  HumanLoopConfig?: HumanLoopConfig;
96
+
97
+ QueriesConfig?: QueriesConfig;
73
98
  }
74
99
  export declare namespace AnalyzeDocumentRequest {
75
100
 
@@ -81,6 +106,8 @@ export declare enum BlockType {
81
106
  LINE = "LINE",
82
107
  MERGED_CELL = "MERGED_CELL",
83
108
  PAGE = "PAGE",
109
+ QUERY = "QUERY",
110
+ QUERY_RESULT = "QUERY_RESULT",
84
111
  SELECTION_ELEMENT = "SELECTION_ELEMENT",
85
112
  TABLE = "TABLE",
86
113
  TITLE = "TITLE",
@@ -129,6 +156,7 @@ export declare namespace Geometry {
129
156
  const filterSensitiveLog: (obj: Geometry) => any;
130
157
  }
131
158
  export declare enum RelationshipType {
159
+ ANSWER = "ANSWER",
132
160
  CHILD = "CHILD",
133
161
  COMPLEX_FEATURES = "COMPLEX_FEATURES",
134
162
  MERGED_CELL = "MERGED_CELL",
@@ -184,6 +212,8 @@ export interface Block {
184
212
  SelectionStatus?: SelectionStatus | string;
185
213
 
186
214
  Page?: number;
215
+
216
+ Query?: Query;
187
217
  }
188
218
  export declare namespace Block {
189
219
 
@@ -686,6 +716,8 @@ export interface StartDocumentAnalysisRequest {
686
716
  OutputConfig?: OutputConfig;
687
717
 
688
718
  KMSKeyId?: string;
719
+
720
+ QueriesConfig?: QueriesConfig;
689
721
  }
690
722
  export declare namespace StartDocumentAnalysisRequest {
691
723
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-textract",
3
3
  "description": "AWS SDK for JavaScript Textract Client for Node.js, Browser and React Native",
4
- "version": "3.58.0",
4
+ "version": "3.73.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -18,9 +18,9 @@
18
18
  "dependencies": {
19
19
  "@aws-crypto/sha256-browser": "2.0.0",
20
20
  "@aws-crypto/sha256-js": "2.0.0",
21
- "@aws-sdk/client-sts": "3.58.0",
21
+ "@aws-sdk/client-sts": "3.72.0",
22
22
  "@aws-sdk/config-resolver": "3.58.0",
23
- "@aws-sdk/credential-provider-node": "3.58.0",
23
+ "@aws-sdk/credential-provider-node": "3.72.0",
24
24
  "@aws-sdk/fetch-http-handler": "3.58.0",
25
25
  "@aws-sdk/hash-node": "3.55.0",
26
26
  "@aws-sdk/invalid-dependency": "3.55.0",
@@ -35,15 +35,15 @@
35
35
  "@aws-sdk/node-config-provider": "3.58.0",
36
36
  "@aws-sdk/node-http-handler": "3.58.0",
37
37
  "@aws-sdk/protocol-http": "3.58.0",
38
- "@aws-sdk/smithy-client": "3.55.0",
38
+ "@aws-sdk/smithy-client": "3.72.0",
39
39
  "@aws-sdk/types": "3.55.0",
40
40
  "@aws-sdk/url-parser": "3.55.0",
41
41
  "@aws-sdk/util-base64-browser": "3.58.0",
42
42
  "@aws-sdk/util-base64-node": "3.55.0",
43
43
  "@aws-sdk/util-body-length-browser": "3.55.0",
44
44
  "@aws-sdk/util-body-length-node": "3.55.0",
45
- "@aws-sdk/util-defaults-mode-browser": "3.55.0",
46
- "@aws-sdk/util-defaults-mode-node": "3.58.0",
45
+ "@aws-sdk/util-defaults-mode-browser": "3.72.0",
46
+ "@aws-sdk/util-defaults-mode-node": "3.72.0",
47
47
  "@aws-sdk/util-user-agent-browser": "3.58.0",
48
48
  "@aws-sdk/util-user-agent-node": "3.58.0",
49
49
  "@aws-sdk/util-utf8-browser": "3.55.0",