@cdklabs/cdk-ecs-codedeploy 0.0.317 → 0.0.318
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/.jsii +2 -2
- package/lib/api-canary/index.js +1 -1
- package/lib/ecs-appspec/index.js +1 -1
- package/lib/ecs-deployment/index.js +1 -1
- package/lib/ecs-patterns/application-load-balanced-codedeployed-fargate-service.js +1 -1
- package/node_modules/@smithy/abort-controller/package.json +2 -2
- package/node_modules/@smithy/config-resolver/package.json +4 -4
- package/node_modules/@smithy/core/package.json +8 -8
- package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
- package/node_modules/@smithy/fetch-http-handler/package.json +5 -5
- package/node_modules/@smithy/hash-node/package.json +2 -2
- package/node_modules/@smithy/invalid-dependency/package.json +2 -2
- package/node_modules/@smithy/middleware-content-length/package.json +4 -4
- package/node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js +1 -1
- package/node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +16 -2
- package/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromConfig.js +1 -1
- package/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js +7 -1
- package/node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointConfig.js +10 -1
- package/node_modules/@smithy/middleware-endpoint/dist-types/adaptors/getEndpointFromConfig.d.ts +4 -1
- package/node_modules/@smithy/middleware-endpoint/dist-types/resolveEndpointConfig.d.ts +11 -0
- package/node_modules/@smithy/middleware-endpoint/dist-types/ts3.4/adaptors/getEndpointFromConfig.d.ts +4 -1
- package/node_modules/@smithy/middleware-endpoint/dist-types/ts3.4/resolveEndpointConfig.d.ts +11 -0
- package/node_modules/@smithy/middleware-endpoint/package.json +7 -7
- package/node_modules/@smithy/middleware-retry/package.json +9 -9
- package/node_modules/@smithy/middleware-serde/package.json +3 -3
- package/node_modules/@smithy/middleware-stack/package.json +2 -2
- package/node_modules/@smithy/node-config-provider/package.json +4 -4
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +86 -46
- package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +10 -10
- package/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +27 -13
- package/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +18 -5
- package/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +12 -4
- package/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +6 -1
- package/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +6 -1
- package/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +6 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +2 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +2 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +2 -1
- package/node_modules/@smithy/node-http-handler/package.json +5 -5
- package/node_modules/@smithy/property-provider/package.json +2 -2
- package/node_modules/@smithy/protocol-http/package.json +2 -2
- package/node_modules/@smithy/querystring-builder/package.json +2 -2
- package/node_modules/@smithy/querystring-parser/package.json +2 -2
- package/node_modules/@smithy/service-error-classification/package.json +2 -2
- package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
- package/node_modules/@smithy/signature-v4/package.json +4 -4
- package/node_modules/@smithy/smithy-client/dist-cjs/index.js +21 -4
- package/node_modules/@smithy/smithy-client/dist-es/client.js +22 -4
- package/node_modules/@smithy/smithy-client/dist-types/client.d.ts +22 -1
- package/node_modules/@smithy/smithy-client/dist-types/ts3.4/client.d.ts +22 -1
- package/node_modules/@smithy/smithy-client/package.json +6 -6
- package/node_modules/@smithy/types/README.md +36 -1
- package/node_modules/@smithy/types/dist-types/command.d.ts +14 -1
- package/node_modules/@smithy/types/dist-types/endpoint.d.ts +1 -1
- package/node_modules/@smithy/types/dist-types/transform/client-method-transforms.d.ts +6 -6
- package/node_modules/@smithy/types/dist-types/transform/client-payload-blob-type-narrow.d.ts +12 -6
- package/node_modules/@smithy/types/dist-types/transform/no-undefined.d.ts +8 -3
- package/node_modules/@smithy/types/dist-types/ts3.4/command.d.ts +14 -1
- package/node_modules/@smithy/types/dist-types/ts3.4/endpoint.d.ts +1 -1
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/client-method-transforms.d.ts +6 -6
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/client-payload-blob-type-narrow.d.ts +8 -10
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/no-undefined.d.ts +6 -9
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/@smithy/url-parser/package.json +3 -3
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
- package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
- package/node_modules/@smithy/util-endpoints/dist-cjs/cache/EndpointCache.js +1 -0
- package/node_modules/@smithy/util-endpoints/dist-cjs/index.js +73 -11
- package/node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js +49 -0
- package/node_modules/@smithy/util-endpoints/dist-es/index.js +1 -0
- package/node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js +0 -10
- package/node_modules/@smithy/util-endpoints/dist-types/cache/EndpointCache.d.ts +34 -0
- package/node_modules/@smithy/util-endpoints/dist-types/index.d.ts +1 -0
- package/node_modules/@smithy/util-endpoints/dist-types/ts3.4/cache/EndpointCache.d.ts +34 -0
- package/node_modules/@smithy/util-endpoints/dist-types/ts3.4/index.d.ts +1 -0
- package/node_modules/@smithy/util-endpoints/package.json +3 -3
- package/node_modules/@smithy/util-middleware/package.json +2 -2
- package/node_modules/@smithy/util-retry/package.json +3 -3
- package/node_modules/@smithy/util-stream/package.json +5 -5
- package/node_modules/@smithy/util-waiter/package.json +3 -3
- package/package.json +3 -3
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
import { constructStack } from "@smithy/middleware-stack";
|
|
2
2
|
export class Client {
|
|
3
3
|
constructor(config) {
|
|
4
|
-
this.middlewareStack = constructStack();
|
|
5
4
|
this.config = config;
|
|
5
|
+
this.middlewareStack = constructStack();
|
|
6
6
|
}
|
|
7
7
|
send(command, optionsOrCb, cb) {
|
|
8
8
|
const options = typeof optionsOrCb !== "function" ? optionsOrCb : undefined;
|
|
9
9
|
const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb;
|
|
10
|
-
const
|
|
10
|
+
const useHandlerCache = options === undefined && this.config.cacheMiddleware === true;
|
|
11
|
+
let handler;
|
|
12
|
+
if (useHandlerCache) {
|
|
13
|
+
if (!this.handlers) {
|
|
14
|
+
this.handlers = new WeakMap();
|
|
15
|
+
}
|
|
16
|
+
const handlers = this.handlers;
|
|
17
|
+
if (handlers.has(command.constructor)) {
|
|
18
|
+
handler = handlers.get(command.constructor);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
handler = command.resolveMiddleware(this.middlewareStack, this.config, options);
|
|
22
|
+
handlers.set(command.constructor, handler);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
delete this.handlers;
|
|
27
|
+
handler = command.resolveMiddleware(this.middlewareStack, this.config, options);
|
|
28
|
+
}
|
|
11
29
|
if (callback) {
|
|
12
30
|
handler(command)
|
|
13
31
|
.then((result) => callback(null, result.output), (err) => callback(err))
|
|
@@ -18,7 +36,7 @@ export class Client {
|
|
|
18
36
|
}
|
|
19
37
|
}
|
|
20
38
|
destroy() {
|
|
21
|
-
|
|
22
|
-
|
|
39
|
+
this.config?.requestHandler?.destroy?.();
|
|
40
|
+
delete this.handlers;
|
|
23
41
|
}
|
|
24
42
|
}
|
|
@@ -10,6 +10,22 @@ export interface SmithyConfiguration<HandlerOptions> {
|
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
12
|
readonly apiVersion: string;
|
|
13
|
+
/**
|
|
14
|
+
* @public
|
|
15
|
+
*
|
|
16
|
+
* Default false.
|
|
17
|
+
*
|
|
18
|
+
* When true, the client will only resolve the middleware stack once per
|
|
19
|
+
* Command class. This means modifying the middlewareStack of the
|
|
20
|
+
* command or client after requests have been made will not be
|
|
21
|
+
* recognized.
|
|
22
|
+
*
|
|
23
|
+
* Calling client.destroy() also clears this cache.
|
|
24
|
+
*
|
|
25
|
+
* Enable this only if needing the additional time saved (0-1ms per request)
|
|
26
|
+
* and not needing middleware modifications between requests.
|
|
27
|
+
*/
|
|
28
|
+
cacheMiddleware?: boolean;
|
|
13
29
|
}
|
|
14
30
|
/**
|
|
15
31
|
* @internal
|
|
@@ -17,13 +33,18 @@ export interface SmithyConfiguration<HandlerOptions> {
|
|
|
17
33
|
export type SmithyResolvedConfiguration<HandlerOptions> = {
|
|
18
34
|
requestHandler: RequestHandler<any, any, HandlerOptions>;
|
|
19
35
|
readonly apiVersion: string;
|
|
36
|
+
cacheMiddleware?: boolean;
|
|
20
37
|
};
|
|
21
38
|
/**
|
|
22
39
|
* @public
|
|
23
40
|
*/
|
|
24
41
|
export declare class Client<HandlerOptions, ClientInput extends object, ClientOutput extends MetadataBearer, ResolvedClientConfiguration extends SmithyResolvedConfiguration<HandlerOptions>> implements IClient<ClientInput, ClientOutput, ResolvedClientConfiguration> {
|
|
25
|
-
middlewareStack: MiddlewareStack<ClientInput, ClientOutput>;
|
|
26
42
|
readonly config: ResolvedClientConfiguration;
|
|
43
|
+
middlewareStack: MiddlewareStack<ClientInput, ClientOutput>;
|
|
44
|
+
/**
|
|
45
|
+
* May be used to cache the resolved handler function for a Command class.
|
|
46
|
+
*/
|
|
47
|
+
private handlers?;
|
|
27
48
|
constructor(config: ResolvedClientConfiguration);
|
|
28
49
|
send<InputType extends ClientInput, OutputType extends ClientOutput>(command: Command<ClientInput, InputType, ClientOutput, OutputType, SmithyResolvedConfiguration<HandlerOptions>>, options?: HandlerOptions): Promise<OutputType>;
|
|
29
50
|
send<InputType extends ClientInput, OutputType extends ClientOutput>(command: Command<ClientInput, InputType, ClientOutput, OutputType, SmithyResolvedConfiguration<HandlerOptions>>, cb: (err: any, data?: OutputType) => void): void;
|
|
@@ -10,6 +10,22 @@ export interface SmithyConfiguration<HandlerOptions> {
|
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
12
|
readonly apiVersion: string;
|
|
13
|
+
/**
|
|
14
|
+
* @public
|
|
15
|
+
*
|
|
16
|
+
* Default false.
|
|
17
|
+
*
|
|
18
|
+
* When true, the client will only resolve the middleware stack once per
|
|
19
|
+
* Command class. This means modifying the middlewareStack of the
|
|
20
|
+
* command or client after requests have been made will not be
|
|
21
|
+
* recognized.
|
|
22
|
+
*
|
|
23
|
+
* Calling client.destroy() also clears this cache.
|
|
24
|
+
*
|
|
25
|
+
* Enable this only if needing the additional time saved (0-1ms per request)
|
|
26
|
+
* and not needing middleware modifications between requests.
|
|
27
|
+
*/
|
|
28
|
+
cacheMiddleware?: boolean;
|
|
13
29
|
}
|
|
14
30
|
/**
|
|
15
31
|
* @internal
|
|
@@ -17,13 +33,18 @@ export interface SmithyConfiguration<HandlerOptions> {
|
|
|
17
33
|
export type SmithyResolvedConfiguration<HandlerOptions> = {
|
|
18
34
|
requestHandler: RequestHandler<any, any, HandlerOptions>;
|
|
19
35
|
readonly apiVersion: string;
|
|
36
|
+
cacheMiddleware?: boolean;
|
|
20
37
|
};
|
|
21
38
|
/**
|
|
22
39
|
* @public
|
|
23
40
|
*/
|
|
24
41
|
export declare class Client<HandlerOptions, ClientInput extends object, ClientOutput extends MetadataBearer, ResolvedClientConfiguration extends SmithyResolvedConfiguration<HandlerOptions>> implements IClient<ClientInput, ClientOutput, ResolvedClientConfiguration> {
|
|
25
|
-
middlewareStack: MiddlewareStack<ClientInput, ClientOutput>;
|
|
26
42
|
readonly config: ResolvedClientConfiguration;
|
|
43
|
+
middlewareStack: MiddlewareStack<ClientInput, ClientOutput>;
|
|
44
|
+
/**
|
|
45
|
+
* May be used to cache the resolved handler function for a Command class.
|
|
46
|
+
*/
|
|
47
|
+
private handlers?;
|
|
27
48
|
constructor(config: ResolvedClientConfiguration);
|
|
28
49
|
send<InputType extends ClientInput, OutputType extends ClientOutput>(command: Command<ClientInput, InputType, ClientOutput, OutputType, SmithyResolvedConfiguration<HandlerOptions>>, options?: HandlerOptions): Promise<OutputType>;
|
|
29
50
|
send<InputType extends ClientInput, OutputType extends ClientOutput>(command: Command<ClientInput, InputType, ClientOutput, OutputType, SmithyResolvedConfiguration<HandlerOptions>>, cb: (err: any, data?: OutputType) => void): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/smithy-client",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
|
6
6
|
"build:cjs": "node ../../scripts/inline smithy-client",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@smithy/middleware-endpoint": "^3.1.
|
|
27
|
-
"@smithy/middleware-stack": "^3.0.
|
|
28
|
-
"@smithy/protocol-http": "^4.1.
|
|
29
|
-
"@smithy/types": "^3.
|
|
30
|
-
"@smithy/util-stream": "^3.1.
|
|
26
|
+
"@smithy/middleware-endpoint": "^3.1.1",
|
|
27
|
+
"@smithy/middleware-stack": "^3.0.4",
|
|
28
|
+
"@smithy/protocol-http": "^4.1.1",
|
|
29
|
+
"@smithy/types": "^3.4.0",
|
|
30
|
+
"@smithy/util-stream": "^3.1.4",
|
|
31
31
|
"tslib": "^2.6.2"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
@@ -34,7 +34,8 @@ const s3b = new S3({}) as UncheckedClient<S3>;
|
|
|
34
34
|
// and required outputs are not undefined.
|
|
35
35
|
const get = await s3a.getObject({
|
|
36
36
|
Bucket: "",
|
|
37
|
-
|
|
37
|
+
// @ts-expect-error (undefined not assignable to string)
|
|
38
|
+
Key: undefined,
|
|
38
39
|
});
|
|
39
40
|
|
|
40
41
|
// UncheckedClient makes output fields non-nullable.
|
|
@@ -49,6 +50,40 @@ const body = await (
|
|
|
49
50
|
).Body.transformToString();
|
|
50
51
|
```
|
|
51
52
|
|
|
53
|
+
When using the transform on non-aggregated client with the `Command` syntax,
|
|
54
|
+
the input cannot be validated because it goes through another class.
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { S3Client, ListBucketsCommand, GetObjectCommand, GetObjectCommandInput } from "@aws-sdk/client-s3";
|
|
58
|
+
import type { AssertiveClient, UncheckedClient, NoUndefined } from "@smithy/types";
|
|
59
|
+
|
|
60
|
+
const s3 = new S3Client({}) as UncheckedClient<S3Client>;
|
|
61
|
+
|
|
62
|
+
const list = await s3.send(
|
|
63
|
+
new ListBucketsCommand({
|
|
64
|
+
// command inputs are not validated by the type transform.
|
|
65
|
+
// because this is a separate class.
|
|
66
|
+
})
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Although less ergonomic, you can use the NoUndefined<T>
|
|
71
|
+
* transform on the input type.
|
|
72
|
+
*/
|
|
73
|
+
const getObjectInput: NoUndefined<GetObjectCommandInput> = {
|
|
74
|
+
Bucket: "undefined",
|
|
75
|
+
// @ts-expect-error (undefined not assignable to string)
|
|
76
|
+
Key: undefined,
|
|
77
|
+
// optional params can still be undefined.
|
|
78
|
+
SSECustomerAlgorithm: undefined,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const get = s3.send(new GetObjectCommand(getObjectInput));
|
|
82
|
+
|
|
83
|
+
// outputs are still transformed.
|
|
84
|
+
await get.Body.TransformToString();
|
|
85
|
+
```
|
|
86
|
+
|
|
52
87
|
### Scenario: Narrowing a smithy-typescript generated client's output payload blob types
|
|
53
88
|
|
|
54
89
|
This is mostly relevant to operations with streaming bodies such as within
|
|
@@ -3,8 +3,21 @@ import { MetadataBearer } from "./response";
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
|
-
export interface Command<ClientInput extends object, InputType extends ClientInput, ClientOutput extends MetadataBearer, OutputType extends ClientOutput, ResolvedConfiguration> {
|
|
6
|
+
export interface Command<ClientInput extends object, InputType extends ClientInput, ClientOutput extends MetadataBearer, OutputType extends ClientOutput, ResolvedConfiguration> extends CommandIO<InputType, OutputType> {
|
|
7
7
|
readonly input: InputType;
|
|
8
8
|
readonly middlewareStack: MiddlewareStack<InputType, OutputType>;
|
|
9
9
|
resolveMiddleware(stack: MiddlewareStack<ClientInput, ClientOutput>, configuration: ResolvedConfiguration, options: any): Handler<InputType, OutputType>;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*
|
|
14
|
+
* This is a subset of the Command type used only to detect the i/o types.
|
|
15
|
+
*/
|
|
16
|
+
export interface CommandIO<InputType extends object, OutputType extends MetadataBearer> {
|
|
17
|
+
readonly input: InputType;
|
|
18
|
+
resolveMiddleware(stack: any, configuration: any, options: any): Handler<InputType, OutputType>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export type GetOutputType<Command> = Command extends CommandIO<any, infer O> ? O : never;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CommandIO } from "../command";
|
|
2
2
|
import type { MetadataBearer } from "../response";
|
|
3
3
|
import type { StreamingBlobPayloadOutputTypes } from "../streaming-payload/streaming-blob-payload-output-types";
|
|
4
4
|
import type { Transform } from "./type-transform";
|
|
@@ -7,11 +7,11 @@ import type { Transform } from "./type-transform";
|
|
|
7
7
|
*
|
|
8
8
|
* Narrowed version of InvokeFunction used in Client::send.
|
|
9
9
|
*/
|
|
10
|
-
export interface NarrowedInvokeFunction<NarrowType, HttpHandlerOptions, InputTypes extends object, OutputTypes extends MetadataBearer
|
|
11
|
-
<InputType extends InputTypes, OutputType extends OutputTypes>(command:
|
|
12
|
-
<InputType extends InputTypes, OutputType extends OutputTypes>(command:
|
|
13
|
-
<InputType extends InputTypes, OutputType extends OutputTypes>(command:
|
|
14
|
-
<InputType extends InputTypes, OutputType extends OutputTypes>(command:
|
|
10
|
+
export interface NarrowedInvokeFunction<NarrowType, HttpHandlerOptions, InputTypes extends object, OutputTypes extends MetadataBearer> {
|
|
11
|
+
<InputType extends InputTypes, OutputType extends OutputTypes>(command: CommandIO<InputType, OutputType>, options?: HttpHandlerOptions): Promise<Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>>;
|
|
12
|
+
<InputType extends InputTypes, OutputType extends OutputTypes>(command: CommandIO<InputType, OutputType>, cb: (err: unknown, data?: Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>) => void): void;
|
|
13
|
+
<InputType extends InputTypes, OutputType extends OutputTypes>(command: CommandIO<InputType, OutputType>, options: HttpHandlerOptions, cb: (err: unknown, data?: Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>) => void): void;
|
|
14
|
+
<InputType extends InputTypes, OutputType extends OutputTypes>(command: CommandIO<InputType, OutputType>, options?: HttpHandlerOptions, cb?: (err: unknown, data?: Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>) => void): Promise<Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>> | void;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* @internal
|
package/node_modules/@smithy/types/dist-types/transform/client-payload-blob-type-narrow.d.ts
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import type { IncomingMessage } from "http";
|
|
4
4
|
import type { ClientHttp2Stream } from "http2";
|
|
5
|
-
import type {
|
|
5
|
+
import type { InvokeMethod } from "../client";
|
|
6
|
+
import type { GetOutputType } from "../command";
|
|
6
7
|
import type { HttpHandlerOptions } from "../http";
|
|
7
8
|
import type { SdkStream } from "../serde";
|
|
8
9
|
import type { BrowserRuntimeStreamingBlobPayloadInputTypes, NodeJsRuntimeStreamingBlobPayloadInputTypes, StreamingBlobPayloadInputTypes } from "../streaming-payload/streaming-blob-payload-input-types";
|
|
9
|
-
import type {
|
|
10
|
+
import type { StreamingBlobPayloadOutputTypes } from "../streaming-payload/streaming-blob-payload-output-types";
|
|
11
|
+
import type { NarrowedInvokeMethod } from "./client-method-transforms";
|
|
10
12
|
import type { Transform } from "./type-transform";
|
|
11
13
|
/**
|
|
12
14
|
* @public
|
|
@@ -58,8 +60,10 @@ export type BrowserXhrClient<ClientType extends object> = NarrowPayloadBlobTypes
|
|
|
58
60
|
*/
|
|
59
61
|
export type NarrowPayloadBlobOutputType<T, ClientType extends object> = {
|
|
60
62
|
[key in keyof ClientType]: [ClientType[key]] extends [
|
|
61
|
-
|
|
62
|
-
] ?
|
|
63
|
+
InvokeMethod<infer FunctionInputTypes, infer FunctionOutputTypes>
|
|
64
|
+
] ? NarrowedInvokeMethod<T, HttpHandlerOptions, FunctionInputTypes, FunctionOutputTypes> : ClientType[key];
|
|
65
|
+
} & {
|
|
66
|
+
send<Command>(command: Command, options?: any): Promise<Transform<GetOutputType<Command>, StreamingBlobPayloadOutputTypes | undefined, T>>;
|
|
63
67
|
};
|
|
64
68
|
/**
|
|
65
69
|
* @public
|
|
@@ -68,6 +72,8 @@ export type NarrowPayloadBlobOutputType<T, ClientType extends object> = {
|
|
|
68
72
|
*/
|
|
69
73
|
export type NarrowPayloadBlobTypes<I, O, ClientType extends object> = {
|
|
70
74
|
[key in keyof ClientType]: [ClientType[key]] extends [
|
|
71
|
-
|
|
72
|
-
] ?
|
|
75
|
+
InvokeMethod<infer FunctionInputTypes, infer FunctionOutputTypes>
|
|
76
|
+
] ? NarrowedInvokeMethod<O, HttpHandlerOptions, Transform<FunctionInputTypes, StreamingBlobPayloadInputTypes | undefined, I>, FunctionOutputTypes> : ClientType[key];
|
|
77
|
+
} & {
|
|
78
|
+
send<Command>(command: Command, options?: any): Promise<Transform<GetOutputType<Command>, StreamingBlobPayloadOutputTypes | undefined, O>>;
|
|
73
79
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InvokeMethod, InvokeMethodOptionalArgs } from "../client";
|
|
2
|
+
import type { GetOutputType } from "../command";
|
|
2
3
|
/**
|
|
3
4
|
* @public
|
|
4
5
|
*
|
|
@@ -47,7 +48,9 @@ export type RecursiveRequired<T> = T extends Function ? T : [T] extends [object]
|
|
|
47
48
|
type NarrowClientIOTypes<ClientType extends object> = {
|
|
48
49
|
[key in keyof ClientType]: [ClientType[key]] extends [
|
|
49
50
|
InvokeMethodOptionalArgs<infer FunctionInputTypes, infer FunctionOutputTypes>
|
|
50
|
-
] ? InvokeMethodOptionalArgs<NoUndefined<FunctionInputTypes>, NoUndefined<FunctionOutputTypes>> : [ClientType[key]] extends [
|
|
51
|
+
] ? InvokeMethodOptionalArgs<NoUndefined<FunctionInputTypes>, NoUndefined<FunctionOutputTypes>> : [ClientType[key]] extends [InvokeMethod<infer FunctionInputTypes, infer FunctionOutputTypes>] ? InvokeMethod<NoUndefined<FunctionInputTypes>, NoUndefined<FunctionOutputTypes>> : ClientType[key];
|
|
52
|
+
} & {
|
|
53
|
+
send<Command>(command: Command, options?: any): Promise<NoUndefined<GetOutputType<Command>>>;
|
|
51
54
|
};
|
|
52
55
|
/**
|
|
53
56
|
* @internal
|
|
@@ -57,6 +60,8 @@ type NarrowClientIOTypes<ClientType extends object> = {
|
|
|
57
60
|
type UncheckedClientOutputTypes<ClientType extends object> = {
|
|
58
61
|
[key in keyof ClientType]: [ClientType[key]] extends [
|
|
59
62
|
InvokeMethodOptionalArgs<infer FunctionInputTypes, infer FunctionOutputTypes>
|
|
60
|
-
] ? InvokeMethodOptionalArgs<NoUndefined<FunctionInputTypes>, RecursiveRequired<FunctionOutputTypes>> : [ClientType[key]] extends [
|
|
63
|
+
] ? InvokeMethodOptionalArgs<NoUndefined<FunctionInputTypes>, RecursiveRequired<FunctionOutputTypes>> : [ClientType[key]] extends [InvokeMethod<infer FunctionInputTypes, infer FunctionOutputTypes>] ? InvokeMethod<NoUndefined<FunctionInputTypes>, RecursiveRequired<FunctionOutputTypes>> : ClientType[key];
|
|
64
|
+
} & {
|
|
65
|
+
send<Command>(command: Command, options?: any): Promise<RecursiveRequired<NoUndefined<GetOutputType<Command>>>>;
|
|
61
66
|
};
|
|
62
67
|
export {};
|
|
@@ -3,8 +3,21 @@ import { MetadataBearer } from "./response";
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
|
-
export interface Command<ClientInput extends object, InputType extends ClientInput, ClientOutput extends MetadataBearer, OutputType extends ClientOutput, ResolvedConfiguration> {
|
|
6
|
+
export interface Command<ClientInput extends object, InputType extends ClientInput, ClientOutput extends MetadataBearer, OutputType extends ClientOutput, ResolvedConfiguration> extends CommandIO<InputType, OutputType> {
|
|
7
7
|
readonly input: InputType;
|
|
8
8
|
readonly middlewareStack: MiddlewareStack<InputType, OutputType>;
|
|
9
9
|
resolveMiddleware(stack: MiddlewareStack<ClientInput, ClientOutput>, configuration: ResolvedConfiguration, options: any): Handler<InputType, OutputType>;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*
|
|
14
|
+
* This is a subset of the Command type used only to detect the i/o types.
|
|
15
|
+
*/
|
|
16
|
+
export interface CommandIO<InputType extends object, OutputType extends MetadataBearer> {
|
|
17
|
+
readonly input: InputType;
|
|
18
|
+
resolveMiddleware(stack: any, configuration: any, options: any): Handler<InputType, OutputType>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export type GetOutputType<Command> = Command extends CommandIO<any, infer O> ? O : never;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommandIO } from "../command";
|
|
2
2
|
import { MetadataBearer } from "../response";
|
|
3
3
|
import { StreamingBlobPayloadOutputTypes } from "../streaming-payload/streaming-blob-payload-output-types";
|
|
4
4
|
import { Transform } from "./type-transform";
|
|
@@ -7,11 +7,11 @@ import { Transform } from "./type-transform";
|
|
|
7
7
|
*
|
|
8
8
|
* Narrowed version of InvokeFunction used in Client::send.
|
|
9
9
|
*/
|
|
10
|
-
export interface NarrowedInvokeFunction<NarrowType, HttpHandlerOptions, InputTypes extends object, OutputTypes extends MetadataBearer
|
|
11
|
-
<InputType extends InputTypes, OutputType extends OutputTypes>(command:
|
|
12
|
-
<InputType extends InputTypes, OutputType extends OutputTypes>(command:
|
|
13
|
-
<InputType extends InputTypes, OutputType extends OutputTypes>(command:
|
|
14
|
-
<InputType extends InputTypes, OutputType extends OutputTypes>(command:
|
|
10
|
+
export interface NarrowedInvokeFunction<NarrowType, HttpHandlerOptions, InputTypes extends object, OutputTypes extends MetadataBearer> {
|
|
11
|
+
<InputType extends InputTypes, OutputType extends OutputTypes>(command: CommandIO<InputType, OutputType>, options?: HttpHandlerOptions): Promise<Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>>;
|
|
12
|
+
<InputType extends InputTypes, OutputType extends OutputTypes>(command: CommandIO<InputType, OutputType>, cb: (err: unknown, data?: Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>) => void): void;
|
|
13
|
+
<InputType extends InputTypes, OutputType extends OutputTypes>(command: CommandIO<InputType, OutputType>, options: HttpHandlerOptions, cb: (err: unknown, data?: Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>) => void): void;
|
|
14
|
+
<InputType extends InputTypes, OutputType extends OutputTypes>(command: CommandIO<InputType, OutputType>, options?: HttpHandlerOptions, cb?: (err: unknown, data?: Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>) => void): Promise<Transform<OutputType, StreamingBlobPayloadOutputTypes | undefined, NarrowType>> | void;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* @internal
|
package/node_modules/@smithy/types/dist-types/ts3.4/transform/client-payload-blob-type-narrow.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { IncomingMessage } from "http";
|
|
3
3
|
import { ClientHttp2Stream } from "http2";
|
|
4
|
-
import {
|
|
4
|
+
import { InvokeMethod } from "../client";
|
|
5
|
+
import { GetOutputType } from "../command";
|
|
5
6
|
import { HttpHandlerOptions } from "../http";
|
|
6
7
|
import { SdkStream } from "../serde";
|
|
7
8
|
import { BrowserRuntimeStreamingBlobPayloadInputTypes, NodeJsRuntimeStreamingBlobPayloadInputTypes, StreamingBlobPayloadInputTypes } from "../streaming-payload/streaming-blob-payload-input-types";
|
|
8
|
-
import {
|
|
9
|
+
import { StreamingBlobPayloadOutputTypes } from "../streaming-payload/streaming-blob-payload-output-types";
|
|
10
|
+
import { NarrowedInvokeMethod } from "./client-method-transforms";
|
|
9
11
|
import { Transform } from "./type-transform";
|
|
10
12
|
/**
|
|
11
13
|
* @public
|
|
@@ -58,13 +60,11 @@ export type BrowserXhrClient<ClientType extends object> = NarrowPayloadBlobTypes
|
|
|
58
60
|
export type NarrowPayloadBlobOutputType<T, ClientType extends object> = {
|
|
59
61
|
[key in keyof ClientType]: [
|
|
60
62
|
ClientType[key]
|
|
61
|
-
] extends [
|
|
62
|
-
InvokeFunction<infer InputTypes, infer OutputTypes, infer ConfigType>
|
|
63
|
-
] ? NarrowedInvokeFunction<T, HttpHandlerOptions, InputTypes, OutputTypes, ConfigType> : [
|
|
64
|
-
ClientType[key]
|
|
65
63
|
] extends [
|
|
66
64
|
InvokeMethod<infer FunctionInputTypes, infer FunctionOutputTypes>
|
|
67
65
|
] ? NarrowedInvokeMethod<T, HttpHandlerOptions, FunctionInputTypes, FunctionOutputTypes> : ClientType[key];
|
|
66
|
+
} & {
|
|
67
|
+
send<Command>(command: Command, options?: any): Promise<Transform<GetOutputType<Command>, StreamingBlobPayloadOutputTypes | undefined, T>>;
|
|
68
68
|
};
|
|
69
69
|
/**
|
|
70
70
|
* @public
|
|
@@ -74,11 +74,9 @@ export type NarrowPayloadBlobOutputType<T, ClientType extends object> = {
|
|
|
74
74
|
export type NarrowPayloadBlobTypes<I, O, ClientType extends object> = {
|
|
75
75
|
[key in keyof ClientType]: [
|
|
76
76
|
ClientType[key]
|
|
77
|
-
] extends [
|
|
78
|
-
InvokeFunction<infer InputTypes, infer OutputTypes, infer ConfigType>
|
|
79
|
-
] ? NarrowedInvokeFunction<O, HttpHandlerOptions, Transform<InputTypes, StreamingBlobPayloadInputTypes | undefined, I>, OutputTypes, ConfigType> : [
|
|
80
|
-
ClientType[key]
|
|
81
77
|
] extends [
|
|
82
78
|
InvokeMethod<infer FunctionInputTypes, infer FunctionOutputTypes>
|
|
83
79
|
] ? NarrowedInvokeMethod<O, HttpHandlerOptions, Transform<FunctionInputTypes, StreamingBlobPayloadInputTypes | undefined, I>, FunctionOutputTypes> : ClientType[key];
|
|
80
|
+
} & {
|
|
81
|
+
send<Command>(command: Command, options?: any): Promise<Transform<GetOutputType<Command>, StreamingBlobPayloadOutputTypes | undefined, O>>;
|
|
84
82
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InvokeMethod, InvokeMethodOptionalArgs } from "../client";
|
|
2
|
+
import { GetOutputType } from "../command";
|
|
2
3
|
/**
|
|
3
4
|
* @public
|
|
4
5
|
*
|
|
@@ -59,13 +60,11 @@ type NarrowClientIOTypes<ClientType extends object> = {
|
|
|
59
60
|
InvokeMethodOptionalArgs<infer FunctionInputTypes, infer FunctionOutputTypes>
|
|
60
61
|
] ? InvokeMethodOptionalArgs<NoUndefined<FunctionInputTypes>, NoUndefined<FunctionOutputTypes>> : [
|
|
61
62
|
ClientType[key]
|
|
62
|
-
] extends [
|
|
63
|
-
InvokeFunction<infer InputTypes, infer OutputTypes, infer ConfigType>
|
|
64
|
-
] ? InvokeFunction<NoUndefined<InputTypes>, NoUndefined<OutputTypes>, ConfigType> : [
|
|
65
|
-
ClientType[key]
|
|
66
63
|
] extends [
|
|
67
64
|
InvokeMethod<infer FunctionInputTypes, infer FunctionOutputTypes>
|
|
68
65
|
] ? InvokeMethod<NoUndefined<FunctionInputTypes>, NoUndefined<FunctionOutputTypes>> : ClientType[key];
|
|
66
|
+
} & {
|
|
67
|
+
send<Command>(command: Command, options?: any): Promise<NoUndefined<GetOutputType<Command>>>;
|
|
69
68
|
};
|
|
70
69
|
/**
|
|
71
70
|
* @internal
|
|
@@ -79,12 +78,10 @@ type UncheckedClientOutputTypes<ClientType extends object> = {
|
|
|
79
78
|
InvokeMethodOptionalArgs<infer FunctionInputTypes, infer FunctionOutputTypes>
|
|
80
79
|
] ? InvokeMethodOptionalArgs<NoUndefined<FunctionInputTypes>, RecursiveRequired<FunctionOutputTypes>> : [
|
|
81
80
|
ClientType[key]
|
|
82
|
-
] extends [
|
|
83
|
-
InvokeFunction<infer InputTypes, infer OutputTypes, infer ConfigType>
|
|
84
|
-
] ? InvokeFunction<NoUndefined<InputTypes>, RecursiveRequired<OutputTypes>, ConfigType> : [
|
|
85
|
-
ClientType[key]
|
|
86
81
|
] extends [
|
|
87
82
|
InvokeMethod<infer FunctionInputTypes, infer FunctionOutputTypes>
|
|
88
83
|
] ? InvokeMethod<NoUndefined<FunctionInputTypes>, RecursiveRequired<FunctionOutputTypes>> : ClientType[key];
|
|
84
|
+
} & {
|
|
85
|
+
send<Command>(command: Command, options?: any): Promise<RecursiveRequired<NoUndefined<GetOutputType<Command>>>>;
|
|
89
86
|
};
|
|
90
87
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/url-parser",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
|
6
6
|
"build:cjs": "node ../../scripts/inline url-parser",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@smithy/querystring-parser": "^3.0.
|
|
26
|
-
"@smithy/types": "^3.
|
|
25
|
+
"@smithy/querystring-parser": "^3.0.4",
|
|
26
|
+
"@smithy/types": "^3.4.0",
|
|
27
27
|
"tslib": "^2.6.2"
|
|
28
28
|
},
|
|
29
29
|
"typesVersions": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/util-defaults-mode-browser",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.16",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
|
6
6
|
"build:cjs": "node ../../scripts/inline util-defaults-mode-browser",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@smithy/property-provider": "^3.1.
|
|
26
|
-
"@smithy/smithy-client": "^3.
|
|
27
|
-
"@smithy/types": "^3.
|
|
25
|
+
"@smithy/property-provider": "^3.1.4",
|
|
26
|
+
"@smithy/smithy-client": "^3.3.0",
|
|
27
|
+
"@smithy/types": "^3.4.0",
|
|
28
28
|
"bowser": "^2.11.0",
|
|
29
29
|
"tslib": "^2.6.2"
|
|
30
30
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/util-defaults-mode-node",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.16",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
|
6
6
|
"build:cjs": "node ../../scripts/inline util-defaults-mode-node",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@smithy/config-resolver": "^3.0.
|
|
26
|
-
"@smithy/credential-provider-imds": "^3.2.
|
|
27
|
-
"@smithy/node-config-provider": "^3.1.
|
|
28
|
-
"@smithy/property-provider": "^3.1.
|
|
29
|
-
"@smithy/smithy-client": "^3.
|
|
30
|
-
"@smithy/types": "^3.
|
|
25
|
+
"@smithy/config-resolver": "^3.0.6",
|
|
26
|
+
"@smithy/credential-provider-imds": "^3.2.1",
|
|
27
|
+
"@smithy/node-config-provider": "^3.1.5",
|
|
28
|
+
"@smithy/property-provider": "^3.1.4",
|
|
29
|
+
"@smithy/smithy-client": "^3.3.0",
|
|
30
|
+
"@smithy/types": "^3.4.0",
|
|
31
31
|
"tslib": "^2.6.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../index.js");
|