@aws-sdk/client-rds-data 3.523.0 → 3.529.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/dist-cjs/index.js CHANGED
@@ -692,7 +692,7 @@ var de_BatchExecuteStatementCommand = /* @__PURE__ */ __name(async (output, cont
692
692
  const contents = (0, import_smithy_client.map)({
693
693
  $metadata: deserializeMetadata(output)
694
694
  });
695
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
695
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
696
696
  const doc = (0, import_smithy_client.take)(data, {
697
697
  updateResults: (_) => de_UpdateResults(_, context)
698
698
  });
@@ -706,7 +706,7 @@ var de_BeginTransactionCommand = /* @__PURE__ */ __name(async (output, context)
706
706
  const contents = (0, import_smithy_client.map)({
707
707
  $metadata: deserializeMetadata(output)
708
708
  });
709
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
709
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
710
710
  const doc = (0, import_smithy_client.take)(data, {
711
711
  transactionId: import_smithy_client.expectString
712
712
  });
@@ -720,7 +720,7 @@ var de_CommitTransactionCommand = /* @__PURE__ */ __name(async (output, context)
720
720
  const contents = (0, import_smithy_client.map)({
721
721
  $metadata: deserializeMetadata(output)
722
722
  });
723
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
723
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
724
724
  const doc = (0, import_smithy_client.take)(data, {
725
725
  transactionStatus: import_smithy_client.expectString
726
726
  });
@@ -734,7 +734,7 @@ var de_ExecuteSqlCommand = /* @__PURE__ */ __name(async (output, context) => {
734
734
  const contents = (0, import_smithy_client.map)({
735
735
  $metadata: deserializeMetadata(output)
736
736
  });
737
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
737
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
738
738
  const doc = (0, import_smithy_client.take)(data, {
739
739
  sqlStatementResults: (_) => de_SqlStatementResults(_, context)
740
740
  });
@@ -748,7 +748,7 @@ var de_ExecuteStatementCommand = /* @__PURE__ */ __name(async (output, context)
748
748
  const contents = (0, import_smithy_client.map)({
749
749
  $metadata: deserializeMetadata(output)
750
750
  });
751
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
751
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
752
752
  const doc = (0, import_smithy_client.take)(data, {
753
753
  columnMetadata: import_smithy_client._json,
754
754
  formattedRecords: import_smithy_client.expectString,
@@ -766,7 +766,7 @@ var de_RollbackTransactionCommand = /* @__PURE__ */ __name(async (output, contex
766
766
  const contents = (0, import_smithy_client.map)({
767
767
  $metadata: deserializeMetadata(output)
768
768
  });
769
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
769
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
770
770
  const doc = (0, import_smithy_client.take)(data, {
771
771
  transactionStatus: import_smithy_client.expectString
772
772
  });
@@ -776,9 +776,9 @@ var de_RollbackTransactionCommand = /* @__PURE__ */ __name(async (output, contex
776
776
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
777
777
  const parsedOutput = {
778
778
  ...output,
779
- body: await parseErrorBody(output.body, context)
779
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
780
780
  };
781
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
781
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
782
782
  switch (errorCode) {
783
783
  case "AccessDeniedException":
784
784
  case "com.amazonaws.rdsdata#AccessDeniedException":
@@ -1256,47 +1256,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
1256
1256
  extendedRequestId: output.headers["x-amz-id-2"],
1257
1257
  cfId: output.headers["x-amz-cf-id"]
1258
1258
  }), "deserializeMetadata");
1259
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
1260
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1261
- if (encoded.length) {
1262
- return JSON.parse(encoded);
1263
- }
1264
- return {};
1265
- }), "parseBody");
1266
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
1267
- const value = await parseBody(errorBody, context);
1268
- value.message = value.message ?? value.Message;
1269
- return value;
1270
- }, "parseErrorBody");
1271
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
1272
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
1273
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
1274
- let cleanValue = rawValue;
1275
- if (typeof cleanValue === "number") {
1276
- cleanValue = cleanValue.toString();
1277
- }
1278
- if (cleanValue.indexOf(",") >= 0) {
1279
- cleanValue = cleanValue.split(",")[0];
1280
- }
1281
- if (cleanValue.indexOf(":") >= 0) {
1282
- cleanValue = cleanValue.split(":")[0];
1283
- }
1284
- if (cleanValue.indexOf("#") >= 0) {
1285
- cleanValue = cleanValue.split("#")[1];
1286
- }
1287
- return cleanValue;
1288
- }, "sanitizeErrorCode");
1289
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1290
- if (headerKey !== void 0) {
1291
- return sanitizeErrorCode(output.headers[headerKey]);
1292
- }
1293
- if (data.code !== void 0) {
1294
- return sanitizeErrorCode(data.code);
1295
- }
1296
- if (data["__type"] !== void 0) {
1297
- return sanitizeErrorCode(data["__type"]);
1298
- }
1299
- }, "loadRestJsonErrorCode");
1300
1259
 
1301
1260
  // src/commands/BatchExecuteStatementCommand.ts
1302
1261
  var _BatchExecuteStatementCommand = class _BatchExecuteStatementCommand extends import_smithy_client.Command.classBuilder().ep({
@@ -1,4 +1,4 @@
1
- import { awsExpectUnion as __expectUnion } from "@aws-sdk/core";
1
+ import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
2
2
  import { requestBuilder as rb } from "@smithy/core";
3
3
  import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, limitedParseFloat32 as __limitedParseFloat32, map, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
4
4
  import { AccessDeniedException, ArrayValue, BadRequestException, DatabaseErrorException, DatabaseNotFoundException, DatabaseUnavailableException, Field, ForbiddenException, HttpEndpointNotEnabledException, InternalServerErrorException, InvalidSecretException, NotFoundException, SecretsErrorException, ServiceUnavailableError, StatementTimeoutException, TransactionNotFoundException, UnsupportedResultException, } from "../models/models_0";
@@ -711,43 +711,3 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
711
711
  value !== "" &&
712
712
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
713
713
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
714
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
715
- if (encoded.length) {
716
- return JSON.parse(encoded);
717
- }
718
- return {};
719
- });
720
- const parseErrorBody = async (errorBody, context) => {
721
- const value = await parseBody(errorBody, context);
722
- value.message = value.message ?? value.Message;
723
- return value;
724
- };
725
- const loadRestJsonErrorCode = (output, data) => {
726
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
727
- const sanitizeErrorCode = (rawValue) => {
728
- let cleanValue = rawValue;
729
- if (typeof cleanValue === "number") {
730
- cleanValue = cleanValue.toString();
731
- }
732
- if (cleanValue.indexOf(",") >= 0) {
733
- cleanValue = cleanValue.split(",")[0];
734
- }
735
- if (cleanValue.indexOf(":") >= 0) {
736
- cleanValue = cleanValue.split(":")[0];
737
- }
738
- if (cleanValue.indexOf("#") >= 0) {
739
- cleanValue = cleanValue.split("#")[1];
740
- }
741
- return cleanValue;
742
- };
743
- const headerKey = findKey(output.headers, "x-amzn-errortype");
744
- if (headerKey !== undefined) {
745
- return sanitizeErrorCode(output.headers[headerKey]);
746
- }
747
- if (data.code !== undefined) {
748
- return sanitizeErrorCode(data.code);
749
- }
750
- if (data["__type"] !== undefined) {
751
- return sanitizeErrorCode(data["__type"]);
752
- }
753
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-rds-data",
3
3
  "description": "AWS SDK for JavaScript Rds Data Client for Node.js, Browser and React Native",
4
- "version": "3.523.0",
4
+ "version": "3.529.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-rds-data",
@@ -20,40 +20,40 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "3.0.0",
22
22
  "@aws-crypto/sha256-js": "3.0.0",
23
- "@aws-sdk/client-sts": "3.523.0",
24
- "@aws-sdk/core": "3.523.0",
25
- "@aws-sdk/credential-provider-node": "3.523.0",
23
+ "@aws-sdk/client-sts": "3.529.0",
24
+ "@aws-sdk/core": "3.529.0",
25
+ "@aws-sdk/credential-provider-node": "3.529.0",
26
26
  "@aws-sdk/middleware-host-header": "3.523.0",
27
27
  "@aws-sdk/middleware-logger": "3.523.0",
28
28
  "@aws-sdk/middleware-recursion-detection": "3.523.0",
29
- "@aws-sdk/middleware-user-agent": "3.523.0",
30
- "@aws-sdk/region-config-resolver": "3.523.0",
29
+ "@aws-sdk/middleware-user-agent": "3.525.0",
30
+ "@aws-sdk/region-config-resolver": "3.525.0",
31
31
  "@aws-sdk/types": "3.523.0",
32
- "@aws-sdk/util-endpoints": "3.523.0",
32
+ "@aws-sdk/util-endpoints": "3.525.0",
33
33
  "@aws-sdk/util-user-agent-browser": "3.523.0",
34
- "@aws-sdk/util-user-agent-node": "3.523.0",
35
- "@smithy/config-resolver": "^2.1.3",
36
- "@smithy/core": "^1.3.4",
34
+ "@aws-sdk/util-user-agent-node": "3.525.0",
35
+ "@smithy/config-resolver": "^2.1.4",
36
+ "@smithy/core": "^1.3.5",
37
37
  "@smithy/fetch-http-handler": "^2.4.3",
38
38
  "@smithy/hash-node": "^2.1.3",
39
39
  "@smithy/invalid-dependency": "^2.1.3",
40
40
  "@smithy/middleware-content-length": "^2.1.3",
41
- "@smithy/middleware-endpoint": "^2.4.3",
42
- "@smithy/middleware-retry": "^2.1.3",
41
+ "@smithy/middleware-endpoint": "^2.4.4",
42
+ "@smithy/middleware-retry": "^2.1.4",
43
43
  "@smithy/middleware-serde": "^2.1.3",
44
44
  "@smithy/middleware-stack": "^2.1.3",
45
- "@smithy/node-config-provider": "^2.2.3",
45
+ "@smithy/node-config-provider": "^2.2.4",
46
46
  "@smithy/node-http-handler": "^2.4.1",
47
47
  "@smithy/protocol-http": "^3.2.1",
48
- "@smithy/smithy-client": "^2.4.1",
48
+ "@smithy/smithy-client": "^2.4.2",
49
49
  "@smithy/types": "^2.10.1",
50
50
  "@smithy/url-parser": "^2.1.3",
51
51
  "@smithy/util-base64": "^2.1.1",
52
52
  "@smithy/util-body-length-browser": "^2.1.1",
53
53
  "@smithy/util-body-length-node": "^2.2.1",
54
- "@smithy/util-defaults-mode-browser": "^2.1.3",
55
- "@smithy/util-defaults-mode-node": "^2.2.2",
56
- "@smithy/util-endpoints": "^1.1.3",
54
+ "@smithy/util-defaults-mode-browser": "^2.1.4",
55
+ "@smithy/util-defaults-mode-node": "^2.2.3",
56
+ "@smithy/util-endpoints": "^1.1.4",
57
57
  "@smithy/util-middleware": "^2.1.3",
58
58
  "@smithy/util-retry": "^2.1.3",
59
59
  "@smithy/util-utf8": "^2.1.1",
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");