@aws-sdk/client-textract 3.199.0 → 3.201.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,29 @@
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.201.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.200.0...v3.201.0) (2022-11-01)
7
+
8
+
9
+ ### Features
10
+
11
+ * **client-textract:** Add ocr results in AnalyzeIDResponse as blocks ([0b08176](https://github.com/aws/aws-sdk-js-v3/commit/0b0817642a2279f34fbc3615ac520f193f64ba5f))
12
+ * end support for Node.js 12.x ([#4123](https://github.com/aws/aws-sdk-js-v3/issues/4123)) ([83f913e](https://github.com/aws/aws-sdk-js-v3/commit/83f913ec2ac3878d8726c6964f585550dc5caf3e))
13
+
14
+
15
+
16
+
17
+
18
+ # [3.200.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.199.0...v3.200.0) (2022-10-31)
19
+
20
+
21
+ ### Features
22
+
23
+ * **client-textract:** This release introduces additional support for 30+ normalized fields such as vendor address and currency. It also includes OCR output in the response and accuracy improvements for the already supported fields in previous version ([5ee0634](https://github.com/aws/aws-sdk-js-v3/commit/5ee0634c0fcb966479f12f95da3918395139dbfc))
24
+
25
+
26
+
27
+
28
+
6
29
  # [3.199.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.198.0...v3.199.0) (2022-10-28)
7
30
 
8
31
  **Note:** Version bump only for package @aws-sdk/client-textract
@@ -2,11 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolveClientEndpointParameters = void 0;
4
4
  const resolveClientEndpointParameters = (options) => {
5
- var _a, _b;
6
5
  return {
7
6
  ...options,
8
- useDualstackEndpoint: (_a = options.useDualstackEndpoint) !== null && _a !== void 0 ? _a : false,
9
- useFipsEndpoint: (_b = options.useFipsEndpoint) !== null && _b !== void 0 ? _b : false,
7
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
8
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
10
9
  defaultSigningName: "textract",
11
10
  };
12
11
  };
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IdentityDocumentFieldFilterSensitiveLog = exports.AnalyzeIDDetectionsFilterSensitiveLog = exports.NormalizedValueFilterSensitiveLog = exports.AnalyzeIDRequestFilterSensitiveLog = exports.AnalyzeExpenseResponseFilterSensitiveLog = exports.ExpenseDocumentFilterSensitiveLog = exports.LineItemGroupFilterSensitiveLog = exports.LineItemFieldsFilterSensitiveLog = exports.ExpenseFieldFilterSensitiveLog = exports.ExpenseTypeFilterSensitiveLog = exports.ExpenseDetectionFilterSensitiveLog = exports.AnalyzeExpenseRequestFilterSensitiveLog = exports.AnalyzeDocumentResponseFilterSensitiveLog = exports.HumanLoopActivationOutputFilterSensitiveLog = exports.DocumentMetadataFilterSensitiveLog = exports.BlockFilterSensitiveLog = exports.RelationshipFilterSensitiveLog = exports.GeometryFilterSensitiveLog = exports.PointFilterSensitiveLog = exports.BoundingBoxFilterSensitiveLog = exports.AnalyzeDocumentRequestFilterSensitiveLog = exports.QueriesConfigFilterSensitiveLog = exports.QueryFilterSensitiveLog = exports.HumanLoopConfigFilterSensitiveLog = exports.HumanLoopDataAttributesFilterSensitiveLog = exports.DocumentFilterSensitiveLog = exports.S3ObjectFilterSensitiveLog = exports.LimitExceededException = exports.IdempotentParameterMismatchException = exports.InvalidKMSKeyException = exports.InvalidJobIdException = exports.JobStatus = exports.ValueType = exports.UnsupportedDocumentException = exports.ThrottlingException = exports.ProvisionedThroughputExceededException = exports.InvalidS3ObjectException = exports.InvalidParameterException = exports.InternalServerError = exports.HumanLoopQuotaExceededException = exports.DocumentTooLargeException = exports.BadDocumentException = exports.TextType = exports.SelectionStatus = exports.RelationshipType = exports.EntityType = exports.BlockType = exports.ContentClassifier = exports.FeatureType = exports.AccessDeniedException = void 0;
4
- exports.StartExpenseAnalysisResponseFilterSensitiveLog = exports.StartExpenseAnalysisRequestFilterSensitiveLog = exports.StartDocumentTextDetectionResponseFilterSensitiveLog = exports.StartDocumentTextDetectionRequestFilterSensitiveLog = exports.StartDocumentAnalysisResponseFilterSensitiveLog = exports.StartDocumentAnalysisRequestFilterSensitiveLog = exports.OutputConfigFilterSensitiveLog = exports.NotificationChannelFilterSensitiveLog = exports.GetExpenseAnalysisResponseFilterSensitiveLog = exports.GetExpenseAnalysisRequestFilterSensitiveLog = exports.GetDocumentTextDetectionResponseFilterSensitiveLog = exports.GetDocumentTextDetectionRequestFilterSensitiveLog = exports.GetDocumentAnalysisResponseFilterSensitiveLog = exports.WarningFilterSensitiveLog = exports.GetDocumentAnalysisRequestFilterSensitiveLog = exports.DocumentLocationFilterSensitiveLog = exports.DetectDocumentTextResponseFilterSensitiveLog = exports.DetectDocumentTextRequestFilterSensitiveLog = exports.AnalyzeIDResponseFilterSensitiveLog = exports.IdentityDocumentFilterSensitiveLog = void 0;
3
+ exports.NormalizedValueFilterSensitiveLog = exports.AnalyzeIDRequestFilterSensitiveLog = exports.AnalyzeExpenseResponseFilterSensitiveLog = exports.ExpenseDocumentFilterSensitiveLog = exports.LineItemGroupFilterSensitiveLog = exports.LineItemFieldsFilterSensitiveLog = exports.ExpenseFieldFilterSensitiveLog = exports.ExpenseTypeFilterSensitiveLog = exports.ExpenseDetectionFilterSensitiveLog = exports.ExpenseGroupPropertyFilterSensitiveLog = exports.ExpenseCurrencyFilterSensitiveLog = exports.AnalyzeExpenseRequestFilterSensitiveLog = exports.AnalyzeDocumentResponseFilterSensitiveLog = exports.HumanLoopActivationOutputFilterSensitiveLog = exports.DocumentMetadataFilterSensitiveLog = exports.BlockFilterSensitiveLog = exports.RelationshipFilterSensitiveLog = exports.GeometryFilterSensitiveLog = exports.PointFilterSensitiveLog = exports.BoundingBoxFilterSensitiveLog = exports.AnalyzeDocumentRequestFilterSensitiveLog = exports.QueriesConfigFilterSensitiveLog = exports.QueryFilterSensitiveLog = exports.HumanLoopConfigFilterSensitiveLog = exports.HumanLoopDataAttributesFilterSensitiveLog = exports.DocumentFilterSensitiveLog = exports.S3ObjectFilterSensitiveLog = exports.LimitExceededException = exports.IdempotentParameterMismatchException = exports.InvalidKMSKeyException = exports.InvalidJobIdException = exports.JobStatus = exports.ValueType = exports.UnsupportedDocumentException = exports.ThrottlingException = exports.ProvisionedThroughputExceededException = exports.InvalidS3ObjectException = exports.InvalidParameterException = exports.InternalServerError = exports.HumanLoopQuotaExceededException = exports.DocumentTooLargeException = exports.BadDocumentException = exports.TextType = exports.SelectionStatus = exports.RelationshipType = exports.EntityType = exports.BlockType = exports.ContentClassifier = exports.FeatureType = exports.AccessDeniedException = void 0;
4
+ exports.StartExpenseAnalysisResponseFilterSensitiveLog = exports.StartExpenseAnalysisRequestFilterSensitiveLog = exports.StartDocumentTextDetectionResponseFilterSensitiveLog = exports.StartDocumentTextDetectionRequestFilterSensitiveLog = exports.StartDocumentAnalysisResponseFilterSensitiveLog = exports.StartDocumentAnalysisRequestFilterSensitiveLog = exports.OutputConfigFilterSensitiveLog = exports.NotificationChannelFilterSensitiveLog = exports.GetExpenseAnalysisResponseFilterSensitiveLog = exports.GetExpenseAnalysisRequestFilterSensitiveLog = exports.GetDocumentTextDetectionResponseFilterSensitiveLog = exports.GetDocumentTextDetectionRequestFilterSensitiveLog = exports.GetDocumentAnalysisResponseFilterSensitiveLog = exports.WarningFilterSensitiveLog = exports.GetDocumentAnalysisRequestFilterSensitiveLog = exports.DocumentLocationFilterSensitiveLog = exports.DetectDocumentTextResponseFilterSensitiveLog = exports.DetectDocumentTextRequestFilterSensitiveLog = exports.AnalyzeIDResponseFilterSensitiveLog = exports.IdentityDocumentFilterSensitiveLog = exports.IdentityDocumentFieldFilterSensitiveLog = exports.AnalyzeIDDetectionsFilterSensitiveLog = void 0;
5
5
  const TextractServiceException_1 = require("./TextractServiceException");
6
6
  class AccessDeniedException extends TextractServiceException_1.TextractServiceException {
7
7
  constructor(opts) {
@@ -341,6 +341,14 @@ const AnalyzeExpenseRequestFilterSensitiveLog = (obj) => ({
341
341
  ...obj,
342
342
  });
343
343
  exports.AnalyzeExpenseRequestFilterSensitiveLog = AnalyzeExpenseRequestFilterSensitiveLog;
344
+ const ExpenseCurrencyFilterSensitiveLog = (obj) => ({
345
+ ...obj,
346
+ });
347
+ exports.ExpenseCurrencyFilterSensitiveLog = ExpenseCurrencyFilterSensitiveLog;
348
+ const ExpenseGroupPropertyFilterSensitiveLog = (obj) => ({
349
+ ...obj,
350
+ });
351
+ exports.ExpenseGroupPropertyFilterSensitiveLog = ExpenseGroupPropertyFilterSensitiveLog;
344
352
  const ExpenseDetectionFilterSensitiveLog = (obj) => ({
345
353
  ...obj,
346
354
  });
@@ -1144,6 +1144,12 @@ const deserializeAws_json1_1EntityTypes = (output, context) => {
1144
1144
  });
1145
1145
  return retVal;
1146
1146
  };
1147
+ const deserializeAws_json1_1ExpenseCurrency = (output, context) => {
1148
+ return {
1149
+ Code: (0, smithy_client_1.expectString)(output.Code),
1150
+ Confidence: (0, smithy_client_1.limitedParseFloat32)(output.Confidence),
1151
+ };
1152
+ };
1147
1153
  const deserializeAws_json1_1ExpenseDetection = (output, context) => {
1148
1154
  return {
1149
1155
  Confidence: (0, smithy_client_1.limitedParseFloat32)(output.Confidence),
@@ -1153,6 +1159,7 @@ const deserializeAws_json1_1ExpenseDetection = (output, context) => {
1153
1159
  };
1154
1160
  const deserializeAws_json1_1ExpenseDocument = (output, context) => {
1155
1161
  return {
1162
+ Blocks: output.Blocks != null ? deserializeAws_json1_1BlockList(output.Blocks, context) : undefined,
1156
1163
  ExpenseIndex: (0, smithy_client_1.expectInt32)(output.ExpenseIndex),
1157
1164
  LineItemGroups: output.LineItemGroups != null
1158
1165
  ? deserializeAws_json1_1LineItemGroupList(output.LineItemGroups, context)
@@ -1173,6 +1180,10 @@ const deserializeAws_json1_1ExpenseDocumentList = (output, context) => {
1173
1180
  };
1174
1181
  const deserializeAws_json1_1ExpenseField = (output, context) => {
1175
1182
  return {
1183
+ Currency: output.Currency != null ? deserializeAws_json1_1ExpenseCurrency(output.Currency, context) : undefined,
1184
+ GroupProperties: output.GroupProperties != null
1185
+ ? deserializeAws_json1_1ExpenseGroupPropertyList(output.GroupProperties, context)
1186
+ : undefined,
1176
1187
  LabelDetection: output.LabelDetection != null
1177
1188
  ? deserializeAws_json1_1ExpenseDetection(output.LabelDetection, context)
1178
1189
  : undefined,
@@ -1194,6 +1205,23 @@ const deserializeAws_json1_1ExpenseFieldList = (output, context) => {
1194
1205
  });
1195
1206
  return retVal;
1196
1207
  };
1208
+ const deserializeAws_json1_1ExpenseGroupProperty = (output, context) => {
1209
+ return {
1210
+ Id: (0, smithy_client_1.expectString)(output.Id),
1211
+ Types: output.Types != null ? deserializeAws_json1_1StringList(output.Types, context) : undefined,
1212
+ };
1213
+ };
1214
+ const deserializeAws_json1_1ExpenseGroupPropertyList = (output, context) => {
1215
+ const retVal = (output || [])
1216
+ .filter((e) => e != null)
1217
+ .map((entry) => {
1218
+ if (entry === null) {
1219
+ return null;
1220
+ }
1221
+ return deserializeAws_json1_1ExpenseGroupProperty(entry, context);
1222
+ });
1223
+ return retVal;
1224
+ };
1197
1225
  const deserializeAws_json1_1ExpenseType = (output, context) => {
1198
1226
  return {
1199
1227
  Confidence: (0, smithy_client_1.limitedParseFloat32)(output.Confidence),
@@ -1286,6 +1314,7 @@ const deserializeAws_json1_1IdempotentParameterMismatchException = (output, cont
1286
1314
  };
1287
1315
  const deserializeAws_json1_1IdentityDocument = (output, context) => {
1288
1316
  return {
1317
+ Blocks: output.Blocks != null ? deserializeAws_json1_1BlockList(output.Blocks, context) : undefined,
1289
1318
  DocumentIndex: (0, smithy_client_1.expectInt32)(output.DocumentIndex),
1290
1319
  IdentityDocumentFields: output.IdentityDocumentFields != null
1291
1320
  ? deserializeAws_json1_1IdentityDocumentFieldList(output.IdentityDocumentFields, context)
@@ -1494,6 +1523,17 @@ const deserializeAws_json1_1StartExpenseAnalysisResponse = (output, context) =>
1494
1523
  JobId: (0, smithy_client_1.expectString)(output.JobId),
1495
1524
  };
1496
1525
  };
1526
+ const deserializeAws_json1_1StringList = (output, context) => {
1527
+ const retVal = (output || [])
1528
+ .filter((e) => e != null)
1529
+ .map((entry) => {
1530
+ if (entry === null) {
1531
+ return null;
1532
+ }
1533
+ return (0, smithy_client_1.expectString)(entry);
1534
+ });
1535
+ return retVal;
1536
+ };
1497
1537
  const deserializeAws_json1_1ThrottlingException = (output, context) => {
1498
1538
  return {
1499
1539
  Code: (0, smithy_client_1.expectString)(output.Code),
@@ -1523,15 +1563,12 @@ const deserializeAws_json1_1Warnings = (output, context) => {
1523
1563
  });
1524
1564
  return retVal;
1525
1565
  };
1526
- const deserializeMetadata = (output) => {
1527
- var _a, _b;
1528
- return ({
1529
- httpStatusCode: output.statusCode,
1530
- requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
1531
- extendedRequestId: output.headers["x-amz-id-2"],
1532
- cfId: output.headers["x-amz-cf-id"],
1533
- });
1534
- };
1566
+ const deserializeMetadata = (output) => ({
1567
+ httpStatusCode: output.statusCode,
1568
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1569
+ extendedRequestId: output.headers["x-amz-id-2"],
1570
+ cfId: output.headers["x-amz-cf-id"],
1571
+ });
1535
1572
  const collectBody = (streamBody = new Uint8Array(), context) => {
1536
1573
  if (streamBody instanceof Uint8Array) {
1537
1574
  return Promise.resolve(streamBody);
@@ -1564,9 +1601,8 @@ const parseBody = (streamBody, context) => collectBodyString(streamBody, context
1564
1601
  return {};
1565
1602
  });
1566
1603
  const parseErrorBody = async (errorBody, context) => {
1567
- var _a;
1568
1604
  const value = await parseBody(errorBody, context);
1569
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1605
+ value.message = value.message ?? value.Message;
1570
1606
  return value;
1571
1607
  };
1572
1608
  const loadRestJsonErrorCode = (output, data) => {
@@ -16,7 +16,6 @@ const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
16
16
  const smithy_client_1 = require("@aws-sdk/smithy-client");
17
17
  const util_defaults_mode_browser_1 = require("@aws-sdk/util-defaults-mode-browser");
18
18
  const getRuntimeConfig = (config) => {
19
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
20
19
  const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config);
21
20
  const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
22
21
  const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
@@ -25,21 +24,22 @@ const getRuntimeConfig = (config) => {
25
24
  ...config,
26
25
  runtime: "browser",
27
26
  defaultsMode,
28
- base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : util_base64_browser_1.fromBase64,
29
- base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : util_base64_browser_1.toBase64,
30
- bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : util_body_length_browser_1.calculateBodyLength,
31
- credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : ((_) => () => Promise.reject(new Error("Credential is missing"))),
32
- defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : (0, util_user_agent_browser_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
33
- maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : middleware_retry_1.DEFAULT_MAX_ATTEMPTS,
34
- region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : (0, invalid_dependency_1.invalidProvider)("Region is missing"),
35
- requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new fetch_http_handler_1.FetchHttpHandler(defaultConfigProvider),
36
- retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : (async () => (await defaultConfigProvider()).retryMode || middleware_retry_1.DEFAULT_RETRY_MODE),
37
- sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : sha256_browser_1.Sha256,
38
- streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : fetch_http_handler_1.streamCollector,
39
- useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : (() => Promise.resolve(config_resolver_1.DEFAULT_USE_DUALSTACK_ENDPOINT)),
40
- useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : (() => Promise.resolve(config_resolver_1.DEFAULT_USE_FIPS_ENDPOINT)),
41
- utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : util_utf8_browser_1.fromUtf8,
42
- utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : util_utf8_browser_1.toUtf8,
27
+ base64Decoder: config?.base64Decoder ?? util_base64_browser_1.fromBase64,
28
+ base64Encoder: config?.base64Encoder ?? util_base64_browser_1.toBase64,
29
+ bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength,
30
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
31
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
32
+ (0, util_user_agent_browser_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
33
+ maxAttempts: config?.maxAttempts ?? middleware_retry_1.DEFAULT_MAX_ATTEMPTS,
34
+ region: config?.region ?? (0, invalid_dependency_1.invalidProvider)("Region is missing"),
35
+ requestHandler: config?.requestHandler ?? new fetch_http_handler_1.FetchHttpHandler(defaultConfigProvider),
36
+ retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || middleware_retry_1.DEFAULT_RETRY_MODE),
37
+ sha256: config?.sha256 ?? sha256_browser_1.Sha256,
38
+ streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector,
39
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_DUALSTACK_ENDPOINT)),
40
+ useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(config_resolver_1.DEFAULT_USE_FIPS_ENDPOINT)),
41
+ utf8Decoder: config?.utf8Decoder ?? util_utf8_browser_1.fromUtf8,
42
+ utf8Encoder: config?.utf8Encoder ?? util_utf8_browser_1.toUtf8,
43
43
  };
44
44
  };
45
45
  exports.getRuntimeConfig = getRuntimeConfig;
@@ -19,7 +19,6 @@ const smithy_client_1 = require("@aws-sdk/smithy-client");
19
19
  const util_defaults_mode_node_1 = require("@aws-sdk/util-defaults-mode-node");
20
20
  const smithy_client_2 = require("@aws-sdk/smithy-client");
21
21
  const getRuntimeConfig = (config) => {
22
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
23
22
  (0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
24
23
  const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
25
24
  const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
@@ -29,24 +28,26 @@ const getRuntimeConfig = (config) => {
29
28
  ...config,
30
29
  runtime: "node",
31
30
  defaultsMode,
32
- base64Decoder: (_a = config === null || config === void 0 ? void 0 : config.base64Decoder) !== null && _a !== void 0 ? _a : util_base64_node_1.fromBase64,
33
- base64Encoder: (_b = config === null || config === void 0 ? void 0 : config.base64Encoder) !== null && _b !== void 0 ? _b : util_base64_node_1.toBase64,
34
- bodyLengthChecker: (_c = config === null || config === void 0 ? void 0 : config.bodyLengthChecker) !== null && _c !== void 0 ? _c : util_body_length_node_1.calculateBodyLength,
35
- credentialDefaultProvider: (_d = config === null || config === void 0 ? void 0 : config.credentialDefaultProvider) !== null && _d !== void 0 ? _d : (0, client_sts_1.decorateDefaultCredentialProvider)(credential_provider_node_1.defaultProvider),
36
- defaultUserAgentProvider: (_e = config === null || config === void 0 ? void 0 : config.defaultUserAgentProvider) !== null && _e !== void 0 ? _e : (0, util_user_agent_node_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
37
- maxAttempts: (_f = config === null || config === void 0 ? void 0 : config.maxAttempts) !== null && _f !== void 0 ? _f : (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
38
- region: (_g = config === null || config === void 0 ? void 0 : config.region) !== null && _g !== void 0 ? _g : (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS),
39
- requestHandler: (_h = config === null || config === void 0 ? void 0 : config.requestHandler) !== null && _h !== void 0 ? _h : new node_http_handler_1.NodeHttpHandler(defaultConfigProvider),
40
- retryMode: (_j = config === null || config === void 0 ? void 0 : config.retryMode) !== null && _j !== void 0 ? _j : (0, node_config_provider_1.loadConfig)({
41
- ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
42
- default: async () => (await defaultConfigProvider()).retryMode || middleware_retry_1.DEFAULT_RETRY_MODE,
43
- }),
44
- sha256: (_k = config === null || config === void 0 ? void 0 : config.sha256) !== null && _k !== void 0 ? _k : hash_node_1.Hash.bind(null, "sha256"),
45
- streamCollector: (_l = config === null || config === void 0 ? void 0 : config.streamCollector) !== null && _l !== void 0 ? _l : node_http_handler_1.streamCollector,
46
- useDualstackEndpoint: (_m = config === null || config === void 0 ? void 0 : config.useDualstackEndpoint) !== null && _m !== void 0 ? _m : (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
47
- useFipsEndpoint: (_o = config === null || config === void 0 ? void 0 : config.useFipsEndpoint) !== null && _o !== void 0 ? _o : (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
48
- utf8Decoder: (_p = config === null || config === void 0 ? void 0 : config.utf8Decoder) !== null && _p !== void 0 ? _p : util_utf8_node_1.fromUtf8,
49
- utf8Encoder: (_q = config === null || config === void 0 ? void 0 : config.utf8Encoder) !== null && _q !== void 0 ? _q : util_utf8_node_1.toUtf8,
31
+ base64Decoder: config?.base64Decoder ?? util_base64_node_1.fromBase64,
32
+ base64Encoder: config?.base64Encoder ?? util_base64_node_1.toBase64,
33
+ bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
34
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? (0, client_sts_1.decorateDefaultCredentialProvider)(credential_provider_node_1.defaultProvider),
35
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
36
+ (0, util_user_agent_node_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
37
+ maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
38
+ region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS),
39
+ requestHandler: config?.requestHandler ?? new node_http_handler_1.NodeHttpHandler(defaultConfigProvider),
40
+ retryMode: config?.retryMode ??
41
+ (0, node_config_provider_1.loadConfig)({
42
+ ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS,
43
+ default: async () => (await defaultConfigProvider()).retryMode || middleware_retry_1.DEFAULT_RETRY_MODE,
44
+ }),
45
+ sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
46
+ streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
47
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),
48
+ useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS),
49
+ utf8Decoder: config?.utf8Decoder ?? util_utf8_node_1.fromUtf8,
50
+ utf8Encoder: config?.utf8Encoder ?? util_utf8_node_1.toUtf8,
50
51
  };
51
52
  };
52
53
  exports.getRuntimeConfig = getRuntimeConfig;
@@ -4,13 +4,12 @@ exports.getRuntimeConfig = void 0;
4
4
  const sha256_js_1 = require("@aws-crypto/sha256-js");
5
5
  const runtimeConfig_browser_1 = require("./runtimeConfig.browser");
6
6
  const getRuntimeConfig = (config) => {
7
- var _a;
8
7
  const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config);
9
8
  return {
10
9
  ...browserDefaults,
11
10
  ...config,
12
11
  runtime: "react-native",
13
- sha256: (_a = config === null || config === void 0 ? void 0 : config.sha256) !== null && _a !== void 0 ? _a : sha256_js_1.Sha256,
12
+ sha256: config?.sha256 ?? sha256_js_1.Sha256,
14
13
  };
15
14
  };
16
15
  exports.getRuntimeConfig = getRuntimeConfig;
@@ -3,15 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRuntimeConfig = void 0;
4
4
  const url_parser_1 = require("@aws-sdk/url-parser");
5
5
  const endpointResolver_1 = require("./endpoint/endpointResolver");
6
- const getRuntimeConfig = (config) => {
7
- var _a, _b, _c, _d, _e;
8
- return ({
9
- apiVersion: "2018-06-27",
10
- disableHostPrefix: (_a = config === null || config === void 0 ? void 0 : config.disableHostPrefix) !== null && _a !== void 0 ? _a : false,
11
- endpointProvider: (_b = config === null || config === void 0 ? void 0 : config.endpointProvider) !== null && _b !== void 0 ? _b : endpointResolver_1.defaultEndpointResolver,
12
- logger: (_c = config === null || config === void 0 ? void 0 : config.logger) !== null && _c !== void 0 ? _c : {},
13
- serviceId: (_d = config === null || config === void 0 ? void 0 : config.serviceId) !== null && _d !== void 0 ? _d : "Textract",
14
- urlParser: (_e = config === null || config === void 0 ? void 0 : config.urlParser) !== null && _e !== void 0 ? _e : url_parser_1.parseUrl,
15
- });
16
- };
6
+ const getRuntimeConfig = (config) => ({
7
+ apiVersion: "2018-06-27",
8
+ disableHostPrefix: config?.disableHostPrefix ?? false,
9
+ endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
10
+ logger: config?.logger ?? {},
11
+ serviceId: config?.serviceId ?? "Textract",
12
+ urlParser: config?.urlParser ?? url_parser_1.parseUrl,
13
+ });
17
14
  exports.getRuntimeConfig = getRuntimeConfig;
@@ -307,6 +307,12 @@ export const AnalyzeDocumentResponseFilterSensitiveLog = (obj) => ({
307
307
  export const AnalyzeExpenseRequestFilterSensitiveLog = (obj) => ({
308
308
  ...obj,
309
309
  });
310
+ export const ExpenseCurrencyFilterSensitiveLog = (obj) => ({
311
+ ...obj,
312
+ });
313
+ export const ExpenseGroupPropertyFilterSensitiveLog = (obj) => ({
314
+ ...obj,
315
+ });
310
316
  export const ExpenseDetectionFilterSensitiveLog = (obj) => ({
311
317
  ...obj,
312
318
  });
@@ -1121,6 +1121,12 @@ const deserializeAws_json1_1EntityTypes = (output, context) => {
1121
1121
  });
1122
1122
  return retVal;
1123
1123
  };
1124
+ const deserializeAws_json1_1ExpenseCurrency = (output, context) => {
1125
+ return {
1126
+ Code: __expectString(output.Code),
1127
+ Confidence: __limitedParseFloat32(output.Confidence),
1128
+ };
1129
+ };
1124
1130
  const deserializeAws_json1_1ExpenseDetection = (output, context) => {
1125
1131
  return {
1126
1132
  Confidence: __limitedParseFloat32(output.Confidence),
@@ -1130,6 +1136,7 @@ const deserializeAws_json1_1ExpenseDetection = (output, context) => {
1130
1136
  };
1131
1137
  const deserializeAws_json1_1ExpenseDocument = (output, context) => {
1132
1138
  return {
1139
+ Blocks: output.Blocks != null ? deserializeAws_json1_1BlockList(output.Blocks, context) : undefined,
1133
1140
  ExpenseIndex: __expectInt32(output.ExpenseIndex),
1134
1141
  LineItemGroups: output.LineItemGroups != null
1135
1142
  ? deserializeAws_json1_1LineItemGroupList(output.LineItemGroups, context)
@@ -1150,6 +1157,10 @@ const deserializeAws_json1_1ExpenseDocumentList = (output, context) => {
1150
1157
  };
1151
1158
  const deserializeAws_json1_1ExpenseField = (output, context) => {
1152
1159
  return {
1160
+ Currency: output.Currency != null ? deserializeAws_json1_1ExpenseCurrency(output.Currency, context) : undefined,
1161
+ GroupProperties: output.GroupProperties != null
1162
+ ? deserializeAws_json1_1ExpenseGroupPropertyList(output.GroupProperties, context)
1163
+ : undefined,
1153
1164
  LabelDetection: output.LabelDetection != null
1154
1165
  ? deserializeAws_json1_1ExpenseDetection(output.LabelDetection, context)
1155
1166
  : undefined,
@@ -1171,6 +1182,23 @@ const deserializeAws_json1_1ExpenseFieldList = (output, context) => {
1171
1182
  });
1172
1183
  return retVal;
1173
1184
  };
1185
+ const deserializeAws_json1_1ExpenseGroupProperty = (output, context) => {
1186
+ return {
1187
+ Id: __expectString(output.Id),
1188
+ Types: output.Types != null ? deserializeAws_json1_1StringList(output.Types, context) : undefined,
1189
+ };
1190
+ };
1191
+ const deserializeAws_json1_1ExpenseGroupPropertyList = (output, context) => {
1192
+ const retVal = (output || [])
1193
+ .filter((e) => e != null)
1194
+ .map((entry) => {
1195
+ if (entry === null) {
1196
+ return null;
1197
+ }
1198
+ return deserializeAws_json1_1ExpenseGroupProperty(entry, context);
1199
+ });
1200
+ return retVal;
1201
+ };
1174
1202
  const deserializeAws_json1_1ExpenseType = (output, context) => {
1175
1203
  return {
1176
1204
  Confidence: __limitedParseFloat32(output.Confidence),
@@ -1263,6 +1291,7 @@ const deserializeAws_json1_1IdempotentParameterMismatchException = (output, cont
1263
1291
  };
1264
1292
  const deserializeAws_json1_1IdentityDocument = (output, context) => {
1265
1293
  return {
1294
+ Blocks: output.Blocks != null ? deserializeAws_json1_1BlockList(output.Blocks, context) : undefined,
1266
1295
  DocumentIndex: __expectInt32(output.DocumentIndex),
1267
1296
  IdentityDocumentFields: output.IdentityDocumentFields != null
1268
1297
  ? deserializeAws_json1_1IdentityDocumentFieldList(output.IdentityDocumentFields, context)
@@ -1471,6 +1500,17 @@ const deserializeAws_json1_1StartExpenseAnalysisResponse = (output, context) =>
1471
1500
  JobId: __expectString(output.JobId),
1472
1501
  };
1473
1502
  };
1503
+ const deserializeAws_json1_1StringList = (output, context) => {
1504
+ const retVal = (output || [])
1505
+ .filter((e) => e != null)
1506
+ .map((entry) => {
1507
+ if (entry === null) {
1508
+ return null;
1509
+ }
1510
+ return __expectString(entry);
1511
+ });
1512
+ return retVal;
1513
+ };
1474
1514
  const deserializeAws_json1_1ThrottlingException = (output, context) => {
1475
1515
  return {
1476
1516
  Code: __expectString(output.Code),