Skip to content

Commit e0751b4

Browse files
authored
chore(packages): re-export types from @smithy/types (#4900)
1 parent ed452d6 commit e0751b4

32 files changed

+164
-2216
lines changed

Diff for: packages/types/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"directory": "packages/types"
4242
},
4343
"dependencies": {
44+
"@smithy/types": "1.1.0",
4445
"tslib": "^2.5.0"
4546
},
4647
"devDependencies": {

Diff for: packages/types/src/abort.ts

+1-53
Original file line numberDiff line numberDiff line change
@@ -1,53 +1 @@
1-
/**
2-
* @public
3-
*/
4-
export interface AbortHandler {
5-
(this: AbortSignal, ev: any): any;
6-
}
7-
8-
/**
9-
* @public
10-
*
11-
* Holders of an AbortSignal object may query if the associated operation has
12-
* been aborted and register an onabort handler.
13-
*
14-
* @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
15-
*/
16-
export interface AbortSignal {
17-
/**
18-
* Whether the action represented by this signal has been cancelled.
19-
*/
20-
readonly aborted: boolean;
21-
22-
/**
23-
* A function to be invoked when the action represented by this signal has
24-
* been cancelled.
25-
*/
26-
onabort: AbortHandler | Function | null;
27-
}
28-
29-
/**
30-
* @public
31-
*
32-
* The AWS SDK uses a Controller/Signal model to allow for cooperative
33-
* cancellation of asynchronous operations. When initiating such an operation,
34-
* the caller can create an AbortController and then provide linked signal to
35-
* subtasks. This allows a single source to communicate to multiple consumers
36-
* that an action has been aborted without dictating how that cancellation
37-
* should be handled.
38-
*
39-
* @see https://developer.mozilla.org/en-US/docs/Web/API/AbortController
40-
*/
41-
export interface AbortController {
42-
/**
43-
* An object that reports whether the action associated with this
44-
* `AbortController` has been cancelled.
45-
*/
46-
readonly signal: AbortSignal;
47-
48-
/**
49-
* Declares the operation associated with this AbortController to have been
50-
* cancelled.
51-
*/
52-
abort(): void;
53-
}
1+
export { AbortController, AbortHandler, AbortSignal } from "@smithy/types";

Diff for: packages/types/src/auth.ts

+1-61
Original file line numberDiff line numberDiff line change
@@ -1,61 +1 @@
1-
/**
2-
* @internal
3-
*
4-
* Authentication schemes represent a way that the service will authenticate the customer’s identity.
5-
*/
6-
export interface AuthScheme {
7-
/**
8-
* @example "sigv4a" or "sigv4"
9-
*/
10-
name: "sigv4" | "sigv4a" | string;
11-
/**
12-
* @example "s3"
13-
*/
14-
signingName: string;
15-
/**
16-
* @example "us-east-1"
17-
*/
18-
signingRegion: string;
19-
/**
20-
* @example ["*"]
21-
* @example ["us-west-2", "us-east-1"]
22-
*/
23-
signingRegionSet?: string[];
24-
/**
25-
* @deprecated this field was renamed to signingRegion.
26-
*/
27-
signingScope?: never;
28-
properties: Record<string, unknown>;
29-
}
30-
31-
// As described in the Smithy documentation:
32-
// https://github.com/awslabs/smithy/blob/main/smithy-model/src/main/resources/software/amazon/smithy/model/loader/prelude.smithy
33-
/**
34-
* @internal
35-
*/
36-
export interface HttpAuthDefinition {
37-
/**
38-
* Defines the location of where the Auth is serialized.
39-
*/
40-
in: HttpAuthLocation;
41-
42-
/**
43-
* Defines the name of the HTTP header or query string parameter
44-
* that contains the Auth.
45-
*/
46-
name: string;
47-
48-
/**
49-
* Defines the security scheme to use on the `Authorization` header value.
50-
* This can only be set if the "in" property is set to {@link HttpAuthLocation.HEADER}.
51-
*/
52-
scheme?: string;
53-
}
54-
55-
/**
56-
* @internal
57-
*/
58-
export enum HttpAuthLocation {
59-
HEADER = "header",
60-
QUERY = "query",
61-
}
1+
export { AuthScheme, HttpAuthDefinition, HttpAuthLocation } from "@smithy/types";

Diff for: packages/types/src/checksum.ts

+1-70
Original file line numberDiff line numberDiff line change
@@ -1,70 +1 @@
1-
import { SourceData } from "./crypto";
2-
3-
/**
4-
* @public
5-
*
6-
* An object that provides a checksum of data provided in chunks to `update`.
7-
* The checksum may be performed incrementally as chunks are received or all
8-
* at once when the checksum is finalized, depending on the underlying
9-
* implementation.
10-
*
11-
* It's recommended to compute checksum incrementally to avoid reading the
12-
* entire payload in memory.
13-
*
14-
* A class that implements this interface may accept an optional secret key in its
15-
* constructor while computing checksum value, when using HMAC. If provided,
16-
* this secret key would be used when computing checksum.
17-
*/
18-
export interface Checksum {
19-
/**
20-
* Constant length of the digest created by the algorithm in bytes.
21-
*/
22-
digestLength?: number;
23-
24-
/**
25-
* Creates a new checksum object that contains a deep copy of the internal
26-
* state of the current `Checksum` object.
27-
*/
28-
copy?(): Checksum;
29-
30-
/**
31-
* Returns the digest of all of the data passed.
32-
*/
33-
digest(): Promise<Uint8Array>;
34-
35-
/**
36-
* Allows marking a checksum for checksums that support the ability
37-
* to mark and reset.
38-
*
39-
* @param readLimit - The maximum limit of bytes that can be read
40-
* before the mark position becomes invalid.
41-
*/
42-
mark?(readLimit: number): void;
43-
44-
/**
45-
* Resets the checksum to its initial value.
46-
*/
47-
reset(): void;
48-
49-
/**
50-
* Adds a chunk of data for which checksum needs to be computed.
51-
* This can be called many times with new data as it is streamed.
52-
*
53-
* Implementations may override this method which passes second param
54-
* which makes Checksum object stateless.
55-
*
56-
* @param chunk - The buffer to update checksum with.
57-
*/
58-
update(chunk: Uint8Array): void;
59-
}
60-
61-
/**
62-
* @public
63-
*
64-
* A constructor for a Checksum that may be used to calculate an HMAC. Implementing
65-
* classes should not directly hold the provided key in memory beyond the
66-
* lexical scope of the constructor.
67-
*/
68-
export interface ChecksumConstructor {
69-
new (secret?: SourceData): Checksum;
70-
}
1+
export { Checksum, ChecksumConstructor } from "@smithy/types";

Diff for: packages/types/src/client.ts

+1-37
Original file line numberDiff line numberDiff line change
@@ -1,37 +1 @@
1-
import { Command } from "./command";
2-
import { MiddlewareStack } from "./middleware";
3-
import { MetadataBearer } from "./response";
4-
5-
/**
6-
* @public
7-
*
8-
* function definition for different overrides of client's 'send' function.
9-
*/
10-
interface InvokeFunction<InputTypes extends object, OutputTypes extends MetadataBearer, ResolvedClientConfiguration> {
11-
<InputType extends InputTypes, OutputType extends OutputTypes>(
12-
command: Command<InputTypes, InputType, OutputTypes, OutputType, ResolvedClientConfiguration>,
13-
options?: any
14-
): Promise<OutputType>;
15-
<InputType extends InputTypes, OutputType extends OutputTypes>(
16-
command: Command<InputTypes, InputType, OutputTypes, OutputType, ResolvedClientConfiguration>,
17-
options: any,
18-
cb: (err: any, data?: OutputType) => void
19-
): void;
20-
<InputType extends InputTypes, OutputType extends OutputTypes>(
21-
command: Command<InputTypes, InputType, OutputTypes, OutputType, ResolvedClientConfiguration>,
22-
options?: any,
23-
cb?: (err: any, data?: OutputType) => void
24-
): Promise<OutputType> | void;
25-
}
26-
27-
/**
28-
* A general interface for service clients, idempotent to browser or node clients
29-
* This type corresponds to SmithyClient(https://github.com/aws/aws-sdk-js-v3/blob/main/packages/smithy-client/src/client.ts).
30-
* It's provided for using without importing the SmithyClient class.
31-
*/
32-
export interface Client<Input extends object, Output extends MetadataBearer, ResolvedClientConfiguration> {
33-
readonly config: ResolvedClientConfiguration;
34-
middlewareStack: MiddlewareStack<Input, Output>;
35-
send: InvokeFunction<Input, Output, ResolvedClientConfiguration>;
36-
destroy: () => void;
37-
}
1+
export { Client } from "@smithy/types";

Diff for: packages/types/src/command.ts

+1-21
Original file line numberDiff line numberDiff line change
@@ -1,21 +1 @@
1-
import { Handler, MiddlewareStack } from "./middleware";
2-
import { MetadataBearer } from "./response";
3-
4-
/**
5-
* @public
6-
*/
7-
export interface Command<
8-
ClientInput extends object,
9-
InputType extends ClientInput,
10-
ClientOutput extends MetadataBearer,
11-
OutputType extends ClientOutput,
12-
ResolvedConfiguration
13-
> {
14-
readonly input: InputType;
15-
readonly middlewareStack: MiddlewareStack<InputType, OutputType>;
16-
resolveMiddleware(
17-
stack: MiddlewareStack<ClientInput, ClientOutput>,
18-
configuration: ResolvedConfiguration,
19-
options: any
20-
): Handler<InputType, OutputType>;
21-
}
1+
export { Command } from "@smithy/types";

Diff for: packages/types/src/connection.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { ConnectConfiguration, ConnectionManager, ConnectionManagerConfiguration, ConnectionPool } from "@smithy/types";

Diff for: packages/types/src/connection/config.ts

-7
This file was deleted.

Diff for: packages/types/src/connection/index.ts

-3
This file was deleted.

Diff for: packages/types/src/connection/manager.ts

-33
This file was deleted.

Diff for: packages/types/src/connection/pool.ts

-28
This file was deleted.

0 commit comments

Comments
 (0)