@aws-sdk/client-textract 3.39.0 → 3.43.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 (45) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist-cjs/Textract.js +15 -0
  3. package/dist-cjs/commands/AnalyzeIDCommand.js +36 -0
  4. package/dist-cjs/commands/index.js +1 -0
  5. package/dist-cjs/endpoints.js +151 -26
  6. package/dist-cjs/models/models_0.js +42 -2
  7. package/dist-cjs/protocols/Aws_json1_1.js +204 -1
  8. package/dist-cjs/runtimeConfig.browser.js +6 -3
  9. package/dist-cjs/runtimeConfig.js +5 -3
  10. package/dist-es/Textract.js +15 -0
  11. package/dist-es/commands/AnalyzeIDCommand.js +39 -0
  12. package/dist-es/commands/index.js +1 -0
  13. package/dist-es/endpoints.js +151 -26
  14. package/dist-es/models/models_0.js +28 -0
  15. package/dist-es/protocols/Aws_json1_1.js +211 -0
  16. package/dist-es/runtimeConfig.browser.js +3 -2
  17. package/dist-es/runtimeConfig.js +3 -3
  18. package/dist-types/Textract.d.ts +11 -1
  19. package/dist-types/TextractClient.d.ts +11 -2
  20. package/dist-types/commands/AnalyzeDocumentCommand.d.ts +1 -1
  21. package/dist-types/commands/AnalyzeExpenseCommand.d.ts +3 -2
  22. package/dist-types/commands/AnalyzeIDCommand.d.ts +37 -0
  23. package/dist-types/commands/DetectDocumentTextCommand.d.ts +1 -1
  24. package/dist-types/commands/GetDocumentAnalysisCommand.d.ts +1 -1
  25. package/dist-types/commands/GetDocumentTextDetectionCommand.d.ts +1 -1
  26. package/dist-types/commands/GetExpenseAnalysisCommand.d.ts +1 -1
  27. package/dist-types/commands/StartDocumentAnalysisCommand.d.ts +1 -1
  28. package/dist-types/commands/StartDocumentTextDetectionCommand.d.ts +1 -1
  29. package/dist-types/commands/StartExpenseAnalysisCommand.d.ts +1 -1
  30. package/dist-types/commands/index.d.ts +1 -0
  31. package/dist-types/models/models_0.d.ts +123 -2
  32. package/dist-types/protocols/Aws_json1_1.d.ts +3 -0
  33. package/dist-types/runtimeConfig.browser.d.ts +2 -0
  34. package/dist-types/runtimeConfig.d.ts +2 -0
  35. package/dist-types/runtimeConfig.native.d.ts +2 -0
  36. package/dist-types/ts3.4/Textract.d.ts +5 -0
  37. package/dist-types/ts3.4/TextractClient.d.ts +7 -2
  38. package/dist-types/ts3.4/commands/AnalyzeIDCommand.d.ts +17 -0
  39. package/dist-types/ts3.4/commands/index.d.ts +1 -0
  40. package/dist-types/ts3.4/models/models_0.d.ts +69 -0
  41. package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +3 -0
  42. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
  43. package/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
  44. package/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
  45. package/package.json +23 -23
package/CHANGELOG.md CHANGED
@@ -3,6 +3,47 @@
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.43.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.42.0...v3.43.0) (2021-11-29)
7
+
8
+
9
+ ### Features
10
+
11
+ * **clients:** update clients as of 11/28/2021 ([#3072](https://github.com/aws/aws-sdk-js-v3/issues/3072)) ([2ad1622](https://github.com/aws/aws-sdk-js-v3/commit/2ad1622ba8586b926fe508055211803bb29e3976))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.42.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.41.0...v3.42.0) (2021-11-19)
18
+
19
+ **Note:** Version bump only for package @aws-sdk/client-textract
20
+
21
+
22
+
23
+
24
+
25
+ # [3.41.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.40.1...v3.41.0) (2021-11-11)
26
+
27
+
28
+ ### Features
29
+
30
+ * **clients:** update clients as of 2021/11/11 ([#3015](https://github.com/aws/aws-sdk-js-v3/issues/3015)) ([3d82c4e](https://github.com/aws/aws-sdk-js-v3/commit/3d82c4e3c4d174533f46ce35495cf5cffabdb35a))
31
+
32
+
33
+
34
+
35
+
36
+ # [3.40.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.39.0...v3.40.0) (2021-11-05)
37
+
38
+
39
+ ### Features
40
+
41
+ * **clients:** populate variants in endpoints hashes ([#2974](https://github.com/aws/aws-sdk-js-v3/issues/2974)) ([0dd68ef](https://github.com/aws/aws-sdk-js-v3/commit/0dd68ef8b04ea0e96e43b05a9a10221e433fdf86))
42
+
43
+
44
+
45
+
46
+
6
47
  # [3.39.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.38.0...v3.39.0) (2021-10-29)
7
48
 
8
49
 
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Textract = void 0;
4
4
  const AnalyzeDocumentCommand_1 = require("./commands/AnalyzeDocumentCommand");
5
5
  const AnalyzeExpenseCommand_1 = require("./commands/AnalyzeExpenseCommand");
6
+ const AnalyzeIDCommand_1 = require("./commands/AnalyzeIDCommand");
6
7
  const DetectDocumentTextCommand_1 = require("./commands/DetectDocumentTextCommand");
7
8
  const GetDocumentAnalysisCommand_1 = require("./commands/GetDocumentAnalysisCommand");
8
9
  const GetDocumentTextDetectionCommand_1 = require("./commands/GetDocumentTextDetectionCommand");
@@ -40,6 +41,20 @@ class Textract extends TextractClient_1.TextractClient {
40
41
  return this.send(command, optionsOrCb);
41
42
  }
42
43
  }
44
+ analyzeID(args, optionsOrCb, cb) {
45
+ const command = new AnalyzeIDCommand_1.AnalyzeIDCommand(args);
46
+ if (typeof optionsOrCb === "function") {
47
+ this.send(command, optionsOrCb);
48
+ }
49
+ else if (typeof cb === "function") {
50
+ if (typeof optionsOrCb !== "object")
51
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
52
+ this.send(command, optionsOrCb || {}, cb);
53
+ }
54
+ else {
55
+ return this.send(command, optionsOrCb);
56
+ }
57
+ }
43
58
  detectDocumentText(args, optionsOrCb, cb) {
44
59
  const command = new DetectDocumentTextCommand_1.DetectDocumentTextCommand(args);
45
60
  if (typeof optionsOrCb === "function") {
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AnalyzeIDCommand = void 0;
4
+ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
8
+ class AnalyzeIDCommand extends smithy_client_1.Command {
9
+ constructor(input) {
10
+ super();
11
+ this.input = input;
12
+ }
13
+ resolveMiddleware(clientStack, configuration, options) {
14
+ this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
15
+ const stack = clientStack.concat(this.middlewareStack);
16
+ const { logger } = configuration;
17
+ const clientName = "TextractClient";
18
+ const commandName = "AnalyzeIDCommand";
19
+ const handlerExecutionContext = {
20
+ logger,
21
+ clientName,
22
+ commandName,
23
+ inputFilterSensitiveLog: models_0_1.AnalyzeIDRequest.filterSensitiveLog,
24
+ outputFilterSensitiveLog: models_0_1.AnalyzeIDResponse.filterSensitiveLog,
25
+ };
26
+ const { requestHandler } = configuration;
27
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
28
+ }
29
+ serialize(input, context) {
30
+ return Aws_json1_1_1.serializeAws_json1_1AnalyzeIDCommand(input, context);
31
+ }
32
+ deserialize(output, context) {
33
+ return Aws_json1_1_1.deserializeAws_json1_1AnalyzeIDCommand(output, context);
34
+ }
35
+ }
36
+ exports.AnalyzeIDCommand = AnalyzeIDCommand;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./AnalyzeDocumentCommand"), exports);
5
5
  tslib_1.__exportStar(require("./AnalyzeExpenseCommand"), exports);
6
+ tslib_1.__exportStar(require("./AnalyzeIDCommand"), exports);
6
7
  tslib_1.__exportStar(require("./DetectDocumentTextCommand"), exports);
7
8
  tslib_1.__exportStar(require("./GetDocumentAnalysisCommand"), exports);
8
9
  tslib_1.__exportStar(require("./GetDocumentTextDetectionCommand"), exports);
@@ -3,33 +3,89 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultRegionInfoProvider = void 0;
4
4
  const config_resolver_1 = require("@aws-sdk/config-resolver");
5
5
  const regionHash = {
6
- "fips-ca-central-1": {
7
- hostname: "textract-fips.ca-central-1.amazonaws.com",
8
- signingRegion: "ca-central-1",
6
+ "ca-central-1": {
7
+ variants: [
8
+ {
9
+ hostname: "textract.ca-central-1.amazonaws.com",
10
+ tags: [],
11
+ },
12
+ {
13
+ hostname: "textract-fips.ca-central-1.amazonaws.com",
14
+ tags: ["fips"],
15
+ },
16
+ ],
9
17
  },
10
- "fips-us-east-1": {
11
- hostname: "textract-fips.us-east-1.amazonaws.com",
12
- signingRegion: "us-east-1",
18
+ "us-east-1": {
19
+ variants: [
20
+ {
21
+ hostname: "textract.us-east-1.amazonaws.com",
22
+ tags: [],
23
+ },
24
+ {
25
+ hostname: "textract-fips.us-east-1.amazonaws.com",
26
+ tags: ["fips"],
27
+ },
28
+ ],
13
29
  },
14
- "fips-us-east-2": {
15
- hostname: "textract-fips.us-east-2.amazonaws.com",
16
- signingRegion: "us-east-2",
30
+ "us-east-2": {
31
+ variants: [
32
+ {
33
+ hostname: "textract.us-east-2.amazonaws.com",
34
+ tags: [],
35
+ },
36
+ {
37
+ hostname: "textract-fips.us-east-2.amazonaws.com",
38
+ tags: ["fips"],
39
+ },
40
+ ],
17
41
  },
18
- "fips-us-gov-east-1": {
19
- hostname: "textract-fips.us-gov-east-1.amazonaws.com",
20
- signingRegion: "us-gov-east-1",
42
+ "us-gov-east-1": {
43
+ variants: [
44
+ {
45
+ hostname: "textract.us-gov-east-1.amazonaws.com",
46
+ tags: [],
47
+ },
48
+ {
49
+ hostname: "textract-fips.us-gov-east-1.amazonaws.com",
50
+ tags: ["fips"],
51
+ },
52
+ ],
21
53
  },
22
- "fips-us-gov-west-1": {
23
- hostname: "textract-fips.us-gov-west-1.amazonaws.com",
24
- signingRegion: "us-gov-west-1",
54
+ "us-gov-west-1": {
55
+ variants: [
56
+ {
57
+ hostname: "textract.us-gov-west-1.amazonaws.com",
58
+ tags: [],
59
+ },
60
+ {
61
+ hostname: "textract-fips.us-gov-west-1.amazonaws.com",
62
+ tags: ["fips"],
63
+ },
64
+ ],
25
65
  },
26
- "fips-us-west-1": {
27
- hostname: "textract-fips.us-west-1.amazonaws.com",
28
- signingRegion: "us-west-1",
66
+ "us-west-1": {
67
+ variants: [
68
+ {
69
+ hostname: "textract.us-west-1.amazonaws.com",
70
+ tags: [],
71
+ },
72
+ {
73
+ hostname: "textract-fips.us-west-1.amazonaws.com",
74
+ tags: ["fips"],
75
+ },
76
+ ],
29
77
  },
30
- "fips-us-west-2": {
31
- hostname: "textract-fips.us-west-2.amazonaws.com",
32
- signingRegion: "us-west-2",
78
+ "us-west-2": {
79
+ variants: [
80
+ {
81
+ hostname: "textract.us-west-2.amazonaws.com",
82
+ tags: [],
83
+ },
84
+ {
85
+ hostname: "textract-fips.us-west-2.amazonaws.com",
86
+ tags: ["fips"],
87
+ },
88
+ ],
33
89
  },
34
90
  };
35
91
  const partitionHash = {
@@ -63,27 +119,96 @@ const partitionHash = {
63
119
  "us-west-2",
64
120
  ],
65
121
  regionRegex: "^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",
66
- hostname: "textract.{region}.amazonaws.com",
122
+ variants: [
123
+ {
124
+ hostname: "textract.{region}.amazonaws.com",
125
+ tags: [],
126
+ },
127
+ {
128
+ hostname: "textract-fips.{region}.amazonaws.com",
129
+ tags: ["fips"],
130
+ },
131
+ {
132
+ hostname: "textract-fips.{region}.api.aws",
133
+ tags: ["dualstack", "fips"],
134
+ },
135
+ {
136
+ hostname: "textract.{region}.api.aws",
137
+ tags: ["dualstack"],
138
+ },
139
+ ],
67
140
  },
68
141
  "aws-cn": {
69
142
  regions: ["cn-north-1", "cn-northwest-1"],
70
143
  regionRegex: "^cn\\-\\w+\\-\\d+$",
71
- hostname: "textract.{region}.amazonaws.com.cn",
144
+ variants: [
145
+ {
146
+ hostname: "textract.{region}.amazonaws.com.cn",
147
+ tags: [],
148
+ },
149
+ {
150
+ hostname: "textract-fips.{region}.amazonaws.com.cn",
151
+ tags: ["fips"],
152
+ },
153
+ {
154
+ hostname: "textract-fips.{region}.api.amazonwebservices.com.cn",
155
+ tags: ["dualstack", "fips"],
156
+ },
157
+ {
158
+ hostname: "textract.{region}.api.amazonwebservices.com.cn",
159
+ tags: ["dualstack"],
160
+ },
161
+ ],
72
162
  },
73
163
  "aws-iso": {
74
164
  regions: ["us-iso-east-1", "us-iso-west-1"],
75
165
  regionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
76
- hostname: "textract.{region}.c2s.ic.gov",
166
+ variants: [
167
+ {
168
+ hostname: "textract.{region}.c2s.ic.gov",
169
+ tags: [],
170
+ },
171
+ {
172
+ hostname: "textract-fips.{region}.c2s.ic.gov",
173
+ tags: ["fips"],
174
+ },
175
+ ],
77
176
  },
78
177
  "aws-iso-b": {
79
178
  regions: ["us-isob-east-1"],
80
179
  regionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
81
- hostname: "textract.{region}.sc2s.sgov.gov",
180
+ variants: [
181
+ {
182
+ hostname: "textract.{region}.sc2s.sgov.gov",
183
+ tags: [],
184
+ },
185
+ {
186
+ hostname: "textract-fips.{region}.sc2s.sgov.gov",
187
+ tags: ["fips"],
188
+ },
189
+ ],
82
190
  },
83
191
  "aws-us-gov": {
84
192
  regions: ["fips-us-gov-east-1", "fips-us-gov-west-1", "us-gov-east-1", "us-gov-west-1"],
85
193
  regionRegex: "^us\\-gov\\-\\w+\\-\\d+$",
86
- hostname: "textract.{region}.amazonaws.com",
194
+ variants: [
195
+ {
196
+ hostname: "textract.{region}.amazonaws.com",
197
+ tags: [],
198
+ },
199
+ {
200
+ hostname: "textract-fips.{region}.amazonaws.com",
201
+ tags: ["fips"],
202
+ },
203
+ {
204
+ hostname: "textract-fips.{region}.api.aws",
205
+ tags: ["dualstack", "fips"],
206
+ },
207
+ {
208
+ hostname: "textract.{region}.api.aws",
209
+ tags: ["dualstack"],
210
+ },
211
+ ],
87
212
  },
88
213
  };
89
214
  const defaultRegionInfoProvider = async (region, options) => config_resolver_1.getRegionInfo(region, {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetExpenseAnalysisRequest = exports.GetDocumentTextDetectionResponse = exports.GetDocumentTextDetectionRequest = exports.InvalidKMSKeyException = exports.InvalidJobIdException = exports.GetDocumentAnalysisResponse = exports.Warning = exports.JobStatus = exports.GetDocumentAnalysisRequest = exports.DocumentLocation = exports.DetectDocumentTextResponse = exports.DetectDocumentTextRequest = 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 = void 0;
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;
5
5
  var AccessDeniedException;
6
6
  (function (AccessDeniedException) {
7
7
  AccessDeniedException.filterSensitiveLog = (obj) => ({
@@ -229,6 +229,46 @@ var AnalyzeExpenseResponse;
229
229
  ...obj,
230
230
  });
231
231
  })(AnalyzeExpenseResponse = exports.AnalyzeExpenseResponse || (exports.AnalyzeExpenseResponse = {}));
232
+ var AnalyzeIDRequest;
233
+ (function (AnalyzeIDRequest) {
234
+ AnalyzeIDRequest.filterSensitiveLog = (obj) => ({
235
+ ...obj,
236
+ });
237
+ })(AnalyzeIDRequest = exports.AnalyzeIDRequest || (exports.AnalyzeIDRequest = {}));
238
+ var ValueType;
239
+ (function (ValueType) {
240
+ ValueType["DATE"] = "DATE";
241
+ })(ValueType = exports.ValueType || (exports.ValueType = {}));
242
+ var NormalizedValue;
243
+ (function (NormalizedValue) {
244
+ NormalizedValue.filterSensitiveLog = (obj) => ({
245
+ ...obj,
246
+ });
247
+ })(NormalizedValue = exports.NormalizedValue || (exports.NormalizedValue = {}));
248
+ var AnalyzeIDDetections;
249
+ (function (AnalyzeIDDetections) {
250
+ AnalyzeIDDetections.filterSensitiveLog = (obj) => ({
251
+ ...obj,
252
+ });
253
+ })(AnalyzeIDDetections = exports.AnalyzeIDDetections || (exports.AnalyzeIDDetections = {}));
254
+ var IdentityDocumentField;
255
+ (function (IdentityDocumentField) {
256
+ IdentityDocumentField.filterSensitiveLog = (obj) => ({
257
+ ...obj,
258
+ });
259
+ })(IdentityDocumentField = exports.IdentityDocumentField || (exports.IdentityDocumentField = {}));
260
+ var IdentityDocument;
261
+ (function (IdentityDocument) {
262
+ IdentityDocument.filterSensitiveLog = (obj) => ({
263
+ ...obj,
264
+ });
265
+ })(IdentityDocument = exports.IdentityDocument || (exports.IdentityDocument = {}));
266
+ var AnalyzeIDResponse;
267
+ (function (AnalyzeIDResponse) {
268
+ AnalyzeIDResponse.filterSensitiveLog = (obj) => ({
269
+ ...obj,
270
+ });
271
+ })(AnalyzeIDResponse = exports.AnalyzeIDResponse || (exports.AnalyzeIDResponse = {}));
232
272
  var DetectDocumentTextRequest;
233
273
  (function (DetectDocumentTextRequest) {
234
274
  DetectDocumentTextRequest.filterSensitiveLog = (obj) => ({
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializeAws_json1_1StartExpenseAnalysisCommand = exports.deserializeAws_json1_1StartDocumentTextDetectionCommand = exports.deserializeAws_json1_1StartDocumentAnalysisCommand = exports.deserializeAws_json1_1GetExpenseAnalysisCommand = exports.deserializeAws_json1_1GetDocumentTextDetectionCommand = exports.deserializeAws_json1_1GetDocumentAnalysisCommand = exports.deserializeAws_json1_1DetectDocumentTextCommand = exports.deserializeAws_json1_1AnalyzeExpenseCommand = exports.deserializeAws_json1_1AnalyzeDocumentCommand = exports.serializeAws_json1_1StartExpenseAnalysisCommand = exports.serializeAws_json1_1StartDocumentTextDetectionCommand = exports.serializeAws_json1_1StartDocumentAnalysisCommand = exports.serializeAws_json1_1GetExpenseAnalysisCommand = exports.serializeAws_json1_1GetDocumentTextDetectionCommand = exports.serializeAws_json1_1GetDocumentAnalysisCommand = exports.serializeAws_json1_1DetectDocumentTextCommand = exports.serializeAws_json1_1AnalyzeExpenseCommand = exports.serializeAws_json1_1AnalyzeDocumentCommand = void 0;
3
+ exports.deserializeAws_json1_1StartExpenseAnalysisCommand = exports.deserializeAws_json1_1StartDocumentTextDetectionCommand = exports.deserializeAws_json1_1StartDocumentAnalysisCommand = exports.deserializeAws_json1_1GetExpenseAnalysisCommand = exports.deserializeAws_json1_1GetDocumentTextDetectionCommand = exports.deserializeAws_json1_1GetDocumentAnalysisCommand = exports.deserializeAws_json1_1DetectDocumentTextCommand = exports.deserializeAws_json1_1AnalyzeIDCommand = exports.deserializeAws_json1_1AnalyzeExpenseCommand = exports.deserializeAws_json1_1AnalyzeDocumentCommand = exports.serializeAws_json1_1StartExpenseAnalysisCommand = exports.serializeAws_json1_1StartDocumentTextDetectionCommand = exports.serializeAws_json1_1StartDocumentAnalysisCommand = exports.serializeAws_json1_1GetExpenseAnalysisCommand = exports.serializeAws_json1_1GetDocumentTextDetectionCommand = exports.serializeAws_json1_1GetDocumentAnalysisCommand = exports.serializeAws_json1_1DetectDocumentTextCommand = exports.serializeAws_json1_1AnalyzeIDCommand = exports.serializeAws_json1_1AnalyzeExpenseCommand = exports.serializeAws_json1_1AnalyzeDocumentCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const serializeAws_json1_1AnalyzeDocumentCommand = async (input, context) => {
@@ -23,6 +23,16 @@ const serializeAws_json1_1AnalyzeExpenseCommand = async (input, context) => {
23
23
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
24
24
  };
25
25
  exports.serializeAws_json1_1AnalyzeExpenseCommand = serializeAws_json1_1AnalyzeExpenseCommand;
26
+ const serializeAws_json1_1AnalyzeIDCommand = async (input, context) => {
27
+ const headers = {
28
+ "content-type": "application/x-amz-json-1.1",
29
+ "x-amz-target": "Textract.AnalyzeID",
30
+ };
31
+ let body;
32
+ body = JSON.stringify(serializeAws_json1_1AnalyzeIDRequest(input, context));
33
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
34
+ };
35
+ exports.serializeAws_json1_1AnalyzeIDCommand = serializeAws_json1_1AnalyzeIDCommand;
26
36
  const serializeAws_json1_1DetectDocumentTextCommand = async (input, context) => {
27
37
  const headers = {
28
38
  "content-type": "application/x-amz-json-1.1",
@@ -323,6 +333,117 @@ const deserializeAws_json1_1AnalyzeExpenseCommandError = async (output, context)
323
333
  delete response.Message;
324
334
  return Promise.reject(Object.assign(new Error(message), response));
325
335
  };
336
+ const deserializeAws_json1_1AnalyzeIDCommand = async (output, context) => {
337
+ if (output.statusCode >= 300) {
338
+ return deserializeAws_json1_1AnalyzeIDCommandError(output, context);
339
+ }
340
+ const data = await parseBody(output.body, context);
341
+ let contents = {};
342
+ contents = deserializeAws_json1_1AnalyzeIDResponse(data, context);
343
+ const response = {
344
+ $metadata: deserializeMetadata(output),
345
+ ...contents,
346
+ };
347
+ return Promise.resolve(response);
348
+ };
349
+ exports.deserializeAws_json1_1AnalyzeIDCommand = deserializeAws_json1_1AnalyzeIDCommand;
350
+ const deserializeAws_json1_1AnalyzeIDCommandError = async (output, context) => {
351
+ const parsedOutput = {
352
+ ...output,
353
+ body: await parseBody(output.body, context),
354
+ };
355
+ let response;
356
+ let errorCode = "UnknownError";
357
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
358
+ switch (errorCode) {
359
+ case "AccessDeniedException":
360
+ case "com.amazonaws.textract#AccessDeniedException":
361
+ response = {
362
+ ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
363
+ name: errorCode,
364
+ $metadata: deserializeMetadata(output),
365
+ };
366
+ break;
367
+ case "BadDocumentException":
368
+ case "com.amazonaws.textract#BadDocumentException":
369
+ response = {
370
+ ...(await deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context)),
371
+ name: errorCode,
372
+ $metadata: deserializeMetadata(output),
373
+ };
374
+ break;
375
+ case "DocumentTooLargeException":
376
+ case "com.amazonaws.textract#DocumentTooLargeException":
377
+ response = {
378
+ ...(await deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context)),
379
+ name: errorCode,
380
+ $metadata: deserializeMetadata(output),
381
+ };
382
+ break;
383
+ case "InternalServerError":
384
+ case "com.amazonaws.textract#InternalServerError":
385
+ response = {
386
+ ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
387
+ name: errorCode,
388
+ $metadata: deserializeMetadata(output),
389
+ };
390
+ break;
391
+ case "InvalidParameterException":
392
+ case "com.amazonaws.textract#InvalidParameterException":
393
+ response = {
394
+ ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),
395
+ name: errorCode,
396
+ $metadata: deserializeMetadata(output),
397
+ };
398
+ break;
399
+ case "InvalidS3ObjectException":
400
+ case "com.amazonaws.textract#InvalidS3ObjectException":
401
+ response = {
402
+ ...(await deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)),
403
+ name: errorCode,
404
+ $metadata: deserializeMetadata(output),
405
+ };
406
+ break;
407
+ case "ProvisionedThroughputExceededException":
408
+ case "com.amazonaws.textract#ProvisionedThroughputExceededException":
409
+ response = {
410
+ ...(await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)),
411
+ name: errorCode,
412
+ $metadata: deserializeMetadata(output),
413
+ };
414
+ break;
415
+ case "ThrottlingException":
416
+ case "com.amazonaws.textract#ThrottlingException":
417
+ response = {
418
+ ...(await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)),
419
+ name: errorCode,
420
+ $metadata: deserializeMetadata(output),
421
+ };
422
+ break;
423
+ case "UnsupportedDocumentException":
424
+ case "com.amazonaws.textract#UnsupportedDocumentException":
425
+ response = {
426
+ ...(await deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context)),
427
+ name: errorCode,
428
+ $metadata: deserializeMetadata(output),
429
+ };
430
+ break;
431
+ default:
432
+ const parsedBody = parsedOutput.body;
433
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
434
+ response = {
435
+ ...parsedBody,
436
+ name: `${errorCode}`,
437
+ message: parsedBody.message || parsedBody.Message || errorCode,
438
+ $fault: "client",
439
+ $metadata: deserializeMetadata(output),
440
+ };
441
+ }
442
+ const message = response.message || response.Message || errorCode;
443
+ response.message = message;
444
+ delete response.Message;
445
+ return Promise.reject(Object.assign(new Error(message), response));
446
+ };
326
447
  const deserializeAws_json1_1DetectDocumentTextCommand = async (output, context) => {
327
448
  if (output.statusCode >= 300) {
328
449
  return deserializeAws_json1_1DetectDocumentTextCommandError(output, context);
@@ -1320,6 +1441,14 @@ const serializeAws_json1_1AnalyzeExpenseRequest = (input, context) => {
1320
1441
  input.Document !== null && { Document: serializeAws_json1_1Document(input.Document, context) }),
1321
1442
  };
1322
1443
  };
1444
+ const serializeAws_json1_1AnalyzeIDRequest = (input, context) => {
1445
+ return {
1446
+ ...(input.DocumentPages !== undefined &&
1447
+ input.DocumentPages !== null && {
1448
+ DocumentPages: serializeAws_json1_1DocumentPages(input.DocumentPages, context),
1449
+ }),
1450
+ };
1451
+ };
1323
1452
  const serializeAws_json1_1ContentClassifiers = (input, context) => {
1324
1453
  return input
1325
1454
  .filter((e) => e != null)
@@ -1349,6 +1478,16 @@ const serializeAws_json1_1DocumentLocation = (input, context) => {
1349
1478
  input.S3Object !== null && { S3Object: serializeAws_json1_1S3Object(input.S3Object, context) }),
1350
1479
  };
1351
1480
  };
1481
+ const serializeAws_json1_1DocumentPages = (input, context) => {
1482
+ return input
1483
+ .filter((e) => e != null)
1484
+ .map((entry) => {
1485
+ if (entry === null) {
1486
+ return null;
1487
+ }
1488
+ return serializeAws_json1_1Document(entry, context);
1489
+ });
1490
+ };
1352
1491
  const serializeAws_json1_1FeatureTypes = (input, context) => {
1353
1492
  return input
1354
1493
  .filter((e) => e != null)
@@ -1504,6 +1643,26 @@ const deserializeAws_json1_1AnalyzeExpenseResponse = (output, context) => {
1504
1643
  : undefined,
1505
1644
  };
1506
1645
  };
1646
+ const deserializeAws_json1_1AnalyzeIDDetections = (output, context) => {
1647
+ return {
1648
+ Confidence: smithy_client_1.limitedParseFloat32(output.Confidence),
1649
+ NormalizedValue: output.NormalizedValue !== undefined && output.NormalizedValue !== null
1650
+ ? deserializeAws_json1_1NormalizedValue(output.NormalizedValue, context)
1651
+ : undefined,
1652
+ Text: smithy_client_1.expectString(output.Text),
1653
+ };
1654
+ };
1655
+ const deserializeAws_json1_1AnalyzeIDResponse = (output, context) => {
1656
+ return {
1657
+ AnalyzeIDModelVersion: smithy_client_1.expectString(output.AnalyzeIDModelVersion),
1658
+ DocumentMetadata: output.DocumentMetadata !== undefined && output.DocumentMetadata !== null
1659
+ ? deserializeAws_json1_1DocumentMetadata(output.DocumentMetadata, context)
1660
+ : undefined,
1661
+ IdentityDocuments: output.IdentityDocuments !== undefined && output.IdentityDocuments !== null
1662
+ ? deserializeAws_json1_1IdentityDocumentList(output.IdentityDocuments, context)
1663
+ : undefined,
1664
+ };
1665
+ };
1507
1666
  const deserializeAws_json1_1BadDocumentException = (output, context) => {
1508
1667
  return {
1509
1668
  Code: smithy_client_1.expectString(output.Code),
@@ -1742,6 +1901,44 @@ const deserializeAws_json1_1IdempotentParameterMismatchException = (output, cont
1742
1901
  Message: smithy_client_1.expectString(output.Message),
1743
1902
  };
1744
1903
  };
1904
+ const deserializeAws_json1_1IdentityDocument = (output, context) => {
1905
+ return {
1906
+ DocumentIndex: smithy_client_1.expectInt32(output.DocumentIndex),
1907
+ IdentityDocumentFields: output.IdentityDocumentFields !== undefined && output.IdentityDocumentFields !== null
1908
+ ? deserializeAws_json1_1IdentityDocumentFieldList(output.IdentityDocumentFields, context)
1909
+ : undefined,
1910
+ };
1911
+ };
1912
+ const deserializeAws_json1_1IdentityDocumentField = (output, context) => {
1913
+ return {
1914
+ Type: output.Type !== undefined && output.Type !== null
1915
+ ? deserializeAws_json1_1AnalyzeIDDetections(output.Type, context)
1916
+ : undefined,
1917
+ ValueDetection: output.ValueDetection !== undefined && output.ValueDetection !== null
1918
+ ? deserializeAws_json1_1AnalyzeIDDetections(output.ValueDetection, context)
1919
+ : undefined,
1920
+ };
1921
+ };
1922
+ const deserializeAws_json1_1IdentityDocumentFieldList = (output, context) => {
1923
+ return (output || [])
1924
+ .filter((e) => e != null)
1925
+ .map((entry) => {
1926
+ if (entry === null) {
1927
+ return null;
1928
+ }
1929
+ return deserializeAws_json1_1IdentityDocumentField(entry, context);
1930
+ });
1931
+ };
1932
+ const deserializeAws_json1_1IdentityDocumentList = (output, context) => {
1933
+ return (output || [])
1934
+ .filter((e) => e != null)
1935
+ .map((entry) => {
1936
+ if (entry === null) {
1937
+ return null;
1938
+ }
1939
+ return deserializeAws_json1_1IdentityDocument(entry, context);
1940
+ });
1941
+ };
1745
1942
  const deserializeAws_json1_1IdList = (output, context) => {
1746
1943
  return (output || [])
1747
1944
  .filter((e) => e != null)
@@ -1823,6 +2020,12 @@ const deserializeAws_json1_1LineItemList = (output, context) => {
1823
2020
  return deserializeAws_json1_1LineItemFields(entry, context);
1824
2021
  });
1825
2022
  };
2023
+ const deserializeAws_json1_1NormalizedValue = (output, context) => {
2024
+ return {
2025
+ Value: smithy_client_1.expectString(output.Value),
2026
+ ValueType: smithy_client_1.expectString(output.ValueType),
2027
+ };
2028
+ };
1826
2029
  const deserializeAws_json1_1Pages = (output, context) => {
1827
2030
  return (output || [])
1828
2031
  .filter((e) => e != null)