-
Notifications
You must be signed in to change notification settings - Fork 579
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(packages): re-export types from @smithy/types (#4900)
- Loading branch information
Showing
32 changed files
with
164 additions
and
2,216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1 @@ | ||
/** | ||
* @public | ||
*/ | ||
export interface AbortHandler { | ||
(this: AbortSignal, ev: any): any; | ||
} | ||
|
||
/** | ||
* @public | ||
* | ||
* Holders of an AbortSignal object may query if the associated operation has | ||
* been aborted and register an onabort handler. | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | ||
*/ | ||
export interface AbortSignal { | ||
/** | ||
* Whether the action represented by this signal has been cancelled. | ||
*/ | ||
readonly aborted: boolean; | ||
|
||
/** | ||
* A function to be invoked when the action represented by this signal has | ||
* been cancelled. | ||
*/ | ||
onabort: AbortHandler | Function | null; | ||
} | ||
|
||
/** | ||
* @public | ||
* | ||
* The AWS SDK uses a Controller/Signal model to allow for cooperative | ||
* cancellation of asynchronous operations. When initiating such an operation, | ||
* the caller can create an AbortController and then provide linked signal to | ||
* subtasks. This allows a single source to communicate to multiple consumers | ||
* that an action has been aborted without dictating how that cancellation | ||
* should be handled. | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/API/AbortController | ||
*/ | ||
export interface AbortController { | ||
/** | ||
* An object that reports whether the action associated with this | ||
* `AbortController` has been cancelled. | ||
*/ | ||
readonly signal: AbortSignal; | ||
|
||
/** | ||
* Declares the operation associated with this AbortController to have been | ||
* cancelled. | ||
*/ | ||
abort(): void; | ||
} | ||
export { AbortController, AbortHandler, AbortSignal } from "@smithy/types"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1 @@ | ||
/** | ||
* @internal | ||
* | ||
* Authentication schemes represent a way that the service will authenticate the customer’s identity. | ||
*/ | ||
export interface AuthScheme { | ||
/** | ||
* @example "sigv4a" or "sigv4" | ||
*/ | ||
name: "sigv4" | "sigv4a" | string; | ||
/** | ||
* @example "s3" | ||
*/ | ||
signingName: string; | ||
/** | ||
* @example "us-east-1" | ||
*/ | ||
signingRegion: string; | ||
/** | ||
* @example ["*"] | ||
* @example ["us-west-2", "us-east-1"] | ||
*/ | ||
signingRegionSet?: string[]; | ||
/** | ||
* @deprecated this field was renamed to signingRegion. | ||
*/ | ||
signingScope?: never; | ||
properties: Record<string, unknown>; | ||
} | ||
|
||
// As described in the Smithy documentation: | ||
// https://github.com/awslabs/smithy/blob/main/smithy-model/src/main/resources/software/amazon/smithy/model/loader/prelude.smithy | ||
/** | ||
* @internal | ||
*/ | ||
export interface HttpAuthDefinition { | ||
/** | ||
* Defines the location of where the Auth is serialized. | ||
*/ | ||
in: HttpAuthLocation; | ||
|
||
/** | ||
* Defines the name of the HTTP header or query string parameter | ||
* that contains the Auth. | ||
*/ | ||
name: string; | ||
|
||
/** | ||
* Defines the security scheme to use on the `Authorization` header value. | ||
* This can only be set if the "in" property is set to {@link HttpAuthLocation.HEADER}. | ||
*/ | ||
scheme?: string; | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export enum HttpAuthLocation { | ||
HEADER = "header", | ||
QUERY = "query", | ||
} | ||
export { AuthScheme, HttpAuthDefinition, HttpAuthLocation } from "@smithy/types"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1 @@ | ||
import { SourceData } from "./crypto"; | ||
|
||
/** | ||
* @public | ||
* | ||
* An object that provides a checksum of data provided in chunks to `update`. | ||
* The checksum may be performed incrementally as chunks are received or all | ||
* at once when the checksum is finalized, depending on the underlying | ||
* implementation. | ||
* | ||
* It's recommended to compute checksum incrementally to avoid reading the | ||
* entire payload in memory. | ||
* | ||
* A class that implements this interface may accept an optional secret key in its | ||
* constructor while computing checksum value, when using HMAC. If provided, | ||
* this secret key would be used when computing checksum. | ||
*/ | ||
export interface Checksum { | ||
/** | ||
* Constant length of the digest created by the algorithm in bytes. | ||
*/ | ||
digestLength?: number; | ||
|
||
/** | ||
* Creates a new checksum object that contains a deep copy of the internal | ||
* state of the current `Checksum` object. | ||
*/ | ||
copy?(): Checksum; | ||
|
||
/** | ||
* Returns the digest of all of the data passed. | ||
*/ | ||
digest(): Promise<Uint8Array>; | ||
|
||
/** | ||
* Allows marking a checksum for checksums that support the ability | ||
* to mark and reset. | ||
* | ||
* @param readLimit - The maximum limit of bytes that can be read | ||
* before the mark position becomes invalid. | ||
*/ | ||
mark?(readLimit: number): void; | ||
|
||
/** | ||
* Resets the checksum to its initial value. | ||
*/ | ||
reset(): void; | ||
|
||
/** | ||
* Adds a chunk of data for which checksum needs to be computed. | ||
* This can be called many times with new data as it is streamed. | ||
* | ||
* Implementations may override this method which passes second param | ||
* which makes Checksum object stateless. | ||
* | ||
* @param chunk - The buffer to update checksum with. | ||
*/ | ||
update(chunk: Uint8Array): void; | ||
} | ||
|
||
/** | ||
* @public | ||
* | ||
* A constructor for a Checksum that may be used to calculate an HMAC. Implementing | ||
* classes should not directly hold the provided key in memory beyond the | ||
* lexical scope of the constructor. | ||
*/ | ||
export interface ChecksumConstructor { | ||
new (secret?: SourceData): Checksum; | ||
} | ||
export { Checksum, ChecksumConstructor } from "@smithy/types"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1 @@ | ||
import { Command } from "./command"; | ||
import { MiddlewareStack } from "./middleware"; | ||
import { MetadataBearer } from "./response"; | ||
|
||
/** | ||
* @public | ||
* | ||
* function definition for different overrides of client's 'send' function. | ||
*/ | ||
interface InvokeFunction<InputTypes extends object, OutputTypes extends MetadataBearer, ResolvedClientConfiguration> { | ||
<InputType extends InputTypes, OutputType extends OutputTypes>( | ||
command: Command<InputTypes, InputType, OutputTypes, OutputType, ResolvedClientConfiguration>, | ||
options?: any | ||
): Promise<OutputType>; | ||
<InputType extends InputTypes, OutputType extends OutputTypes>( | ||
command: Command<InputTypes, InputType, OutputTypes, OutputType, ResolvedClientConfiguration>, | ||
options: any, | ||
cb: (err: any, data?: OutputType) => void | ||
): void; | ||
<InputType extends InputTypes, OutputType extends OutputTypes>( | ||
command: Command<InputTypes, InputType, OutputTypes, OutputType, ResolvedClientConfiguration>, | ||
options?: any, | ||
cb?: (err: any, data?: OutputType) => void | ||
): Promise<OutputType> | void; | ||
} | ||
|
||
/** | ||
* A general interface for service clients, idempotent to browser or node clients | ||
* This type corresponds to SmithyClient(https://github.com/aws/aws-sdk-js-v3/blob/main/packages/smithy-client/src/client.ts). | ||
* It's provided for using without importing the SmithyClient class. | ||
*/ | ||
export interface Client<Input extends object, Output extends MetadataBearer, ResolvedClientConfiguration> { | ||
readonly config: ResolvedClientConfiguration; | ||
middlewareStack: MiddlewareStack<Input, Output>; | ||
send: InvokeFunction<Input, Output, ResolvedClientConfiguration>; | ||
destroy: () => void; | ||
} | ||
export { Client } from "@smithy/types"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1 @@ | ||
import { Handler, MiddlewareStack } from "./middleware"; | ||
import { MetadataBearer } from "./response"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export interface Command< | ||
ClientInput extends object, | ||
InputType extends ClientInput, | ||
ClientOutput extends MetadataBearer, | ||
OutputType extends ClientOutput, | ||
ResolvedConfiguration | ||
> { | ||
readonly input: InputType; | ||
readonly middlewareStack: MiddlewareStack<InputType, OutputType>; | ||
resolveMiddleware( | ||
stack: MiddlewareStack<ClientInput, ClientOutput>, | ||
configuration: ResolvedConfiguration, | ||
options: any | ||
): Handler<InputType, OutputType>; | ||
} | ||
export { Command } from "@smithy/types"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { ConnectConfiguration, ConnectionManager, ConnectionManagerConfiguration, ConnectionPool } from "@smithy/types"; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.