@aws-sdk/middleware-sdk-rds 3.198.0 → 3.200.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 +19 -0
- package/dist-cjs/index.js +13 -4
- package/dist-es/index.js +13 -4
- package/dist-types/index.d.ts +3 -3
- package/dist-types/ts3.4/index.d.ts +5 -3
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.200.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.199.0...v3.200.0) (2022-10-31)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **endpoint:** instruct rds middleware to wait for endpoint resolution ([#4120](https://github.com/aws/aws-sdk-js-v3/issues/4120)) ([7cabc1e](https://github.com/aws/aws-sdk-js-v3/commit/7cabc1ebe4f1f8c37b29b421572b69cf57d2eb4b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.199.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.198.0...v3.199.0) (2022-10-28)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @aws-sdk/middleware-sdk-rds
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [3.198.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.197.0...v3.198.0) (2022-10-27)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @aws-sdk/middleware-sdk-rds
|
package/dist-cjs/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCrossRegionPresignedUrlPlugin = exports.crossRegionPresignedUrlMiddlewareOptions = exports.crossRegionPresignedUrlMiddleware = void 0;
|
|
4
|
+
const middleware_endpoint_1 = require("@aws-sdk/middleware-endpoint");
|
|
4
5
|
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
5
6
|
const signature_v4_1 = require("@aws-sdk/signature-v4");
|
|
6
7
|
const util_format_url_1 = require("@aws-sdk/util-format-url");
|
|
@@ -14,7 +15,7 @@ const sourceIdToCommandKeyMap = {
|
|
|
14
15
|
};
|
|
15
16
|
const version = "2014-10-31";
|
|
16
17
|
function crossRegionPresignedUrlMiddleware(options) {
|
|
17
|
-
return (next) => async (args) => {
|
|
18
|
+
return (next, context) => async (args) => {
|
|
18
19
|
const { input } = args;
|
|
19
20
|
const region = await options.region();
|
|
20
21
|
const sourceIdKey = Object.keys(sourceIdToCommandKeyMap).filter((sourceKeyId) => input.hasOwnProperty(sourceKeyId))[0];
|
|
@@ -23,7 +24,13 @@ function crossRegionPresignedUrlMiddleware(options) {
|
|
|
23
24
|
const command = sourceIdToCommandKeyMap[sourceIdKey];
|
|
24
25
|
if (!input.PreSignedUrl && isARN(input[sourceIdKey]) && region !== getEndpointFromARN(input[sourceIdKey])) {
|
|
25
26
|
const sourceRegion = getEndpointFromARN(input[sourceIdKey]);
|
|
26
|
-
|
|
27
|
+
let resolvedEndpoint;
|
|
28
|
+
if (typeof options.endpoint === "function") {
|
|
29
|
+
resolvedEndpoint = await options.endpoint();
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
resolvedEndpoint = (0, middleware_endpoint_1.toEndpointV1)(context.endpointV2);
|
|
33
|
+
}
|
|
27
34
|
resolvedEndpoint.hostname = `rds.${sourceRegion}.amazonaws.com`;
|
|
28
35
|
const request = new protocol_http_1.HttpRequest({
|
|
29
36
|
...resolvedEndpoint,
|
|
@@ -62,14 +69,16 @@ function crossRegionPresignedUrlMiddleware(options) {
|
|
|
62
69
|
}
|
|
63
70
|
exports.crossRegionPresignedUrlMiddleware = crossRegionPresignedUrlMiddleware;
|
|
64
71
|
exports.crossRegionPresignedUrlMiddlewareOptions = {
|
|
65
|
-
step: "
|
|
72
|
+
step: "serialize",
|
|
66
73
|
tags: ["CROSS_REGION_PRESIGNED_URL"],
|
|
67
74
|
name: "crossRegionPresignedUrlMiddleware",
|
|
68
75
|
override: true,
|
|
76
|
+
relation: "after",
|
|
77
|
+
toMiddleware: "endpointV2Middleware",
|
|
69
78
|
};
|
|
70
79
|
const getCrossRegionPresignedUrlPlugin = (config) => ({
|
|
71
80
|
applyToStack: (clientStack) => {
|
|
72
|
-
clientStack.
|
|
81
|
+
clientStack.addRelativeTo(crossRegionPresignedUrlMiddleware(config), exports.crossRegionPresignedUrlMiddlewareOptions);
|
|
73
82
|
},
|
|
74
83
|
});
|
|
75
84
|
exports.getCrossRegionPresignedUrlPlugin = getCrossRegionPresignedUrlPlugin;
|
package/dist-es/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { toEndpointV1 } from "@aws-sdk/middleware-endpoint";
|
|
1
2
|
import { HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
3
|
import { SignatureV4 } from "@aws-sdk/signature-v4";
|
|
3
4
|
import { formatUrl } from "@aws-sdk/util-format-url";
|
|
@@ -11,7 +12,7 @@ const sourceIdToCommandKeyMap = {
|
|
|
11
12
|
};
|
|
12
13
|
const version = "2014-10-31";
|
|
13
14
|
export function crossRegionPresignedUrlMiddleware(options) {
|
|
14
|
-
return (next) => async (args) => {
|
|
15
|
+
return (next, context) => async (args) => {
|
|
15
16
|
const { input } = args;
|
|
16
17
|
const region = await options.region();
|
|
17
18
|
const sourceIdKey = Object.keys(sourceIdToCommandKeyMap).filter((sourceKeyId) => input.hasOwnProperty(sourceKeyId))[0];
|
|
@@ -20,7 +21,13 @@ export function crossRegionPresignedUrlMiddleware(options) {
|
|
|
20
21
|
const command = sourceIdToCommandKeyMap[sourceIdKey];
|
|
21
22
|
if (!input.PreSignedUrl && isARN(input[sourceIdKey]) && region !== getEndpointFromARN(input[sourceIdKey])) {
|
|
22
23
|
const sourceRegion = getEndpointFromARN(input[sourceIdKey]);
|
|
23
|
-
|
|
24
|
+
let resolvedEndpoint;
|
|
25
|
+
if (typeof options.endpoint === "function") {
|
|
26
|
+
resolvedEndpoint = await options.endpoint();
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
resolvedEndpoint = toEndpointV1(context.endpointV2);
|
|
30
|
+
}
|
|
24
31
|
resolvedEndpoint.hostname = `rds.${sourceRegion}.amazonaws.com`;
|
|
25
32
|
const request = new HttpRequest({
|
|
26
33
|
...resolvedEndpoint,
|
|
@@ -58,14 +65,16 @@ export function crossRegionPresignedUrlMiddleware(options) {
|
|
|
58
65
|
};
|
|
59
66
|
}
|
|
60
67
|
export const crossRegionPresignedUrlMiddlewareOptions = {
|
|
61
|
-
step: "
|
|
68
|
+
step: "serialize",
|
|
62
69
|
tags: ["CROSS_REGION_PRESIGNED_URL"],
|
|
63
70
|
name: "crossRegionPresignedUrlMiddleware",
|
|
64
71
|
override: true,
|
|
72
|
+
relation: "after",
|
|
73
|
+
toMiddleware: "endpointV2Middleware",
|
|
65
74
|
};
|
|
66
75
|
export const getCrossRegionPresignedUrlPlugin = (config) => ({
|
|
67
76
|
applyToStack: (clientStack) => {
|
|
68
|
-
clientStack.
|
|
77
|
+
clientStack.addRelativeTo(crossRegionPresignedUrlMiddleware(config), crossRegionPresignedUrlMiddlewareOptions);
|
|
69
78
|
},
|
|
70
79
|
});
|
|
71
80
|
function isARN(id) {
|
package/dist-types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Credentials, Endpoint, HashConstructor,
|
|
1
|
+
import { Credentials, Endpoint, HashConstructor, InitializeMiddleware, MemoizedProvider, Pluggable, Provider, RelativeMiddlewareOptions, SerializeHandlerOptions } from "@aws-sdk/types";
|
|
2
2
|
interface PreviouslyResolved {
|
|
3
3
|
credentials: MemoizedProvider<Credentials>;
|
|
4
|
-
endpoint
|
|
4
|
+
endpoint?: Provider<Endpoint>;
|
|
5
5
|
region: Provider<string>;
|
|
6
6
|
sha256: HashConstructor;
|
|
7
7
|
signingEscapePath: boolean;
|
|
@@ -11,6 +11,6 @@ interface PreviouslyResolved {
|
|
|
11
11
|
* The presigned URL is generated by sigV4
|
|
12
12
|
*/
|
|
13
13
|
export declare function crossRegionPresignedUrlMiddleware(options: PreviouslyResolved): InitializeMiddleware<any, any>;
|
|
14
|
-
export declare const crossRegionPresignedUrlMiddlewareOptions:
|
|
14
|
+
export declare const crossRegionPresignedUrlMiddlewareOptions: SerializeHandlerOptions & RelativeMiddlewareOptions;
|
|
15
15
|
export declare const getCrossRegionPresignedUrlPlugin: (config: PreviouslyResolved) => Pluggable<any, any>;
|
|
16
16
|
export {};
|
|
@@ -2,15 +2,16 @@ import {
|
|
|
2
2
|
Credentials,
|
|
3
3
|
Endpoint,
|
|
4
4
|
HashConstructor,
|
|
5
|
-
InitializeHandlerOptions,
|
|
6
5
|
InitializeMiddleware,
|
|
7
6
|
MemoizedProvider,
|
|
8
7
|
Pluggable,
|
|
9
8
|
Provider,
|
|
9
|
+
RelativeMiddlewareOptions,
|
|
10
|
+
SerializeHandlerOptions,
|
|
10
11
|
} from "@aws-sdk/types";
|
|
11
12
|
interface PreviouslyResolved {
|
|
12
13
|
credentials: MemoizedProvider<Credentials>;
|
|
13
|
-
endpoint
|
|
14
|
+
endpoint?: Provider<Endpoint>;
|
|
14
15
|
region: Provider<string>;
|
|
15
16
|
sha256: HashConstructor;
|
|
16
17
|
signingEscapePath: boolean;
|
|
@@ -18,7 +19,8 @@ interface PreviouslyResolved {
|
|
|
18
19
|
export declare function crossRegionPresignedUrlMiddleware(
|
|
19
20
|
options: PreviouslyResolved
|
|
20
21
|
): InitializeMiddleware<any, any>;
|
|
21
|
-
export declare const crossRegionPresignedUrlMiddlewareOptions:
|
|
22
|
+
export declare const crossRegionPresignedUrlMiddlewareOptions: SerializeHandlerOptions &
|
|
23
|
+
RelativeMiddlewareOptions;
|
|
22
24
|
export declare const getCrossRegionPresignedUrlPlugin: (
|
|
23
25
|
config: PreviouslyResolved
|
|
24
26
|
) => Pluggable<any, any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-sdk-rds",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.200.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
6
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -20,10 +20,11 @@
|
|
|
20
20
|
},
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@aws-sdk/
|
|
24
|
-
"@aws-sdk/
|
|
25
|
-
"@aws-sdk/
|
|
26
|
-
"@aws-sdk/
|
|
23
|
+
"@aws-sdk/middleware-endpoint": "3.200.0",
|
|
24
|
+
"@aws-sdk/protocol-http": "3.200.0",
|
|
25
|
+
"@aws-sdk/signature-v4": "3.200.0",
|
|
26
|
+
"@aws-sdk/types": "3.200.0",
|
|
27
|
+
"@aws-sdk/util-format-url": "3.200.0",
|
|
27
28
|
"tslib": "^2.3.1"
|
|
28
29
|
},
|
|
29
30
|
"engines": {
|