@aws-sdk/middleware-sdk-ec2 3.972.33 → 3.972.35
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 +11 -13
- package/package.json +6 -6
package/dist-cjs/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var protocols = require('@smithy/core/protocols');
|
|
6
|
-
var signatureV4 = require('@smithy/signature-v4');
|
|
1
|
+
const { formatUrl } = require("@aws-sdk/core/util");
|
|
2
|
+
const { getEndpointFromInstructions, toEndpointV1 } = require("@smithy/core/endpoints");
|
|
3
|
+
const { HttpRequest, extendedEncodeURIComponent } = require("@smithy/core/protocols");
|
|
4
|
+
const { SignatureV4 } = require("@smithy/signature-v4");
|
|
7
5
|
|
|
8
6
|
const version = "2016-11-15";
|
|
9
7
|
function copySnapshotPresignedUrlMiddleware(options) {
|
|
@@ -11,7 +9,7 @@ function copySnapshotPresignedUrlMiddleware(options) {
|
|
|
11
9
|
const { input } = args;
|
|
12
10
|
if (!input.PresignedUrl) {
|
|
13
11
|
const destinationRegion = await options.region();
|
|
14
|
-
const endpoint = await
|
|
12
|
+
const endpoint = await getEndpointFromInstructions(input, {
|
|
15
13
|
getEndpointParameterInstructions() {
|
|
16
14
|
return {
|
|
17
15
|
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
@@ -24,8 +22,8 @@ function copySnapshotPresignedUrlMiddleware(options) {
|
|
|
24
22
|
...options,
|
|
25
23
|
region: input.SourceRegion,
|
|
26
24
|
});
|
|
27
|
-
const resolvedEndpoint = typeof options.endpoint === "function" ? await options.endpoint() :
|
|
28
|
-
const requestToSign = new
|
|
25
|
+
const resolvedEndpoint = typeof options.endpoint === "function" ? await options.endpoint() : toEndpointV1(endpoint);
|
|
26
|
+
const requestToSign = new HttpRequest({
|
|
29
27
|
...resolvedEndpoint,
|
|
30
28
|
protocol: "https",
|
|
31
29
|
headers: {
|
|
@@ -41,7 +39,7 @@ function copySnapshotPresignedUrlMiddleware(options) {
|
|
|
41
39
|
DestinationRegion: destinationRegion,
|
|
42
40
|
},
|
|
43
41
|
});
|
|
44
|
-
const signer = new
|
|
42
|
+
const signer = new SignatureV4({
|
|
45
43
|
credentials: options.credentials,
|
|
46
44
|
region: input.SourceRegion,
|
|
47
45
|
service: "ec2",
|
|
@@ -56,16 +54,16 @@ function copySnapshotPresignedUrlMiddleware(options) {
|
|
|
56
54
|
input: {
|
|
57
55
|
...args.input,
|
|
58
56
|
DestinationRegion: destinationRegion,
|
|
59
|
-
PresignedUrl:
|
|
57
|
+
PresignedUrl: formatUrl(presignedRequest),
|
|
60
58
|
},
|
|
61
59
|
};
|
|
62
|
-
if (
|
|
60
|
+
if (HttpRequest.isInstance(args.request)) {
|
|
63
61
|
const { request } = args;
|
|
64
62
|
if (!(request.body ?? "").includes("DestinationRegion=")) {
|
|
65
63
|
request.body += `&DestinationRegion=${destinationRegion}`;
|
|
66
64
|
}
|
|
67
65
|
if (!(request.body ?? "").includes("PresignedUrl=")) {
|
|
68
|
-
request.body += `&PresignedUrl=${
|
|
66
|
+
request.body += `&PresignedUrl=${extendedEncodeURIComponent(args.input.PresignedUrl)}`;
|
|
69
67
|
}
|
|
70
68
|
}
|
|
71
69
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-sdk-ec2",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.35",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
6
6
|
"build:cjs": "node ../../scripts/compilation/inline",
|
|
7
|
-
"build:es": "tsc -p tsconfig.es.json",
|
|
7
|
+
"build:es": "premove dist-es && tsc -p tsconfig.es.json",
|
|
8
8
|
"build:include:deps": "yarn g:turbo run build -F=\"$npm_package_name\"",
|
|
9
|
-
"build:types": "tsc -p tsconfig.types.json",
|
|
9
|
+
"build:types": "premove dist-types && tsc -p tsconfig.types.json",
|
|
10
10
|
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
|
|
11
|
-
"clean": "premove dist-cjs dist-es dist-types
|
|
11
|
+
"clean": "premove dist-cjs dist-es dist-types",
|
|
12
12
|
"test": "yarn g:vitest run",
|
|
13
13
|
"test:watch": "yarn g:vitest watch",
|
|
14
14
|
"test:integration": "yarn g:vitest run -c vitest.config.integ.mts",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
},
|
|
27
27
|
"license": "Apache-2.0",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@aws-sdk/core": "^3.974.
|
|
30
|
-
"@aws-sdk/types": "^3.973.
|
|
29
|
+
"@aws-sdk/core": "^3.974.21",
|
|
30
|
+
"@aws-sdk/types": "^3.973.13",
|
|
31
31
|
"@smithy/core": "^3.24.6",
|
|
32
32
|
"@smithy/signature-v4": "^5.4.6",
|
|
33
33
|
"@smithy/types": "^4.14.3",
|