@aws-sdk/util-create-request 3.180.0 → 3.183.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 +8 -0
- package/dist-es/foo.fixture.js +10 -12
- package/dist-es/index.js +10 -23
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/util-create-request
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [3.180.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.179.0...v3.180.0) (2022-09-27)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @aws-sdk/util-create-request
|
package/dist-es/foo.fixture.js
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import { constructStack } from "@aws-sdk/middleware-stack";
|
|
2
2
|
import { HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
3
|
+
const output = { Data: "data", $metadata: {} };
|
|
4
|
+
const input = { String: "input" };
|
|
5
|
+
export const fooClient = {
|
|
6
6
|
config: {},
|
|
7
7
|
middlewareStack: constructStack(),
|
|
8
|
-
send:
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
destroy: function () { },
|
|
8
|
+
send: (command) => command.resolveMiddleware(fooClient.middlewareStack, fooClient.config, undefined)({ input }),
|
|
9
|
+
destroy: () => { },
|
|
12
10
|
};
|
|
13
|
-
export
|
|
11
|
+
export const operationCommand = {
|
|
14
12
|
middlewareStack: constructStack(),
|
|
15
13
|
input: {},
|
|
16
|
-
resolveMiddleware:
|
|
17
|
-
|
|
18
|
-
return concatStack.resolve(
|
|
14
|
+
resolveMiddleware: (stack) => {
|
|
15
|
+
const concatStack = stack.concat(operationCommand.middlewareStack);
|
|
16
|
+
return concatStack.resolve(() => Promise.resolve({ output, response: {} }), {});
|
|
19
17
|
},
|
|
20
18
|
};
|
|
21
|
-
export
|
|
19
|
+
export const httpRequest = new HttpRequest({
|
|
22
20
|
protocol: "https:",
|
|
23
21
|
path: "/foo",
|
|
24
22
|
hostname: "foo-service.us-east-1.amazonaws.com",
|
package/dist-es/index.js
CHANGED
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
interceptMiddleware = function (next) { return function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
10
|
-
return __generator(this, function (_a) {
|
|
11
|
-
return [2, { output: { request: args.request }, response: undefined }];
|
|
12
|
-
});
|
|
13
|
-
}); }; };
|
|
14
|
-
clientStack = client.middlewareStack.clone();
|
|
15
|
-
clientStack.add(interceptMiddleware, {
|
|
16
|
-
step: "build",
|
|
17
|
-
priority: "low",
|
|
18
|
-
});
|
|
19
|
-
handler = command.resolveMiddleware(clientStack, client.config, undefined);
|
|
20
|
-
return [4, handler(command).then(function (output) { return output.output.request; })];
|
|
21
|
-
case 1: return [2, _a.sent()];
|
|
22
|
-
}
|
|
23
|
-
});
|
|
1
|
+
export async function createRequest(client, command) {
|
|
2
|
+
const interceptMiddleware = (next) => async (args) => {
|
|
3
|
+
return { output: { request: args.request }, response: undefined };
|
|
4
|
+
};
|
|
5
|
+
const clientStack = client.middlewareStack.clone();
|
|
6
|
+
clientStack.add(interceptMiddleware, {
|
|
7
|
+
step: "build",
|
|
8
|
+
priority: "low",
|
|
24
9
|
});
|
|
10
|
+
const handler = command.resolveMiddleware(clientStack, client.config, undefined);
|
|
11
|
+
return await handler(command).then((output) => output.output.request);
|
|
25
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/util-create-request",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.183.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,13 +20,13 @@
|
|
|
20
20
|
},
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@aws-sdk/middleware-stack": "3.
|
|
24
|
-
"@aws-sdk/smithy-client": "3.
|
|
25
|
-
"@aws-sdk/types": "3.
|
|
23
|
+
"@aws-sdk/middleware-stack": "3.183.0",
|
|
24
|
+
"@aws-sdk/smithy-client": "3.183.0",
|
|
25
|
+
"@aws-sdk/types": "3.183.0",
|
|
26
26
|
"tslib": "^2.3.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@aws-sdk/protocol-http": "3.
|
|
29
|
+
"@aws-sdk/protocol-http": "3.183.0",
|
|
30
30
|
"@tsconfig/recommended": "1.0.1",
|
|
31
31
|
"@types/node": "^10.0.3",
|
|
32
32
|
"concurrently": "7.0.0",
|