@aws-sdk/client-redshift-data 3.525.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 +12 -53
- package/dist-es/protocols/Aws_json1_1.js +1 -41
- package/package.json +4 -4
package/dist-cjs/index.js
CHANGED
|
@@ -457,7 +457,7 @@ var de_BatchExecuteStatementCommand = /* @__PURE__ */ __name(async (output, cont
|
|
|
457
457
|
if (output.statusCode >= 300) {
|
|
458
458
|
return de_CommandError(output, context);
|
|
459
459
|
}
|
|
460
|
-
const data = await
|
|
460
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
461
461
|
let contents = {};
|
|
462
462
|
contents = de_BatchExecuteStatementOutput(data, context);
|
|
463
463
|
const response = {
|
|
@@ -470,7 +470,7 @@ var de_CancelStatementCommand = /* @__PURE__ */ __name(async (output, context) =
|
|
|
470
470
|
if (output.statusCode >= 300) {
|
|
471
471
|
return de_CommandError(output, context);
|
|
472
472
|
}
|
|
473
|
-
const data = await
|
|
473
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
474
474
|
let contents = {};
|
|
475
475
|
contents = (0, import_smithy_client._json)(data);
|
|
476
476
|
const response = {
|
|
@@ -483,7 +483,7 @@ var de_DescribeStatementCommand = /* @__PURE__ */ __name(async (output, context)
|
|
|
483
483
|
if (output.statusCode >= 300) {
|
|
484
484
|
return de_CommandError(output, context);
|
|
485
485
|
}
|
|
486
|
-
const data = await
|
|
486
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
487
487
|
let contents = {};
|
|
488
488
|
contents = de_DescribeStatementResponse(data, context);
|
|
489
489
|
const response = {
|
|
@@ -496,7 +496,7 @@ var de_DescribeTableCommand = /* @__PURE__ */ __name(async (output, context) =>
|
|
|
496
496
|
if (output.statusCode >= 300) {
|
|
497
497
|
return de_CommandError(output, context);
|
|
498
498
|
}
|
|
499
|
-
const data = await
|
|
499
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
500
500
|
let contents = {};
|
|
501
501
|
contents = (0, import_smithy_client._json)(data);
|
|
502
502
|
const response = {
|
|
@@ -509,7 +509,7 @@ var de_ExecuteStatementCommand = /* @__PURE__ */ __name(async (output, context)
|
|
|
509
509
|
if (output.statusCode >= 300) {
|
|
510
510
|
return de_CommandError(output, context);
|
|
511
511
|
}
|
|
512
|
-
const data = await
|
|
512
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
513
513
|
let contents = {};
|
|
514
514
|
contents = de_ExecuteStatementOutput(data, context);
|
|
515
515
|
const response = {
|
|
@@ -522,7 +522,7 @@ var de_GetStatementResultCommand = /* @__PURE__ */ __name(async (output, context
|
|
|
522
522
|
if (output.statusCode >= 300) {
|
|
523
523
|
return de_CommandError(output, context);
|
|
524
524
|
}
|
|
525
|
-
const data = await
|
|
525
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
526
526
|
let contents = {};
|
|
527
527
|
contents = de_GetStatementResultResponse(data, context);
|
|
528
528
|
const response = {
|
|
@@ -535,7 +535,7 @@ var de_ListDatabasesCommand = /* @__PURE__ */ __name(async (output, context) =>
|
|
|
535
535
|
if (output.statusCode >= 300) {
|
|
536
536
|
return de_CommandError(output, context);
|
|
537
537
|
}
|
|
538
|
-
const data = await
|
|
538
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
539
539
|
let contents = {};
|
|
540
540
|
contents = (0, import_smithy_client._json)(data);
|
|
541
541
|
const response = {
|
|
@@ -548,7 +548,7 @@ var de_ListSchemasCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
548
548
|
if (output.statusCode >= 300) {
|
|
549
549
|
return de_CommandError(output, context);
|
|
550
550
|
}
|
|
551
|
-
const data = await
|
|
551
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
552
552
|
let contents = {};
|
|
553
553
|
contents = (0, import_smithy_client._json)(data);
|
|
554
554
|
const response = {
|
|
@@ -561,7 +561,7 @@ var de_ListStatementsCommand = /* @__PURE__ */ __name(async (output, context) =>
|
|
|
561
561
|
if (output.statusCode >= 300) {
|
|
562
562
|
return de_CommandError(output, context);
|
|
563
563
|
}
|
|
564
|
-
const data = await
|
|
564
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
565
565
|
let contents = {};
|
|
566
566
|
contents = de_ListStatementsResponse(data, context);
|
|
567
567
|
const response = {
|
|
@@ -574,7 +574,7 @@ var de_ListTablesCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
574
574
|
if (output.statusCode >= 300) {
|
|
575
575
|
return de_CommandError(output, context);
|
|
576
576
|
}
|
|
577
|
-
const data = await
|
|
577
|
+
const data = await (0, import_core2.parseJsonBody)(output.body, context);
|
|
578
578
|
let contents = {};
|
|
579
579
|
contents = (0, import_smithy_client._json)(data);
|
|
580
580
|
const response = {
|
|
@@ -586,9 +586,9 @@ var de_ListTablesCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
586
586
|
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
587
587
|
const parsedOutput = {
|
|
588
588
|
...output,
|
|
589
|
-
body: await
|
|
589
|
+
body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
|
|
590
590
|
};
|
|
591
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
591
|
+
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
592
592
|
switch (errorCode) {
|
|
593
593
|
case "ActiveStatementsExceededException":
|
|
594
594
|
case "com.amazonaws.redshiftdata#ActiveStatementsExceededException":
|
|
@@ -851,7 +851,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
|
851
851
|
extendedRequestId: output.headers["x-amz-id-2"],
|
|
852
852
|
cfId: output.headers["x-amz-cf-id"]
|
|
853
853
|
}), "deserializeMetadata");
|
|
854
|
-
var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
|
|
855
854
|
var throwDefaultError = (0, import_smithy_client.withBaseException)(RedshiftDataServiceException);
|
|
856
855
|
var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
|
|
857
856
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
@@ -878,46 +877,6 @@ function sharedHeaders(operation) {
|
|
|
878
877
|
};
|
|
879
878
|
}
|
|
880
879
|
__name(sharedHeaders, "sharedHeaders");
|
|
881
|
-
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
882
|
-
if (encoded.length) {
|
|
883
|
-
return JSON.parse(encoded);
|
|
884
|
-
}
|
|
885
|
-
return {};
|
|
886
|
-
}), "parseBody");
|
|
887
|
-
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
|
|
888
|
-
const value = await parseBody(errorBody, context);
|
|
889
|
-
value.message = value.message ?? value.Message;
|
|
890
|
-
return value;
|
|
891
|
-
}, "parseErrorBody");
|
|
892
|
-
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
893
|
-
const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
|
|
894
|
-
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
|
|
895
|
-
let cleanValue = rawValue;
|
|
896
|
-
if (typeof cleanValue === "number") {
|
|
897
|
-
cleanValue = cleanValue.toString();
|
|
898
|
-
}
|
|
899
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
900
|
-
cleanValue = cleanValue.split(",")[0];
|
|
901
|
-
}
|
|
902
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
903
|
-
cleanValue = cleanValue.split(":")[0];
|
|
904
|
-
}
|
|
905
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
906
|
-
cleanValue = cleanValue.split("#")[1];
|
|
907
|
-
}
|
|
908
|
-
return cleanValue;
|
|
909
|
-
}, "sanitizeErrorCode");
|
|
910
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
911
|
-
if (headerKey !== void 0) {
|
|
912
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
913
|
-
}
|
|
914
|
-
if (data.code !== void 0) {
|
|
915
|
-
return sanitizeErrorCode(data.code);
|
|
916
|
-
}
|
|
917
|
-
if (data["__type"] !== void 0) {
|
|
918
|
-
return sanitizeErrorCode(data["__type"]);
|
|
919
|
-
}
|
|
920
|
-
}, "loadRestJsonErrorCode");
|
|
921
880
|
|
|
922
881
|
// src/commands/BatchExecuteStatementCommand.ts
|
|
923
882
|
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 { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
|
|
3
3
|
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
|
|
4
4
|
import { v4 as generateIdempotencyToken } from "uuid";
|
|
@@ -496,43 +496,3 @@ function sharedHeaders(operation) {
|
|
|
496
496
|
"x-amz-target": `RedshiftData.${operation}`,
|
|
497
497
|
};
|
|
498
498
|
}
|
|
499
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
500
|
-
if (encoded.length) {
|
|
501
|
-
return JSON.parse(encoded);
|
|
502
|
-
}
|
|
503
|
-
return {};
|
|
504
|
-
});
|
|
505
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
506
|
-
const value = await parseBody(errorBody, context);
|
|
507
|
-
value.message = value.message ?? value.Message;
|
|
508
|
-
return value;
|
|
509
|
-
};
|
|
510
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
511
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
512
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
513
|
-
let cleanValue = rawValue;
|
|
514
|
-
if (typeof cleanValue === "number") {
|
|
515
|
-
cleanValue = cleanValue.toString();
|
|
516
|
-
}
|
|
517
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
518
|
-
cleanValue = cleanValue.split(",")[0];
|
|
519
|
-
}
|
|
520
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
521
|
-
cleanValue = cleanValue.split(":")[0];
|
|
522
|
-
}
|
|
523
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
524
|
-
cleanValue = cleanValue.split("#")[1];
|
|
525
|
-
}
|
|
526
|
-
return cleanValue;
|
|
527
|
-
};
|
|
528
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
529
|
-
if (headerKey !== undefined) {
|
|
530
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
531
|
-
}
|
|
532
|
-
if (data.code !== undefined) {
|
|
533
|
-
return sanitizeErrorCode(data.code);
|
|
534
|
-
}
|
|
535
|
-
if (data["__type"] !== undefined) {
|
|
536
|
-
return sanitizeErrorCode(data["__type"]);
|
|
537
|
-
}
|
|
538
|
-
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-redshift-data",
|
|
3
3
|
"description": "AWS SDK for JavaScript Redshift Data Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
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-redshift-data",
|
|
@@ -20,9 +20,9 @@
|
|
|
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.
|
|
24
|
-
"@aws-sdk/core": "3.
|
|
25
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
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",
|