@aws-sdk/util-create-request 3.34.0 → 3.38.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 +35 -0
- package/dist-cjs/foo.fixture.js +29 -0
- package/dist-cjs/index.js +16 -0
- package/dist-es/foo.fixture.js +28 -0
- package/dist-es/index.js +25 -0
- package/dist-types/foo.fixture.d.ts +15 -0
- package/{dist/types → dist-types}/index.d.ts +0 -0
- package/dist-types/ts3.4/foo.fixture.d.ts +15 -0
- package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
- package/package.json +14 -11
- package/dist/cjs/index.js +0 -17
- package/dist/es/index.js +0 -29
- package/src/foo.fixture.ts +0 -48
- package/src/index.ts +0 -28
- package/tsconfig.cjs.json +0 -9
- package/tsconfig.es.json +0 -10
- package/tsconfig.types.json +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,41 @@
|
|
|
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.38.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.37.0...v3.38.0) (2021-10-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/util-create-request
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.37.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.36.1...v3.37.0) (2021-10-15)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @aws-sdk/util-create-request
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [3.36.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.35.0...v3.36.0) (2021-10-08)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* publish files in dist-* only ([#2873](https://github.com/aws/aws-sdk-js-v3/issues/2873)) ([53b4243](https://github.com/aws/aws-sdk-js-v3/commit/53b4243b066f25ff2412d5f0dea1036054b2df32))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# [3.35.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.34.0...v3.35.0) (2021-10-04)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @aws-sdk/util-create-request
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
6
41
|
# [3.34.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.33.0...v3.34.0) (2021-09-24)
|
|
7
42
|
|
|
8
43
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.httpRequest = exports.operationCommand = exports.fooClient = void 0;
|
|
4
|
+
const middleware_stack_1 = require("@aws-sdk/middleware-stack");
|
|
5
|
+
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
6
|
+
const output = { Data: "data", $metadata: {} };
|
|
7
|
+
const input = { String: "input" };
|
|
8
|
+
exports.fooClient = {
|
|
9
|
+
config: {},
|
|
10
|
+
middlewareStack: middleware_stack_1.constructStack(),
|
|
11
|
+
send: (command) => command.resolveMiddleware(exports.fooClient.middlewareStack, exports.fooClient.config, undefined)({ input }),
|
|
12
|
+
destroy: () => { },
|
|
13
|
+
};
|
|
14
|
+
exports.operationCommand = {
|
|
15
|
+
middlewareStack: middleware_stack_1.constructStack(),
|
|
16
|
+
input: {},
|
|
17
|
+
resolveMiddleware: (stack) => {
|
|
18
|
+
const concatStack = stack.concat(exports.operationCommand.middlewareStack);
|
|
19
|
+
return concatStack.resolve(() => Promise.resolve({ output, response: {} }), {});
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
exports.httpRequest = new protocol_http_1.HttpRequest({
|
|
23
|
+
protocol: "https:",
|
|
24
|
+
path: "/foo",
|
|
25
|
+
hostname: "foo-service.us-east-1.amazonaws.com",
|
|
26
|
+
headers: {},
|
|
27
|
+
method: "GET",
|
|
28
|
+
body: "",
|
|
29
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRequest = void 0;
|
|
4
|
+
async function createRequest(client, command) {
|
|
5
|
+
const interceptMiddleware = (next) => async (args) => {
|
|
6
|
+
return { output: { request: args.request }, response: undefined };
|
|
7
|
+
};
|
|
8
|
+
const clientStack = client.middlewareStack.clone();
|
|
9
|
+
clientStack.add(interceptMiddleware, {
|
|
10
|
+
step: "build",
|
|
11
|
+
priority: "low",
|
|
12
|
+
});
|
|
13
|
+
const handler = command.resolveMiddleware(clientStack, client.config, undefined);
|
|
14
|
+
return await handler(command).then((output) => output.output.request);
|
|
15
|
+
}
|
|
16
|
+
exports.createRequest = createRequest;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { constructStack } from "@aws-sdk/middleware-stack";
|
|
2
|
+
import { HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
|
+
var output = { Data: "data", $metadata: {} };
|
|
4
|
+
var input = { String: "input" };
|
|
5
|
+
export var fooClient = {
|
|
6
|
+
config: {},
|
|
7
|
+
middlewareStack: constructStack(),
|
|
8
|
+
send: function (command) {
|
|
9
|
+
return command.resolveMiddleware(fooClient.middlewareStack, fooClient.config, undefined)({ input: input });
|
|
10
|
+
},
|
|
11
|
+
destroy: function () { },
|
|
12
|
+
};
|
|
13
|
+
export var operationCommand = {
|
|
14
|
+
middlewareStack: constructStack(),
|
|
15
|
+
input: {},
|
|
16
|
+
resolveMiddleware: function (stack) {
|
|
17
|
+
var concatStack = stack.concat(operationCommand.middlewareStack);
|
|
18
|
+
return concatStack.resolve(function () { return Promise.resolve({ output: output, response: {} }); }, {});
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
export var httpRequest = new HttpRequest({
|
|
22
|
+
protocol: "https:",
|
|
23
|
+
path: "/foo",
|
|
24
|
+
hostname: "foo-service.us-east-1.amazonaws.com",
|
|
25
|
+
headers: {},
|
|
26
|
+
method: "GET",
|
|
27
|
+
body: "",
|
|
28
|
+
});
|
package/dist-es/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { __awaiter, __generator } from "tslib";
|
|
2
|
+
export function createRequest(client, command) {
|
|
3
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4
|
+
var interceptMiddleware, clientStack, handler;
|
|
5
|
+
var _this = this;
|
|
6
|
+
return __generator(this, function (_a) {
|
|
7
|
+
switch (_a.label) {
|
|
8
|
+
case 0:
|
|
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
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
|
+
import { Client, Command } from "@aws-sdk/smithy-client";
|
|
3
|
+
import { MetadataBearer } from "@aws-sdk/types";
|
|
4
|
+
export interface OperationInput {
|
|
5
|
+
String: string;
|
|
6
|
+
}
|
|
7
|
+
export declare type InputTypesUnion = OperationInput;
|
|
8
|
+
export interface OperationOutput extends MetadataBearer {
|
|
9
|
+
Data: string;
|
|
10
|
+
$metadata: {};
|
|
11
|
+
}
|
|
12
|
+
export declare type OutputTypesUnion = OperationOutput;
|
|
13
|
+
export declare const fooClient: Client<any, InputTypesUnion, OutputTypesUnion, any>;
|
|
14
|
+
export declare const operationCommand: Command<InputTypesUnion, OutputTypesUnion, any, OperationInput, MetadataBearer>;
|
|
15
|
+
export declare const httpRequest: HttpRequest;
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
|
+
import { Client, Command } from "@aws-sdk/smithy-client";
|
|
3
|
+
import { MetadataBearer } from "@aws-sdk/types";
|
|
4
|
+
export interface OperationInput {
|
|
5
|
+
String: string;
|
|
6
|
+
}
|
|
7
|
+
export declare type InputTypesUnion = OperationInput;
|
|
8
|
+
export interface OperationOutput extends MetadataBearer {
|
|
9
|
+
Data: string;
|
|
10
|
+
$metadata: {};
|
|
11
|
+
}
|
|
12
|
+
export declare type OutputTypesUnion = OperationOutput;
|
|
13
|
+
export declare const fooClient: Client<any, InputTypesUnion, OutputTypesUnion, any>;
|
|
14
|
+
export declare const operationCommand: Command<InputTypesUnion, OutputTypesUnion, any, OperationInput, MetadataBearer>;
|
|
15
|
+
export declare const httpRequest: HttpRequest;
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/util-create-request",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.38.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "yarn build:cjs && yarn build:es && yarn build:types",
|
|
6
6
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
7
7
|
"build:es": "tsc -p tsconfig.es.json",
|
|
8
8
|
"build:types": "tsc -p tsconfig.types.json",
|
|
9
|
-
"downlevel-dts": "downlevel-dts dist
|
|
9
|
+
"downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4",
|
|
10
10
|
"test": "jest"
|
|
11
11
|
},
|
|
12
|
-
"main": "./dist
|
|
13
|
-
"module": "./dist
|
|
14
|
-
"types": "./dist
|
|
12
|
+
"main": "./dist-cjs/index.js",
|
|
13
|
+
"module": "./dist-es/index.js",
|
|
14
|
+
"types": "./dist-types/index.d.ts",
|
|
15
15
|
"author": {
|
|
16
16
|
"name": "AWS SDK for JavaScript Team",
|
|
17
17
|
"url": "https://aws.amazon.com/javascript/"
|
|
18
18
|
},
|
|
19
19
|
"license": "Apache-2.0",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@aws-sdk/middleware-stack": "3.
|
|
22
|
-
"@aws-sdk/smithy-client": "3.
|
|
23
|
-
"@aws-sdk/types": "3.
|
|
21
|
+
"@aws-sdk/middleware-stack": "3.38.0",
|
|
22
|
+
"@aws-sdk/smithy-client": "3.38.0",
|
|
23
|
+
"@aws-sdk/types": "3.38.0",
|
|
24
24
|
"tslib": "^2.3.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@aws-sdk/protocol-http": "3.
|
|
27
|
+
"@aws-sdk/protocol-http": "3.38.0",
|
|
28
28
|
"@types/jest": "^26.0.4",
|
|
29
29
|
"@types/node": "^10.0.3",
|
|
30
30
|
"jest": "^26.1.0",
|
|
@@ -35,11 +35,14 @@
|
|
|
35
35
|
},
|
|
36
36
|
"typesVersions": {
|
|
37
37
|
"<4.0": {
|
|
38
|
-
"dist
|
|
39
|
-
"dist
|
|
38
|
+
"dist-types/*": [
|
|
39
|
+
"dist-types/ts3.4/*"
|
|
40
40
|
]
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist-*"
|
|
45
|
+
],
|
|
43
46
|
"homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-create-request",
|
|
44
47
|
"repository": {
|
|
45
48
|
"type": "git",
|
package/dist/cjs/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createRequest = void 0;
|
|
4
|
-
async function createRequest(client, command) {
|
|
5
|
-
const interceptMiddleware = (next) => async (args) => {
|
|
6
|
-
return { output: { request: args.request }, response: undefined };
|
|
7
|
-
};
|
|
8
|
-
const clientStack = client.middlewareStack.clone();
|
|
9
|
-
clientStack.add(interceptMiddleware, {
|
|
10
|
-
step: "build",
|
|
11
|
-
priority: "low",
|
|
12
|
-
});
|
|
13
|
-
const handler = command.resolveMiddleware(clientStack, client.config, undefined);
|
|
14
|
-
return await handler(command).then((output) => output.output.request);
|
|
15
|
-
}
|
|
16
|
-
exports.createRequest = createRequest;
|
|
17
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBR08sS0FBSyxVQUFVLGFBQWEsQ0FLakMsTUFBeUQsRUFDekQsT0FBNkU7SUFHN0UsTUFBTSxtQkFBbUIsR0FBMkMsQ0FBQyxJQUFJLEVBQUUsRUFBRSxDQUFDLEtBQUssRUFBRSxJQUFJLEVBQUUsRUFBRTtRQUMzRixPQUFPLEVBQUUsTUFBTSxFQUFFLEVBQUUsT0FBTyxFQUFFLElBQUksQ0FBQyxPQUFPLEVBQVMsRUFBRSxRQUFRLEVBQUUsU0FBUyxFQUFFLENBQUM7SUFDM0UsQ0FBQyxDQUFDO0lBQ0YsTUFBTSxXQUFXLEdBQUcsTUFBTSxDQUFDLGVBQWUsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUduRCxXQUFXLENBQUMsR0FBRyxDQUFDLG1CQUFtQixFQUFFO1FBQ25DLElBQUksRUFBRSxPQUFPO1FBQ2IsUUFBUSxFQUFFLEtBQUs7S0FDaEIsQ0FBQyxDQUFDO0lBRUgsTUFBTSxPQUFPLEdB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V3YXJlOiBCdWlsZE1pZGRsZXdhcmU8SW5wdXRUeXBlLCBPdXRwdXRUeXBlPiA9IChuZXh0KSA9PiBhc3luYyAoYXJncykgPT4ge1xuICAgIHJldHVybiB7IG91dHB1dDogeyByZXF1ZXN0OiBhcmdzLnJlcXVlc3QgfSBhcyBhbnksIHJlc3BvbnNlOiB1bmRlZmluZWQgfTtcbiAgfTtcbiAgY29uc3QgY2xpZW50U3RhY2sgPSBjbGllbnQubWlkZGxld2FyZVN0YWNrLmNsb25lKCk7XG5cbiAgLy8gQHRzLWlnbm9yZTogYWRkIG1pZGRsZXdhcmUgdG8gdGhlIGxhc3Qgb2YgJ2J1aWxkJyBzdGVwXG4gIGNsaWVudFN0YWNrLmFkZChpbnRlcmNlcHRNaWRkbGV3YXJlLCB7XG4gICAgc3RlcDogXCJidWlsZFwiLFxuICAgIHByaW9yaXR5OiBcImxvd1wiLFxuICB9KTtcblxuICBjb25zdCBoYW5kbGVyID0gY29tbWFuZC5yZXNvbHZlTWlkZGxld2FyZShjbGllbnRTdGFjaywgY2xpZW50LmNvbmZpZywgdW5kZWZpbmVkKTtcblxuICAvLyBAdHMtaWdub3JlXG4gIHJldHVybiBhd2FpdCBoYW5kbGVyKGNvbW1hbmQpLnRoZW4oKG91dHB1dCkgPT4gb3V0cHV0Lm91dHB1dC5yZXF1ZXN0KTtcbn1cbiJdfQ==
|
package/dist/es/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { __awaiter, __generator } from "tslib";
|
|
2
|
-
export function createRequest(client, command) {
|
|
3
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
4
|
-
var interceptMiddleware, clientStack, handler;
|
|
5
|
-
var _this = this;
|
|
6
|
-
return __generator(this, function (_a) {
|
|
7
|
-
switch (_a.label) {
|
|
8
|
-
case 0:
|
|
9
|
-
interceptMiddleware = function (next) { return function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
10
|
-
return __generator(this, function (_a) {
|
|
11
|
-
return [2 /*return*/, { output: { request: args.request }, response: undefined }];
|
|
12
|
-
});
|
|
13
|
-
}); }; };
|
|
14
|
-
clientStack = client.middlewareStack.clone();
|
|
15
|
-
// @ts-ignore: add middleware to the last of 'build' step
|
|
16
|
-
clientStack.add(interceptMiddleware, {
|
|
17
|
-
step: "build",
|
|
18
|
-
priority: "low",
|
|
19
|
-
});
|
|
20
|
-
handler = command.resolveMiddleware(clientStack, client.config, undefined);
|
|
21
|
-
return [4 /*yield*/, handler(command).then(function (output) { return output.output.request; })];
|
|
22
|
-
case 1:
|
|
23
|
-
// @ts-ignore
|
|
24
|
-
return [2 /*return*/, _a.sent()];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUdBLE1BQU0sVUFBZ0IsYUFBYSxDQUtqQyxNQUF5RCxFQUN6RCxPQUE2RTs7Ozs7OztvQkFHdkUsbUJBQW1CLEdBQTJDLFVBQUMsSUFBSSxJQUFLLE9BQUEsVUFBTyxJQUFJOzs0QkFDdkYsc0JBQU8sRUFBRSxNQUFNLEVBQUUsRUFBRSxPQUFPLEVBQUUsSUFBSSxDQUFDLE9BQU8sRUFBUyxFQUFFLFFBQVEsRUFBRSxTQUFTLEVBQUUsRUFBQzs7eUJBQzFFLEVBRjZFLENBRTdFLENBQUM7b0JBQ0ksV0FBVyxHQUFHLE1BQU0sQ0FBQyxlQUFlLENBQUMsS0FBSyxFQUFFLENBQUM7b0JBRW5ELHlEQUF5RDtvQkFDekQsV0FBVyxDQUFDLEdBQUcsQ0FBQyxtQkFBbUIsRUFBRTt3QkFDbkMsSUFBSSxFQUFFLE9BQU87d0JBQ2IsUUFBUSxFQUFFLEtB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bGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnNcbiAgY29uc3QgaW50ZXJjZXB0TWlkZGxld2FyZTogQnVpbGRNaWRkbGV3YXJlPElucHV0VHlwZSwgT3V0cHV0VHlwZT4gPSAobmV4dCkgPT4gYXN5bmMgKGFyZ3MpID0+IHtcbiAgICByZXR1cm4geyBvdXRwdXQ6IHsgcmVxdWVzdDogYXJncy5yZXF1ZXN0IH0gYXMgYW55LCByZXNwb25zZTogdW5kZWZpbmVkIH07XG4gIH07XG4gIGNvbnN0IGNsaWVudFN0YWNrID0gY2xpZW50Lm1pZGRsZXdhcmVTdGFjay5jbG9uZSgpO1xuXG4gIC8vIEB0cy1pZ25vcmU6IGFkZCBtaWRkbGV3YXJlIHRvIHRoZSBsYXN0IG9mICdidWlsZCcgc3RlcFxuICBjbGllbnRTdGFjay5hZGQoaW50ZXJjZXB0TWlkZGxld2FyZSwge1xuICAgIHN0ZXA6IFwiYnVpbGRcIixcbiAgICBwcmlvcml0eTogXCJsb3dcIixcbiAgfSk7XG5cbiAgY29uc3QgaGFuZGxlciA9IGNvbW1hbmQucmVzb2x2ZU1pZGRsZXdhcmUoY2xpZW50U3RhY2ssIGNsaWVudC5jb25maWcsIHVuZGVmaW5lZCk7XG5cbiAgLy8gQHRzLWlnbm9yZVxuICByZXR1cm4gYXdhaXQgaGFuZGxlcihjb21tYW5kKS50aGVuKChvdXRwdXQpID0+IG91dHB1dC5vdXRwdXQucmVxdWVzdCk7XG59XG4iXX0=
|
package/src/foo.fixture.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { constructStack } from "@aws-sdk/middleware-stack";
|
|
2
|
-
import { HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
|
-
import { Client, Command } from "@aws-sdk/smithy-client";
|
|
4
|
-
import { MetadataBearer, MiddlewareStack } from "@aws-sdk/types";
|
|
5
|
-
|
|
6
|
-
export interface OperationInput {
|
|
7
|
-
String: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type InputTypesUnion = OperationInput;
|
|
11
|
-
|
|
12
|
-
export interface OperationOutput extends MetadataBearer {
|
|
13
|
-
Data: string;
|
|
14
|
-
$metadata: {};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export type OutputTypesUnion = OperationOutput;
|
|
18
|
-
|
|
19
|
-
const output: OperationOutput = { Data: "data", $metadata: {} };
|
|
20
|
-
|
|
21
|
-
const input: OperationInput = { String: "input" };
|
|
22
|
-
|
|
23
|
-
export const fooClient: Client<any, InputTypesUnion, OutputTypesUnion, any> = {
|
|
24
|
-
config: {},
|
|
25
|
-
middlewareStack: constructStack<InputTypesUnion, OutputTypesUnion>(),
|
|
26
|
-
send: (command: Command<InputTypesUnion, OutputTypesUnion, any, OperationInput, OperationOutput>) =>
|
|
27
|
-
command.resolveMiddleware(fooClient.middlewareStack, fooClient.config, undefined)({ input }),
|
|
28
|
-
destroy: () => {},
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const operationCommand: Command<InputTypesUnion, OutputTypesUnion, any, OperationInput, MetadataBearer> = {
|
|
32
|
-
middlewareStack: constructStack<OperationInput, OutputTypesUnion>(),
|
|
33
|
-
input: {} as any,
|
|
34
|
-
// @ts-ignore
|
|
35
|
-
resolveMiddleware: (stack: MiddlewareStack<InputTypesUnion, OutputTypesUnion>) => {
|
|
36
|
-
const concatStack = stack.concat(operationCommand.middlewareStack);
|
|
37
|
-
return concatStack.resolve(() => Promise.resolve({ output, response: {} }), {} as any);
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const httpRequest = new HttpRequest({
|
|
42
|
-
protocol: "https:",
|
|
43
|
-
path: "/foo",
|
|
44
|
-
hostname: "foo-service.us-east-1.amazonaws.com",
|
|
45
|
-
headers: {},
|
|
46
|
-
method: "GET",
|
|
47
|
-
body: "",
|
|
48
|
-
});
|
package/src/index.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Client, Command } from "@aws-sdk/smithy-client";
|
|
2
|
-
import { BuildMiddleware, HttpRequest, MetadataBearer } from "@aws-sdk/types";
|
|
3
|
-
|
|
4
|
-
export async function createRequest<
|
|
5
|
-
InputTypesUnion extends object,
|
|
6
|
-
InputType extends InputTypesUnion,
|
|
7
|
-
OutputType extends MetadataBearer = MetadataBearer
|
|
8
|
-
>(
|
|
9
|
-
client: Client<any, InputTypesUnion, MetadataBearer, any>,
|
|
10
|
-
command: Command<InputType, OutputType, any, InputTypesUnion, MetadataBearer>
|
|
11
|
-
): Promise<HttpRequest> {
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
|
-
const interceptMiddleware: BuildMiddleware<InputType, OutputType> = (next) => async (args) => {
|
|
14
|
-
return { output: { request: args.request } as any, response: undefined };
|
|
15
|
-
};
|
|
16
|
-
const clientStack = client.middlewareStack.clone();
|
|
17
|
-
|
|
18
|
-
// @ts-ignore: add middleware to the last of 'build' step
|
|
19
|
-
clientStack.add(interceptMiddleware, {
|
|
20
|
-
step: "build",
|
|
21
|
-
priority: "low",
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const handler = command.resolveMiddleware(clientStack, client.config, undefined);
|
|
25
|
-
|
|
26
|
-
// @ts-ignore
|
|
27
|
-
return await handler(command).then((output) => output.output.request);
|
|
28
|
-
}
|
package/tsconfig.cjs.json
DELETED
package/tsconfig.es.json
DELETED