🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@smithy/core

Package Overview
Dependencies
Maintainers
2
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smithy/core - npm Package Compare versions

Comparing version
3.29.2
to
3.29.3
+14
dist-types/ts3.4/index.d.ts
export { getSmithyContext } from "@smithy/core/transport";
export { getHttpAuthSchemeEndpointRuleSetPlugin, getHttpAuthSchemePlugin, httpAuthSchemeEndpointRuleSetMiddlewareOptions, httpAuthSchemeMiddleware, httpAuthSchemeMiddlewareOptions, } from "./legacy-root-exports/middleware-http-auth-scheme";
export { PreviouslyResolved } from "./legacy-root-exports/middleware-http-auth-scheme";
export { getHttpSigningPlugin, httpSigningMiddleware, httpSigningMiddlewareOptions, } from "./legacy-root-exports/middleware-http-signing";
export { normalizeProvider } from "./normalizeProvider";
export { createPaginator } from "./legacy-root-exports/pagination/createPaginator";
/**
* Backwards compatibility re-export.
* @internal
*/
export { requestBuilder } from "@smithy/core/protocols";
export { setFeature } from "./setFeature";
export { DefaultIdentityProviderConfig, EXPIRATION_MS, HttpApiKeyAuthSigner, HttpBearerAuthSigner, NoAuthSigner, createIsIdentityExpiredFunction, doesIdentityRequireRefresh, isIdentityExpired, memoizeIdentityProvider, } from "./legacy-root-exports/util-identity-and-auth";
export { MemoizedIdentityProvider } from "./legacy-root-exports/util-identity-and-auth";
import { HandlerExecutionContext, HttpAuthSchemeParameters, HttpAuthSchemeParametersProvider, IdentityProviderConfig, Pluggable, RelativeMiddlewareOptions, SerializeHandlerOptions } from "@smithy/types";
import { PreviouslyResolved } from "./httpAuthSchemeMiddleware";
/**
* @internal
*/
export declare const httpAuthSchemeEndpointRuleSetMiddlewareOptions: SerializeHandlerOptions & RelativeMiddlewareOptions;
/**
* @internal
*/
interface HttpAuthSchemeEndpointRuleSetPluginOptions<TConfig extends object, TContext extends HandlerExecutionContext, TParameters extends HttpAuthSchemeParameters, TInput extends object> {
httpAuthSchemeParametersProvider: HttpAuthSchemeParametersProvider<TConfig, TContext, TParameters, TInput>;
identityProviderConfigProvider: (config: TConfig) => Promise<IdentityProviderConfig>;
}
/**
* @internal
*/
export declare const getHttpAuthSchemeEndpointRuleSetPlugin: <TConfig extends object, TContext extends HandlerExecutionContext, TParameters extends HttpAuthSchemeParameters, TInput extends object>(config: TConfig & PreviouslyResolved<TParameters>, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }: HttpAuthSchemeEndpointRuleSetPluginOptions<TConfig, TContext, TParameters, TInput>) => Pluggable<any, any>;
export {};
import { HandlerExecutionContext, HttpAuthSchemeParameters, HttpAuthSchemeParametersProvider, IdentityProviderConfig, Pluggable, RelativeMiddlewareOptions, SerializeHandlerOptions } from "@smithy/types";
import { PreviouslyResolved } from "./httpAuthSchemeMiddleware";
/**
* @internal
*/
export declare const httpAuthSchemeMiddlewareOptions: SerializeHandlerOptions & RelativeMiddlewareOptions;
/**
* @internal
*/
interface HttpAuthSchemePluginOptions<TConfig extends object, TContext extends HandlerExecutionContext, TParameters extends HttpAuthSchemeParameters, TInput extends object> {
httpAuthSchemeParametersProvider: HttpAuthSchemeParametersProvider<TConfig, TContext, TParameters, TInput>;
identityProviderConfigProvider: (config: TConfig) => Promise<IdentityProviderConfig>;
}
/**
* @internal
*/
export declare const getHttpAuthSchemePlugin: <TConfig extends object, TContext extends HandlerExecutionContext, TParameters extends HttpAuthSchemeParameters, TInput extends object>(config: TConfig & PreviouslyResolved<TParameters>, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }: HttpAuthSchemePluginOptions<TConfig, TContext, TParameters, TInput>) => Pluggable<any, any>;
export {};
import { HandlerExecutionContext, HttpAuthScheme, HttpAuthSchemeParameters, HttpAuthSchemeParametersProvider, HttpAuthSchemeProvider, IdentityProviderConfig, Provider, SMITHY_CONTEXT_KEY, SelectedHttpAuthScheme, SerializeMiddleware } from "@smithy/types";
/**
* @internal
*/
export interface PreviouslyResolved<TParameters extends HttpAuthSchemeParameters> {
authSchemePreference?: Provider<string[]>;
httpAuthSchemes: HttpAuthScheme[];
httpAuthSchemeProvider: HttpAuthSchemeProvider<TParameters>;
}
/**
* @internal
*/
interface HttpAuthSchemeMiddlewareOptions<TConfig extends object, TContext extends HandlerExecutionContext, TParameters extends HttpAuthSchemeParameters, TInput extends object> {
httpAuthSchemeParametersProvider: HttpAuthSchemeParametersProvider<TConfig, TContext, TParameters, TInput>;
identityProviderConfigProvider: (config: TConfig) => Promise<IdentityProviderConfig>;
}
/**
* @internal
*/
interface HttpAuthSchemeMiddlewareSmithyContext extends Record<string, unknown> {
selectedHttpAuthScheme?: SelectedHttpAuthScheme;
}
/**
* @internal
*/
interface HttpAuthSchemeMiddlewareHandlerExecutionContext extends HandlerExecutionContext {
[SMITHY_CONTEXT_KEY]?: HttpAuthSchemeMiddlewareSmithyContext;
}
/**
* @internal
*/
export declare const httpAuthSchemeMiddleware: <TInput extends object, Output extends object, TConfig extends object, TContext extends HttpAuthSchemeMiddlewareHandlerExecutionContext, TParameters extends HttpAuthSchemeParameters>(config: TConfig & PreviouslyResolved<TParameters>, mwOptions: HttpAuthSchemeMiddlewareOptions<TConfig, TContext, TParameters, TInput>) => SerializeMiddleware<TInput, Output>;
export {};
export { httpAuthSchemeMiddleware } from "./httpAuthSchemeMiddleware";
export { PreviouslyResolved } from "./httpAuthSchemeMiddleware";
export { getHttpAuthSchemeEndpointRuleSetPlugin, httpAuthSchemeEndpointRuleSetMiddlewareOptions, } from "./getHttpAuthSchemeEndpointRuleSetPlugin";
export { getHttpAuthSchemePlugin, httpAuthSchemeMiddlewareOptions } from "./getHttpAuthSchemePlugin";
import { HttpAuthOption } from "@smithy/types";
/**
* Resolves list of auth options based on the supported ones, vs the preference list.
*
* @param candidateAuthOptions list of supported auth options selected by the standard
* resolution process (model-based, endpoints 2.0, etc.)
* @param authSchemePreference list of auth schemes preferred by user.
* @returns
*/
export declare const resolveAuthOptions: (candidateAuthOptions: HttpAuthOption[], authSchemePreference: string[]) => HttpAuthOption[];
import { FinalizeRequestHandlerOptions, Pluggable, RelativeMiddlewareOptions } from "@smithy/types";
/**
* @internal
*/
export declare const httpSigningMiddlewareOptions: FinalizeRequestHandlerOptions & RelativeMiddlewareOptions;
/**
* @internal
*/
export declare const getHttpSigningPlugin: <Input extends object, Output extends object>(config: object) => Pluggable<Input, Output>;
import { FinalizeRequestMiddleware } from "@smithy/types";
/**
* @internal
*/
export declare const httpSigningMiddleware: <Input extends object, Output extends object>(config: object) => FinalizeRequestMiddleware<Input, Output>;
export { httpSigningMiddleware } from "./httpSigningMiddleware";
export { getHttpSigningPlugin, httpSigningMiddlewareOptions } from "./getHttpSigningMiddleware";
import { PaginationConfiguration, Paginator } from "@smithy/types";
/**
* Creates a paginator.
*
* @internal
*/
export declare function createPaginator<PaginationConfigType extends PaginationConfiguration, InputType extends object, OutputType extends object>(ClientCtor: any, CommandCtor: any, inputTokenName: string, outputTokenName: string, pageSizeTokenName?: string): (config: PaginationConfigType, input: InputType, ...additionalArguments: any[]) => Paginator<OutputType>;
import { HttpAuthSchemeId, Identity, IdentityProvider, IdentityProviderConfig } from "@smithy/types";
/**
* Default implementation of IdentityProviderConfig
* @internal
*/
export declare class DefaultIdentityProviderConfig implements IdentityProviderConfig {
private authSchemes;
/**
* Creates an IdentityProviderConfig with a record of scheme IDs to identity providers.
*
* @param config scheme IDs and identity providers to configure
*/
constructor(config: Record<HttpAuthSchemeId, IdentityProvider<Identity> | undefined>);
getIdentityProvider(schemeId: HttpAuthSchemeId): IdentityProvider<Identity> | undefined;
}
import { HttpRequest } from "@smithy/core/protocols";
import { ApiKeyIdentity, HttpSigner, HttpRequest as IHttpRequest } from "@smithy/types";
/**
* @internal
*/
export declare class HttpApiKeyAuthSigner implements HttpSigner {
sign(httpRequest: HttpRequest, identity: ApiKeyIdentity, signingProperties: Record<string, any>): Promise<IHttpRequest>;
}
import { HttpRequest } from "@smithy/core/protocols";
import { HttpSigner, HttpRequest as IHttpRequest, TokenIdentity } from "@smithy/types";
/**
* @internal
*/
export declare class HttpBearerAuthSigner implements HttpSigner {
sign(httpRequest: HttpRequest, identity: TokenIdentity, signingProperties: Record<string, any>): Promise<IHttpRequest>;
}
export { HttpApiKeyAuthSigner } from "./httpApiKeyAuth";
export { HttpBearerAuthSigner } from "./httpBearerAuth";
export { NoAuthSigner } from "./noAuth";
import { HttpRequest, HttpSigner, Identity } from "@smithy/types";
/**
* Signer for the synthetic @smithy.api#noAuth auth scheme.
* @internal
*/
export declare class NoAuthSigner implements HttpSigner {
sign(httpRequest: HttpRequest, identity: Identity, signingProperties: Record<string, unknown>): Promise<HttpRequest>;
}
export { DefaultIdentityProviderConfig } from "./DefaultIdentityProviderConfig";
export { HttpApiKeyAuthSigner, HttpBearerAuthSigner, NoAuthSigner } from "./httpAuthSchemes";
export { EXPIRATION_MS, createIsIdentityExpiredFunction, doesIdentityRequireRefresh, isIdentityExpired, memoizeIdentityProvider, } from "./memoizeIdentityProvider";
export { MemoizedIdentityProvider } from "./memoizeIdentityProvider";
import { Identity, IdentityProvider } from "@smithy/types";
/**
* @internal
*/
export declare const createIsIdentityExpiredFunction: (expirationMs: number) => (identity: Identity) => boolean;
/**
* This may need to be configurable in the future, but for now it is defaulted to 5min.
*
* @internal
*/
export declare const EXPIRATION_MS = 300000;
/**
* @internal
*/
export declare const isIdentityExpired: (identity: Identity) => boolean;
/**
* @internal
*/
export declare const doesIdentityRequireRefresh: (identity: Identity) => boolean;
/**
* @internal
*/
export interface MemoizedIdentityProvider<IdentityT extends Identity> {
(options?: Record<string, any> & {
forceRefresh?: boolean;
}): Promise<IdentityT>;
}
/**
* @internal
*/
export declare const memoizeIdentityProvider: <IdentityT extends Identity>(provider: IdentityT | IdentityProvider<IdentityT> | undefined, isExpired: (resolved: Identity) => boolean, requiresRefresh: (resolved: Identity) => boolean) => MemoizedIdentityProvider<IdentityT> | undefined;
import { Provider } from "@smithy/types";
/**
* @internal
*
* @returns a provider function for the input value if it isn't already one.
*/
export declare const normalizeProvider: <T>(input: T | Provider<T>) => Provider<T>;
import { HandlerExecutionContext, SmithyFeatures } from "@smithy/types";
/**
* Indicates to the request context that a given feature is active.
* specification asks the library not to include a runtime lookup of all
* the feature identifiers.
*
* @internal
* @param context - handler execution context.
* @param feature - readable name of feature.
* @param value - encoding value of feature. This is required because the
*/
export declare function setFeature<F extends keyof SmithyFeatures>(context: HandlerExecutionContext, feature: F, value: SmithyFeatures[F]): void;
/**
* Prints bytes as binary string with numbers.
* @param bytes - to print.
* @deprecated for testing only, do not use in runtime.
*/
export declare function printBytes(bytes: Uint8Array): string[];
import { CborValueType, Float32, Uint8, Uint32 } from "./cbor-types";
/**
* Sets the decode bytearray source and its data view.
*
* @internal
* @param bytes - to be set as the decode source.
*/
export declare function setPayload(bytes: Uint8Array): void;
/**
* Decodes the data between the two indices.
*
* @internal
*/
export declare function decode(at: Uint32, to: Uint32): CborValueType;
/**
* @internal
*/
export declare function bytesToFloat16(a: Uint8, b: Uint8): Float32;
/**
* @internal
*/
export declare function advanceDecodingEpoch(): void;
/**
* @param _input - JS data object.
*/
export declare function encode(_input: any): void;
/**
* @internal
*/
export declare function advanceEncodingEpoch(): void;
/**
* @internal
*/
export declare function toUint8Array(): Uint8Array;
export declare function resize(size: number): void;
export type CborItemType = undefined | boolean | number | bigint | [
CborUnstructuredByteStringType,
Uint64
] | string | CborTagType;
export type CborTagType = {
tag: Uint64 | number;
value: CborValueType;
[tagSymbol]: true;
};
export type CborUnstructuredByteStringType = Uint8Array;
export type CborListType<T = any> = Array<T>;
export type CborMapType<T = any> = Record<string, T>;
export type CborCollectionType<T = any> = CborMapType<T> | CborListType<T>;
export type CborValueType = CborItemType | CborCollectionType | any;
export type CborArgumentLength = 1 | 2 | 4 | 8;
export type CborArgumentLengthOffset = 1 | 2 | 3 | 5 | 9;
export type CborOffset = number;
export type Uint8 = number;
export type Uint32 = number;
export type Uint64 = bigint;
export type Float32 = number;
export type Int64 = bigint;
export type Float16Binary = number;
export type Float32Binary = number;
export type CborMajorType = typeof majorUint64 | typeof majorNegativeInt64 | typeof majorUnstructuredByteString | typeof majorUtf8String | typeof majorList | typeof majorMap | typeof majorTag | typeof majorSpecial;
export declare const majorUint64 = 0;
export declare const majorNegativeInt64 = 1;
export declare const majorUnstructuredByteString = 2;
export declare const majorUtf8String = 3;
export declare const majorList = 4;
export declare const majorMap = 5;
export declare const majorTag = 6;
export declare const majorSpecial = 7;
export declare const specialFalse = 20;
export declare const specialTrue = 21;
export declare const specialNull = 22;
export declare const specialUndefined = 23;
export declare const extendedOneByte = 24;
export declare const extendedFloat16 = 25;
export declare const extendedFloat32 = 26;
export declare const extendedFloat64 = 27;
export declare const minorIndefinite = 31;
export declare function alloc(size: number): Uint8Array;
/**
* The presence of this symbol as an object key indicates it should be considered a tag
* for CBOR serialization purposes.
* The object must also have the properties "tag" and "value".
*
* @public
*/
export declare const tagSymbol: unique symbol;
/**
* Applies the tag symbol to the object.
*
* @public
*/
export declare function tag(data: {
tag: number | bigint;
value: any;
[tagSymbol]?: true;
}): {
tag: number | bigint;
value: any;
[tagSymbol]: true;
};
/**
* This implementation is synchronous and only implements the parts of CBOR
* specification used by Smithy RPCv2 CBOR protocol.
*
* This cbor serde implementation is derived from AWS SDK for Go's implementation.
* @see https://github.com/aws/smithy-go/tree/main/encoding/cbor
*
* The cbor-x implementation was also instructional:
* @see https://github.com/kriszyp/cbor-x
*/
export declare const cbor: {
deserialize(payload: Uint8Array): any;
serialize(input: any): Uint8Array;
/**
* This may be used to garbage collect the CBOR
* shared encoding buffer space,
* e.g. resizeEncodingBuffer(0);
* This may also be used to pre-allocate more space for
* CBOR encoding, e.g. resizeEncodingBuffer(100_000_000);
*
* @public
* @param size - byte length to allocate.
*/
resizeEncodingBuffer(size: number): void;
};
import { SerdeContext } from "@smithy/core/protocols";
import { Codec, Schema, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
/**
* @public
*/
export declare class CborCodec extends SerdeContext implements Codec<Uint8Array, Uint8Array> {
createSerializer(): CborShapeSerializer;
createDeserializer(): CborShapeDeserializer;
}
/**
* @public
*/
export declare class CborShapeSerializer extends SerdeContext implements ShapeSerializer {
private value;
write(schema: Schema, value: unknown): void;
/**
* Recursive serializer transform that copies and prepares the user input object
* for CBOR serialization.
*/
serialize(schema: Schema, source: unknown): any;
flush(): Uint8Array;
}
/**
* @public
*/
export declare class CborShapeDeserializer extends SerdeContext implements ShapeDeserializer {
read(schema: Schema, bytes: Uint8Array): any;
/**
* Public because it's called by the protocol implementation to deserialize errors.
* @internal
*/
readValue(_schema: Schema, value: any): any;
}
export { cbor } from "./cbor";
export { tag, tagSymbol } from "./cbor-types";
export { buildHttpRpcRequest, checkCborResponse, dateToTag, loadSmithyRpcV2CborErrorCode, parseCborBody, parseCborErrorBody, } from "./parseCborBody";
export { SmithyRpcV2CborProtocol } from "./SmithyRpcV2CborProtocol";
export { CborCodec, CborShapeDeserializer, CborShapeSerializer } from "./CborCodec";
import { HttpRequest as __HttpRequest } from "@smithy/core/protocols";
import { HttpResponse, SerdeContext, HeaderBag as __HeaderBag, SerdeContext as __SerdeContext } from "@smithy/types";
import { tagSymbol } from "./cbor-types";
/**
* @internal
*/
export declare const parseCborBody: (streamBody: any, context: SerdeContext) => any;
/**
* @internal
*/
export declare const dateToTag: (date: Date) => {
tag: number | bigint;
value: any;
[tagSymbol]: true;
};
/**
* @internal
*/
export declare const parseCborErrorBody: (errorBody: any, context: SerdeContext) => Promise<any>;
/**
* @internal
*/
export declare const loadSmithyRpcV2CborErrorCode: (output: HttpResponse, data: any) => string | undefined;
/**
* @internal
*/
export declare const checkCborResponse: (response: HttpResponse) => void;
/**
* @internal
*/
export declare const buildHttpRpcRequest: (context: __SerdeContext, headers: __HeaderBag, path: string, resolvedHostname: string | undefined, body: any) => Promise<__HttpRequest>;
import { RpcProtocol } from "@smithy/core/protocols";
import { TypeRegistry } from "@smithy/core/schema";
import { EndpointBearer, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, SerdeFunctions } from "@smithy/types";
import { CborCodec } from "./CborCodec";
/**
* Client protocol for Smithy RPCv2 CBOR.
*
* @public
*/
export declare class SmithyRpcV2CborProtocol extends RpcProtocol {
/**
* @override
*/
protected compositeErrorRegistry: TypeRegistry;
private codec;
protected serializer: import("./CborCodec").CborShapeSerializer;
protected deserializer: import("./CborCodec").CborShapeDeserializer;
constructor({ defaultNamespace, errorTypeRegistries, }: {
defaultNamespace: string;
errorTypeRegistries?: TypeRegistry[];
});
getShapeId(): string;
getPayloadCodec(): CborCodec;
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
protected getDefaultContentType(): string;
}
/**
* Reads the blob data into the onChunk consumer.
*
* @internal
*/
export declare function blobReader(blob: Blob, onChunk: (chunk: Uint8Array) => void, chunkSize?: number): Promise<void>;
/**
* @internal
*/
export declare function blobReader(blob: Blob, onChunk: (chunk: Uint8Array) => void, chunkSize?: number): Promise<void>;
import { Checksum } from "@smithy/types";
/**
* Pure JS CRC-32 implementation using the IEEE 802.3 polynomial.
* @see https://www.w3.org/TR/png/#D-CRCAppendix
* @public
*/
export declare class Crc32Js implements Checksum {
readonly digestLength = 4;
private checksum;
update(data: Uint8Array): void;
/**
* Used by EventStreamCodec.
* @internal
*/
digestSync(): number;
digest(): Promise<Uint8Array>;
reset(): void;
}
import { Checksum } from "@smithy/types";
/**
* CRC-32 using Node.js zlib native implementation when available,
* falling back to the pure JS implementation.
* @public
*/
export interface Crc32Node extends Checksum {
readonly digestLength: 4;
/**
* Used by EventStreamCodec.
* @internal
*/
digestSync(): number;
}
/**
* @public
*/
export declare const Crc32Node: new () => Crc32Node;
import { StreamHasher } from "@smithy/types";
/**
* @internal
*/
export declare const blobHasher: StreamHasher<Blob>;
import { Readable } from "node:stream";
import { StreamHasher } from "@smithy/types";
/**
* @internal
*/
export declare const fileStreamHasher: StreamHasher<Readable>;
import { Writable, WritableOptions } from "node:stream";
import { Checksum, Hash } from "@smithy/types";
/**
* @internal
*/
export declare class HashCalculator extends Writable {
readonly hash: Checksum | Hash;
constructor(hash: Checksum | Hash, options?: WritableOptions);
_write(chunk: Buffer, encoding: string, callback: (err?: Error) => void): void;
}
import { Readable } from "node:stream";
import { StreamHasher } from "@smithy/types";
/**
* @internal
*/
export declare const readableStreamHasher: StreamHasher<Readable>;
export { blobHasher } from "./hash-blob-browser/blobHasher";
export declare const fileStreamHasher: symbol;
export declare const readableStreamHasher: symbol;
export { Md5Js, Md5Js as Md5 } from "./md5/Md5Js";
export declare const Md5Node: symbol;
export { Crc32Js, Crc32Js as Crc32 } from "./crc32/Crc32Js";
export declare const Crc32Node: symbol;
export { Sha256Js } from "./sha256/Sha256Js";
export { Sha256WebCrypto, Sha256WebCrypto as Sha256 } from "./sha256/Sha256WebCrypto";
export declare const Sha256Node: symbol;
export { blobReader } from "./chunked-blob-reader/chunked-blob-reader";
export { blobHasher } from "./hash-blob-browser/blobHasher";
export { fileStreamHasher } from "./hash-stream-node/fileStreamHasher";
export { readableStreamHasher } from "./hash-stream-node/readableStreamHasher";
export { Md5Js } from "./md5/Md5Js";
export { Md5Node, Md5Node as Md5 } from "./md5/Md5Node";
export { Crc32Js } from "./crc32/Crc32Js";
export { Crc32Node, Crc32Node as Crc32 } from "./crc32/Crc32Node";
export { Sha256Js } from "./sha256/Sha256Js";
export { Sha256Node, Sha256Node as Sha256 } from "./sha256/Sha256Node";
export { Sha256WebCrypto } from "./sha256/Sha256WebCrypto";
export { blobReader } from "./chunked-blob-reader/chunked-blob-reader";
export { blobHasher } from "./hash-blob-browser/blobHasher";
export declare const fileStreamHasher: symbol;
export declare const readableStreamHasher: symbol;
export { Md5Js, Md5Js as Md5 } from "./md5/Md5Js";
export declare const Md5Node: symbol;
export { Crc32Js, Crc32Js as Crc32 } from "./crc32/Crc32Js";
export declare const Crc32Node: symbol;
export { Sha256Js } from "./sha256/Sha256Js";
export { Sha256WebCrypto, Sha256WebCrypto as Sha256 } from "./sha256/Sha256WebCrypto";
export declare const Sha256Node: symbol;
export { blobReader } from "./chunked-blob-reader/chunked-blob-reader.native";
import { Checksum, SourceData } from "@smithy/types";
/**
* Pure-JS MD5 implementation. Used as fallback where node:crypto is unavailable.
*
* @public
*/
export declare class Md5Js implements Checksum {
readonly digestLength = 16;
private state;
private writeBuffer;
private bufferLength;
private bytesHashed;
update(sourceData: SourceData): void;
/**
* Non-destructive: works on copies so update() may continue after digest().
*/
digest(): Promise<Uint8Array>;
reset(): void;
}
import { Checksum, SourceData } from "@smithy/types";
/**
* MD5 using Node.js crypto native implementation when available,
* falling back to the pure JS implementation.
* @public
*/
export interface Md5Node extends Checksum {
readonly digestLength: 16;
/**
* @override
*/
update(data: SourceData): void;
}
/**
* @public
*/
export declare const Md5Node: new () => Md5Node;
import { Checksum, SourceData } from "@smithy/types";
/**
* Pure JS SHA-256 implementation with HMAC support.
* @see https://csrc.nist.gov/pubs/fips/180-4/upd1/final
* @public
*/
export declare class Sha256Js implements Checksum {
readonly digestLength = 32;
/** Eight 32-bit words representing the current hash state. */
private state;
/** Reused message schedule array (W), allocated on first use of hashBuffer. */
private w?;
/** Accumulates input bytes until a full 64-byte block is ready. */
private buffer;
private bufferLength;
private bytesHashed;
private finished;
private readonly inner?;
private readonly outer?;
constructor(secret?: SourceData);
update(data: SourceData): void;
digest(): Promise<Uint8Array>;
reset(): void;
private digestSync;
private static normalizeKey;
private hashBuffer;
private hashBufferWith;
}
import { Checksum, SourceData } from "@smithy/types";
/**
* SHA-256 using Node.js crypto native implementation when available,
* falling back to the pure JS implementation.
* @public
*/
export interface Sha256Node extends Checksum {
readonly digestLength: 32;
}
/**
* @public
*/
export declare const Sha256Node: new (secret?: SourceData) => Sha256Node;
import { Checksum, SourceData } from "@smithy/types";
/**
* SHA-256 using the Web Crypto API (crypto.subtle) when available,
* falling back to the pure JS implementation.
*
* Caution: this implementation is forced to buffer the data entirely.
* Use the pure-JS or Sha256Node implementations for large streaming data.
* @public
*/
export declare class Sha256WebCrypto implements Checksum {
readonly digestLength: 32;
private readonly secret?;
private pending;
private pendingBytes;
private fallback?;
private finished;
constructor(secret?: SourceData);
update(data: Uint8Array): void;
digest(): Promise<Uint8Array>;
reset(): void;
private switchToFallback;
}
export { constructStack } from "./middleware-stack/MiddlewareStack";
export { getSmithyContext } from "@smithy/core/transport";
export { normalizeProvider } from "@smithy/core/transport";
export { invalidFunction } from "./invalid-dependency/invalidFunction";
export { invalidProvider } from "./invalid-dependency/invalidProvider";
export { createWaiter } from "./util-waiter/createWaiter";
export { waiterServiceDefaults, WaiterState, checkExceptions, WaiterConfiguration, WaiterOptions, WaiterResult } from "./util-waiter/waiter";
export { Client, SmithyConfiguration, SmithyResolvedConfiguration } from "./smithy-client/client";
export { Command, CommandImpl } from "./smithy-client/command";
export { SENSITIVE_STRING } from "./smithy-client/constants";
export { createAggregatedClient } from "./smithy-client/create-aggregated-client";
export { throwDefaultError, withBaseException } from "./smithy-client/default-error-handler";
export { loadConfigsForDefaultMode, DefaultsMode, ResolvedDefaultsMode, DefaultsModeConfigs } from "./smithy-client/defaults-mode";
export { emitWarningIfUnsupportedVersion } from "./smithy-client/emitWarningIfUnsupportedVersion";
export { ServiceException, decorateServiceException, ExceptionOptionType, ServiceExceptionOptions } from "./smithy-client/exceptions";
export { getDefaultExtensionConfiguration, getDefaultClientConfiguration, resolveDefaultRuntimeConfig, DefaultExtensionRuntimeConfigType } from "./smithy-client/extensions/defaultExtensionConfiguration";
export { AlgorithmId, getChecksumConfiguration, resolveChecksumRuntimeConfig, ChecksumAlgorithm, ChecksumConfiguration, PartialChecksumRuntimeConfigType } from "./smithy-client/extensions/checksum";
export { getRetryConfiguration, resolveRetryRuntimeConfig, PartialRetryRuntimeConfigType } from "./smithy-client/extensions/retry";
export { getArrayIfSingleItem } from "./smithy-client/get-array-if-single-item";
export { getValueFromTextNode } from "./smithy-client/get-value-from-text-node";
export { isSerializableHeaderValue } from "./smithy-client/is-serializable-header-value";
export { NoOpLogger } from "./smithy-client/NoOpLogger";
export { map, convertMap, take, ObjectMappingInstructions, SourceMappingInstructions, ObjectMappingInstruction, UnfilteredValue, LazyValueInstruction, ConditionalLazyValueInstruction, SimpleValueInstruction, ConditionalValueInstruction, SourceMappingInstruction, FilterStatus, FilterStatusSupplier, ValueFilteringFunction, ValueSupplier, ValueMapper, Value } from "./smithy-client/object-mapping";
export { schemaLogFilter } from "./smithy-client/schemaLogFilter";
export { serializeFloat, serializeDateTime } from "./smithy-client/ser-utils";
export { _json } from "./smithy-client/serde-json";
export { makeBuilder } from "./smithy-client/client-command-builder";
/**
* @internal
*/
export declare const invalidFunction: (message: string) => () => never;
import { Provider } from "@smithy/types";
/**
* @internal
*/
export declare const invalidProvider: (message: string) => Provider<any>;
import { MiddlewareStack } from "@smithy/types";
/**
* @internal
*/
export declare const constructStack: <Input extends object, Output extends object>() => MiddlewareStack<Input, Output>;
import { AbsoluteLocation, HandlerOptions, MiddlewareType, Priority, RelativeLocation, Step } from "@smithy/types";
export interface MiddlewareEntry<Input extends object, Output extends object> extends HandlerOptions {
middleware: MiddlewareType<Input, Output>;
}
export interface AbsoluteMiddlewareEntry<Input extends object, Output extends object> extends MiddlewareEntry<Input, Output>, AbsoluteLocation {
step: Step;
priority: Priority;
}
export interface RelativeMiddlewareEntry<Input extends object, Output extends object> extends MiddlewareEntry<Input, Output>, RelativeLocation {
}
export type Normalized<T extends MiddlewareEntry<Input, Output>, Input extends object = {}, Output extends object = {}> = T & {
after: Normalized<RelativeMiddlewareEntry<Input, Output>, Input, Output>[];
before: Normalized<RelativeMiddlewareEntry<Input, Output>, Input, Output>[];
};
export interface NormalizedRelativeEntry<Input extends object, Output extends object> extends HandlerOptions {
step: Step;
middleware: MiddlewareType<Input, Output>;
next?: NormalizedRelativeEntry<Input, Output>;
prev?: NormalizedRelativeEntry<Input, Output>;
priority: null;
}
export type NamedMiddlewareEntriesMap<Input extends object, Output extends object> = Record<string, MiddlewareEntry<Input, Output>>;
import { EndpointParameterInstructions, Logger, MetadataBearer, OptionalParameter, Pluggable, RequestHandler, StaticOperationSchema } from "@smithy/types";
import { CommandImpl } from "./command";
/**
* Higher order factory for Command builders specific to a client.
* Produces a command factory that creates Command classes with
* pre-configured endpoint params, middleware, and schema.
*
* @param common - common endpoint params.
* @param service - service shape name.
* @param name - SDK Client Name.
* @param ep - endpoint plugin provider.
*
* @internal
*/
export declare function makeBuilder<C extends {
logger?: Logger;
requestHandler: RequestHandler<any, any, any>;
}, SI extends object, SO extends MetadataBearer>(common: EndpointParameterInstructions, service: string, name: string, ep: (config: any, instructions: any) => Pluggable<any, any>): <I extends SI, O extends SO>(added: EndpointParameterInstructions, plugins: (CommandCtor: any, clientStack: any, config: any, options: any) => Pluggable<any, any>[], op: string, $: StaticOperationSchema, smithyContext?: Record<string, unknown>) => {
new (input: I): CommandImpl<I, O, C, SI, SO>;
new (...[input]: OptionalParameter<I>): CommandImpl<I, O, C, SI, SO>;
getEndpointParameterInstructions(): EndpointParameterInstructions;
};
import { $ClientProtocol, $ClientProtocolCtor, ClientProtocol, ClientProtocolCtor, Command, FetchHttpHandlerOptions, Client as IClient, MetadataBearer, MiddlewareStack, NodeHttpHandlerOptions, RequestHandler } from "@smithy/types";
/**
* @public
*/
export interface SmithyConfiguration<HandlerOptions> {
/**
* @public
*/
requestHandler: RequestHandler<any, any, HandlerOptions> | NodeHttpHandlerOptions | FetchHttpHandlerOptions | Record<string, unknown>;
/**
* Default false.
* When true, the client will only resolve the middleware stack once per
* Command class. This means modifying the middlewareStack of the
* command or client after requests have been made will not be
* recognized.
* Calling client.destroy() also clears this cache.
* Enable this only if needing the additional time saved (0-1ms per request)
* and not needing middleware modifications between requests.
*
* @public
*/
cacheMiddleware?: boolean;
/**
* A client request/response protocol or constructor of one.
* A protocol in this context is not e.g. https.
* It is the combined implementation of how to (de)serialize and create
* the messages (e.g. http requests/responses) that are being exchanged.
*
* @public
*/
protocol?: ClientProtocol<any, any> | $ClientProtocol<any, any> | ClientProtocolCtor<any, any> | $ClientProtocolCtor<any, any>;
/**
* These are automatically generated and will be passed to the
* config.protocol if given as a constructor.
* @internal
*/
protocolSettings?: {
defaultNamespace?: string;
[setting: string]: unknown;
};
/**
* The API version set internally by the SDK, and is
* not planned to be used by customer code.
* @internal
*/
readonly apiVersion: string;
}
/**
* @internal
*/
export type SmithyResolvedConfiguration<HandlerOptions> = {
requestHandler: RequestHandler<any, any, HandlerOptions>;
cacheMiddleware?: boolean;
protocol?: ClientProtocol<any, any> | $ClientProtocol<any, any>;
protocolSettings?: {
defaultNamespace?: string;
[setting: string]: unknown;
};
readonly apiVersion: string;
};
/**
* @public
*/
export declare class Client<HandlerOptions, ClientInput extends object, ClientOutput extends MetadataBearer, ResolvedClientConfiguration extends SmithyResolvedConfiguration<HandlerOptions>> implements IClient<ClientInput, ClientOutput, ResolvedClientConfiguration> {
readonly config: ResolvedClientConfiguration;
middlewareStack: MiddlewareStack<ClientInput, ClientOutput>;
/**
* Holds an object reference to the initial configuration object.
* Used to check that the config resolver stack does not create
* dangling instances of an intermediate form of the configuration object.
*
* @internal
*/
initConfig?: object;
/**
* May be used to cache the resolved handler function for a Command class.
*/
private handlers?;
constructor(config: ResolvedClientConfiguration);
send<InputType extends ClientInput, OutputType extends ClientOutput>(command: Command<ClientInput, InputType, ClientOutput, OutputType, SmithyResolvedConfiguration<HandlerOptions>>, options?: HandlerOptions): Promise<OutputType>;
send<InputType extends ClientInput, OutputType extends ClientOutput>(command: Command<ClientInput, InputType, ClientOutput, OutputType, SmithyResolvedConfiguration<HandlerOptions>>, cb: (err: any, data?: OutputType) => void): void;
send<InputType extends ClientInput, OutputType extends ClientOutput>(command: Command<ClientInput, InputType, ClientOutput, OutputType, SmithyResolvedConfiguration<HandlerOptions>>, options: HandlerOptions, cb: (err: any, data?: OutputType) => void): void;
destroy(): void;
}
import { EndpointParameterInstructions, Handler, HandlerExecutionContext, Command as ICommand, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MiddlewareStack as IMiddlewareStack, Logger, MetadataBearer, OperationSchema, OptionalParameter, Pluggable, RequestHandler, SerdeContext, StaticOperationSchema } from "@smithy/types";
/**
* @public
*/
export declare abstract class Command<Input extends ClientInput, Output extends ClientOutput, ResolvedClientConfiguration, ClientInput extends object = any, ClientOutput extends MetadataBearer = any> implements ICommand<ClientInput, Input, ClientOutput, Output, ResolvedClientConfiguration> {
abstract input: Input;
readonly middlewareStack: IMiddlewareStack<Input, Output>;
readonly schema?: OperationSchema | StaticOperationSchema;
/**
* Factory for Command ClassBuilder.
* @internal
*/
static classBuilder<I extends SI, O extends SO, C extends {
logger?: Logger;
requestHandler: RequestHandler<any, any, any>;
}, SI extends object = any, SO extends MetadataBearer = any>(): ClassBuilder<I, O, C, SI, SO>;
abstract resolveMiddleware(stack: IMiddlewareStack<ClientInput, ClientOutput>, configuration: ResolvedClientConfiguration, options: any): Handler<Input, Output>;
/**
* @internal
*/
resolveMiddlewareWithContext(clientStack: IMiddlewareStack<any, any>, configuration: {
logger?: Logger;
requestHandler: RequestHandler<any, any, any>;
}, options: any, { middlewareFn, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, smithyContext, additionalContext, CommandCtor, }: ResolveMiddlewareContextArgs): import("@smithy/types").InitializeHandler<any, Output>;
}
/**
* @internal
*/
type ResolveMiddlewareContextArgs = {
middlewareFn: (CommandCtor: any, clientStack: any, config: any, options: any) => Pluggable<any, any>[];
clientName: string;
commandName: string;
smithyContext: Record<string, unknown>;
additionalContext: HandlerExecutionContext;
inputFilterSensitiveLog: (_: any) => any;
outputFilterSensitiveLog: (_: any) => any;
CommandCtor: any;
};
/**
* @internal
*/
declare class ClassBuilder<I extends SI, O extends SO, C extends {
logger?: Logger;
requestHandler: RequestHandler<any, any, any>;
}, SI extends object = any, SO extends MetadataBearer = any> {
private _init;
private _ep;
private _middlewareFn;
private _commandName;
private _clientName;
private _additionalContext;
private _smithyContext;
private _inputFilterSensitiveLog;
private _outputFilterSensitiveLog;
private _serializer;
private _deserializer;
private _operationSchema?;
/**
* Optional init callback.
*/
init(cb: (_: Command<I, O, C, SI, SO>) => void): void;
/**
* Set the endpoint parameter instructions.
*/
ep(endpointParameterInstructions: EndpointParameterInstructions): ClassBuilder<I, O, C, SI, SO>;
/**
* Add any number of middleware.
*/
m(middlewareSupplier: (CommandCtor: any, clientStack: any, config: any, options: any) => Pluggable<any, any>[]): ClassBuilder<I, O, C, SI, SO>;
/**
* Set the initial handler execution context Smithy field.
*/
s(service: string, operation: string, smithyContext?: Record<string, unknown>): ClassBuilder<I, O, C, SI, SO>;
/**
* Set the initial handler execution context.
*/
c(additionalContext?: HandlerExecutionContext): ClassBuilder<I, O, C, SI, SO>;
/**
* Set constant string identifiers for the operation.
*/
n(clientName: string, commandName: string): ClassBuilder<I, O, C, SI, SO>;
/**
* Set the input and output sensistive log filters.
*/
f(inputFilter?: (_: any) => any, outputFilter?: (_: any) => any): ClassBuilder<I, O, C, SI, SO>;
/**
* Sets the serializer.
*/
ser(serializer: (input: I, context?: SerdeContext | any) => Promise<IHttpRequest>): ClassBuilder<I, O, C, SI, SO>;
/**
* Sets the deserializer.
*/
de(deserializer: (output: IHttpResponse, context?: SerdeContext | any) => Promise<O>): ClassBuilder<I, O, C, SI, SO>;
/**
* Sets input/output schema for the operation.
*/
sc(operation: OperationSchema | StaticOperationSchema): ClassBuilder<I, O, C, SI, SO>;
/**
* @returns a Command class with the classBuilder properties.
*/
build(): {
new (input: I): CommandImpl<I, O, C, SI, SO>;
new (...[input]: OptionalParameter<I>): CommandImpl<I, O, C, SI, SO>;
getEndpointParameterInstructions(): EndpointParameterInstructions;
};
}
/**
* A concrete implementation of ICommand with no abstract members.
* @public
*/
export interface CommandImpl<I extends SI, O extends SO, C extends {
logger?: Logger;
requestHandler: RequestHandler<any, any, any>;
}, SI extends object = any, SO extends MetadataBearer = any> extends Command<I, O, C, SI, SO> {
readonly input: I;
resolveMiddleware(stack: IMiddlewareStack<SI, SO>, configuration: C, options: any): Handler<I, O>;
}
export {};
/**
* @internal
*/
export declare const SENSITIVE_STRING = "***SensitiveInformation***";
import { Client } from "./client";
/**
* @internal
*
* @param commands - command lookup container.
* @param Client - client instance on which to add aggregated methods.
* @param options - paginator and waiter functions.
*
* @returns an aggregated client with dynamically created methods.
*/
export declare const createAggregatedClient: (commands: Record<string, any>, Client: {
new (...args: any): Client<any, any, any, any>;
}, options?: {
paginators?: Record<string, any>;
waiters?: Record<string, any>;
}) => void;
/**
* Always throws an error with the given `exceptionCtor` and other arguments.
* This is only called from an error handling code path.
*
* @internal
*/
export declare const throwDefaultError: ({ output, parsedBody, exceptionCtor, errorCode }: any) => never;
/**
* Creates {@link throwDefaultError} with bound ExceptionCtor.
*
* @internal
*/
export declare const withBaseException: (ExceptionCtor: {
new (...args: any): any;
}) => any;
/**
* @internal
*/
export declare const loadConfigsForDefaultMode: (mode: ResolvedDefaultsMode) => DefaultsModeConfigs;
/**
* Option determining how certain default configuration options are resolved in the SDK. It can be one of the value listed below:
* * `"standard"`: <p>The STANDARD mode provides the latest recommended default values that should be safe to run in most scenarios</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>
* * `"in-region"`: <p>The IN_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services from within the same AWS region</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>
* * `"cross-region"`: <p>The CROSS_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services in a different region</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>
* * `"mobile"`: <p>The MOBILE mode builds on the standard mode and includes optimization tailored for mobile applications</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>
* * `"auto"`: <p>The AUTO mode is an experimental mode that builds on the standard mode. The SDK will attempt to discover the execution environment to determine the appropriate settings automatically.</p><p>Note that the auto detection is heuristics-based and does not guarantee 100% accuracy. STANDARD mode will be used if the execution environment cannot be determined. The auto detection might query <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html">EC2 Instance Metadata service</a>, which might introduce latency. Therefore we recommend choosing an explicit defaults_mode instead if startup latency is critical to your application</p>
* * `"legacy"`: <p>The LEGACY mode provides default settings that vary per SDK and were used prior to establishment of defaults_mode</p>
*
* @defaultValue "legacy"
*/
export type DefaultsMode = "standard" | "in-region" | "cross-region" | "mobile" | "auto" | "legacy";
/**
* @internal
*/
export type ResolvedDefaultsMode = Exclude<DefaultsMode, "auto">;
/**
* @internal
*/
export interface DefaultsModeConfigs {
retryMode?: string;
connectionTimeout?: number;
requestTimeout?: number;
}
/**
* Emits warning if the provided Node.js version string is pending deprecation.
*
* @internal
* @param version - The Node.js version string.
*/
export declare const emitWarningIfUnsupportedVersion: (version: string) => void;
import { HttpResponse, MetadataBearer, ResponseMetadata, RetryableTrait, SmithyException } from "@smithy/types";
/**
* The type of the exception class constructor parameter. The returned type contains the properties
* in the `ExceptionType` but not in the `BaseExceptionType`. If the `BaseExceptionType` contains
* `$metadata` and `message` properties, it's also included in the returned type.
* @internal
*/
export type ExceptionOptionType<ExceptionType extends Error, BaseExceptionType extends Error> = Pick<ExceptionType, Exclude<keyof ExceptionType, Exclude<keyof BaseExceptionType, "$metadata" | "message">>>;
/**
* @public
*/
export interface ServiceExceptionOptions extends SmithyException, MetadataBearer {
message?: string;
}
/**
* Base exception class for the exceptions from the server-side.
*
* @public
*/
export declare class ServiceException extends Error implements SmithyException, MetadataBearer {
readonly $fault: "client" | "server";
$response?: HttpResponse;
$retryable?: RetryableTrait;
$metadata: ResponseMetadata;
constructor(options: ServiceExceptionOptions);
/**
* Checks if a value is an instance of ServiceException (duck typed)
*/
static isInstance(value: unknown): value is ServiceException;
/**
* Custom instanceof check to support the operator for ServiceException base class
*/
static [Symbol.hasInstance](instance: unknown): boolean;
}
/**
* This method inject unmodeled member to a deserialized SDK exception,
* and load the error message from different possible keys('message',
* 'Message').
*
* @internal
*/
export declare const decorateServiceException: <E extends ServiceException>(exception: E, additions?: Record<string, any>) => E;
import { AlgorithmId, ChecksumAlgorithm, ChecksumConfiguration, ChecksumConstructor, HashConstructor } from "@smithy/types";
export { AlgorithmId, ChecksumAlgorithm, ChecksumConfiguration };
/**
* @internal
*/
export type PartialChecksumRuntimeConfigType = {
checksumAlgorithms?: Record<string, ChecksumConstructor | HashConstructor>;
sha256?: ChecksumConstructor | HashConstructor;
md5?: ChecksumConstructor | HashConstructor;
crc32?: ChecksumConstructor | HashConstructor;
crc32c?: ChecksumConstructor | HashConstructor;
sha1?: ChecksumConstructor | HashConstructor;
};
/**
* @param runtimeConfig - config object of the client instance.
* @internal
*/
export declare const getChecksumConfiguration: (runtimeConfig: PartialChecksumRuntimeConfigType) => {
addChecksumAlgorithm(algo: ChecksumAlgorithm): void;
checksumAlgorithms(): ChecksumAlgorithm[];
};
/**
* @internal
*/
export declare const resolveChecksumRuntimeConfig: (clientConfig: ChecksumConfiguration) => PartialChecksumRuntimeConfigType;
import { DefaultExtensionConfiguration } from "@smithy/types";
import { PartialChecksumRuntimeConfigType } from "./checksum";
import { PartialRetryRuntimeConfigType } from "./retry";
/**
* @internal
*/
export type DefaultExtensionRuntimeConfigType = PartialRetryRuntimeConfigType & PartialChecksumRuntimeConfigType;
/**
* Helper function to resolve default extension configuration from runtime config
*
* @internal
*/
export declare const getDefaultExtensionConfiguration: (runtimeConfig: DefaultExtensionRuntimeConfigType) => {
addChecksumAlgorithm(algo: import("@smithy/types").ChecksumAlgorithm): void;
checksumAlgorithms(): import("@smithy/types").ChecksumAlgorithm[];
} & {
setRetryStrategy(retryStrategy: import("@smithy/types").Provider<import("@smithy/types").RetryStrategyV2 | import("@smithy/types").RetryStrategy>): void;
retryStrategy(): import("@smithy/types").Provider<import("@smithy/types").RetryStrategyV2 | import("@smithy/types").RetryStrategy>;
};
/**
* Helper function to resolve default extension configuration from runtime config
*
* @internal
* @deprecated use getDefaultExtensionConfiguration
*/
export declare const getDefaultClientConfiguration: (runtimeConfig: DefaultExtensionRuntimeConfigType) => {
addChecksumAlgorithm(algo: import("@smithy/types").ChecksumAlgorithm): void;
checksumAlgorithms(): import("@smithy/types").ChecksumAlgorithm[];
} & {
setRetryStrategy(retryStrategy: import("@smithy/types").Provider<import("@smithy/types").RetryStrategyV2 | import("@smithy/types").RetryStrategy>): void;
retryStrategy(): import("@smithy/types").Provider<import("@smithy/types").RetryStrategyV2 | import("@smithy/types").RetryStrategy>;
};
/**
* Helper function to resolve runtime config from default extension configuration
*
* @internal
*/
export declare const resolveDefaultRuntimeConfig: (config: DefaultExtensionConfiguration) => DefaultExtensionRuntimeConfigType;
import { Provider, RetryStrategy, RetryStrategyConfiguration, RetryStrategyV2 } from "@smithy/types";
/**
* @internal
*/
export type PartialRetryRuntimeConfigType = Partial<{
retryStrategy: Provider<RetryStrategyV2 | RetryStrategy>;
}>;
/**
* @internal
*/
export declare const getRetryConfiguration: (runtimeConfig: PartialRetryRuntimeConfigType) => {
setRetryStrategy(retryStrategy: Provider<RetryStrategyV2 | RetryStrategy>): void;
retryStrategy(): Provider<RetryStrategyV2 | RetryStrategy>;
};
/**
* @internal
*/
export declare const resolveRetryRuntimeConfig: (retryStrategyConfiguration: RetryStrategyConfiguration) => PartialRetryRuntimeConfigType;
/**
* The XML parser will set one K:V for a member that could
* return multiple entries but only has one.
*
* @internal
*/
export declare const getArrayIfSingleItem: <T>(mayBeArray: T) => T | T[];
/**
* Recursively parses object and populates value is node from
* "#text" key if it's available
*
* @internal
*/
export declare const getValueFromTextNode: (obj: any) => any;
/**
* @internal
* @returns whether the header value is serializable.
*/
export declare const isSerializableHeaderValue: (value: any) => boolean;
import { Logger } from "@smithy/types";
/**
* @internal
*/
export declare class NoOpLogger implements Logger {
trace(): void;
debug(): void;
info(): void;
warn(): void;
error(): void;
}
/**
* A set of instructions for multiple keys.
* The aim is to provide a concise yet readable way to map and filter values
* onto a target object.
*
* @example
* ```javascript
* const example: ObjectMappingInstructions = {
* lazyValue1: [, () => 1],
* lazyValue2: [, () => 2],
* lazyValue3: [, () => 3],
* lazyConditionalValue1: [() => true, () => 4],
* lazyConditionalValue2: [() => true, () => 5],
* lazyConditionalValue3: [true, () => 6],
* lazyConditionalValue4: [false, () => 44],
* lazyConditionalValue5: [() => false, () => 55],
* lazyConditionalValue6: ["", () => 66],
* simpleValue1: [, 7],
* simpleValue2: [, 8],
* simpleValue3: [, 9],
* conditionalValue1: [() => true, 10],
* conditionalValue2: [() => true, 11],
* conditionalValue3: [{}, 12],
* conditionalValue4: [false, 110],
* conditionalValue5: [() => false, 121],
* conditionalValue6: ["", 132],
* };
*
* const exampleResult: Record<string, any> = {
* lazyValue1: 1,
* lazyValue2: 2,
* lazyValue3: 3,
* lazyConditionalValue1: 4,
* lazyConditionalValue2: 5,
* lazyConditionalValue3: 6,
* simpleValue1: 7,
* simpleValue2: 8,
* simpleValue3: 9,
* conditionalValue1: 10,
* conditionalValue2: 11,
* conditionalValue3: 12,
* };
* ```
*
* @internal
*/
export type ObjectMappingInstructions = Record<string, ObjectMappingInstruction>;
/**
* A variant of the object mapping instruction for the `take` function.
* In this case, the source value is provided to the value function, turning it
* from a supplier into a mapper.
*
* @internal
*/
export type SourceMappingInstructions = Record<string, ValueMapper | SourceMappingInstruction>;
/**
* An instruction set for assigning a value to a target object.
*
* @internal
*/
export type ObjectMappingInstruction = LazyValueInstruction | ConditionalLazyValueInstruction | SimpleValueInstruction | ConditionalValueInstruction | UnfilteredValue;
/**
* non-array
*
* @internal
*/
export type UnfilteredValue = any;
/**
* @internal
*/
export type LazyValueInstruction = [
FilterStatus,
ValueSupplier
];
/**
* @internal
*/
export type ConditionalLazyValueInstruction = [
FilterStatusSupplier,
ValueSupplier
];
/**
* @internal
*/
export type SimpleValueInstruction = [
FilterStatus,
Value
];
/**
* @internal
*/
export type ConditionalValueInstruction = [
ValueFilteringFunction,
Value
];
/**
* @internal
*/
export type SourceMappingInstruction = [
(ValueFilteringFunction | FilterStatus)?,
ValueMapper?,
string?
];
/**
* Filter is considered passed if
* 1. It is a boolean true.
* 2. It is not undefined and is itself truthy.
* 3. It is undefined and the corresponding _value_ is neither null nor undefined.
*
* @internal
*/
export type FilterStatus = boolean | unknown | void;
/**
* Supplies the filter check but not against any value as input.
*
* @internal
*/
export type FilterStatusSupplier = () => boolean;
/**
* Filter check with the given value.
*
* @internal
*/
export type ValueFilteringFunction = (value: any) => boolean;
/**
* Supplies the value for lazy evaluation.
*
* @internal
*/
export type ValueSupplier = () => any;
/**
* A function that maps the source value to the target value.
* Defaults to pass-through with nullish check.
*
* @internal
*/
export type ValueMapper = (value: any) => any;
/**
* A non-function value.
*
* @internal
*/
export type Value = any;
/**
* Internal/Private, for codegen use only.
*
* Transfer a set of keys from [instructions] to [target].
*
* For each instruction in the record, the target key will be the instruction key.
* The target assignment will be conditional on the instruction's filter.
* The target assigned value will be supplied by the instructions as an evaluable function or non-function value.
*
* @see ObjectMappingInstructions for an example.
*
* @internal
*/
export declare function map(target: any, filter: (value: any) => boolean, instructions: Record<string, ValueSupplier | Value>): typeof target;
/**
* @internal
*/
export declare function map(instructions: ObjectMappingInstructions): any;
/**
* @internal
*/
export declare function map(target: any, instructions: ObjectMappingInstructions): typeof target;
/**
* Convert a regular object `{ k: v }` to `{ k: [, v] }` mapping instruction set with default
* filter.
*
* @internal
*/
export declare const convertMap: (target: any) => Record<string, any>;
/**
* @param source - original object with data.
* @param instructions - how to map the data.
* @returns new object mapped from the source object.
* @internal
*/
export declare const take: (source: any, instructions: SourceMappingInstructions) => any;
import { SchemaRef } from "@smithy/types";
/**
* Redacts sensitive parts of any data object using its schema, for logging.
*
* @internal
* @param schema - with filtering traits.
* @param data - to be logged.
*/
export declare function schemaLogFilter(schema: SchemaRef, data: unknown): any;
/**
* Serializes a number, turning non-numeric values into strings.
*
* @internal
* @param value - The number to serialize.
* @returns A number, or a string if the given number was non-numeric.
*/
export declare const serializeFloat: (value: number) => string | number;
/**
* @internal
* @param date - to be serialized.
* @returns https://smithy.io/2.0/spec/protocol-traits.html#timestampformat-trait date-time format.
*/
export declare const serializeDateTime: (date: Date) => string;
/**
* Maps an object through the default JSON serde behavior.
* This means removing nullish fields and un-sparsifying lists.
* This is also used by Smithy RPCv2 CBOR as the default serde behavior.
*
* @internal
* @param obj - to be checked.
* @returns same object with default serde behavior applied.
*/
export declare const _json: (obj: any) => any;
/**
* Helper for JSON stringification debug logging.
*
* @internal
*/
export declare const getCircularReplacer: () => (key: any, value: any) => any;
import { WaiterOptions, WaiterResult } from "./waiter";
/**
* Create a waiter promise that only resolves when:
* 1. Abort controller is signaled
* 2. Max wait time is reached
* 3. `acceptorChecks` succeeds, or fails
* Otherwise, it invokes `acceptorChecks` with exponential-backoff delay.
*
* @internal
*/
export declare const createWaiter: <Client, Input, Reason = any>(options: WaiterOptions<Client>, input: Input, acceptorChecks: (client: Client, input: Input) => Promise<WaiterResult<Reason>>) => Promise<WaiterResult<Reason>>;
import { WaiterOptions, WaiterResult } from "./waiter";
/**
* Function that runs polling as part of waiters. This will make one inital attempt and then
* subsequent attempts with an increasing delay.
*
* @param params - options passed to the waiter.
* @param client - AWS SDK Client
* @param input - client input
* @param acceptorChecks - function that checks the acceptor states on each poll.
*/
export declare const runPolling: <Client, Input, Reason = any>({ minDelay, maxDelay, maxWaitTime, abortController, client, abortSignal }: WaiterOptions<Client>, input: Input, acceptorChecks: (client: Client, input: Input) => Promise<WaiterResult<Reason>>) => Promise<WaiterResult<Reason>>;
/**
* @internal
*/
export declare const sleep: (seconds: number) => Promise<unknown>;
import { WaiterOptions } from "../waiter";
/**
* Validates that waiter options are passed correctly
*
* @internal
* @param options - a waiter configuration object
*/
export declare const validateWaiterOptions: <Client>(options: WaiterOptions<Client>) => void;
import { WaiterConfiguration } from "@smithy/types";
export { WaiterConfiguration };
/**
* @internal
*/
export declare const waiterServiceDefaults: {
minDelay: number;
maxDelay: number;
};
/**
* @internal
*/
export type WaiterOptions<Client> = WaiterConfiguration<Client> & Required<Pick<WaiterConfiguration<Client>, "minDelay" | "maxDelay">>;
/**
* @public
*/
export declare enum WaiterState {
ABORTED = "ABORTED",
FAILURE = "FAILURE",
SUCCESS = "SUCCESS",
RETRY = "RETRY",
TIMEOUT = "TIMEOUT"
}
/**
* @public
*/
export type WaiterResult<R = any> = {
state: WaiterState;
/**
* @deprecated because this was untyped as `any`, new code should use the field 'final',
* which is the same value, but typed.
*/
reason?: any;
/**
* (optional) Indicates a reason for why a waiter has reached its state.
*/
final?: R;
/**
* Responses observed by the waiter during its polling, where the value
* is the count.
*/
observedResponses?: Record<string, number>;
};
/**
* Handles and throws exceptions resulting from the waiterResult
* @internal
* @param result - WaiterResult
*/
export declare const checkExceptions: <R>(result: WaiterResult<R>) => WaiterResult<R>;
import { LoadedConfigSelectors } from "../../node-config-provider/configLoader";
/**
* @internal
*/
export declare const ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT";
/**
* @internal
*/
export declare const CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint";
/**
* @internal
*/
export declare const DEFAULT_USE_DUALSTACK_ENDPOINT = false;
/**
* Don't delete this, used by older clients.
* @deprecated replaced by nodeDualstackConfigSelectors in newer clients.
* @internal
*/
export declare const NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS: LoadedConfigSelectors<boolean>;
/**
* @internal
*/
export declare const nodeDualstackConfigSelectors: LoadedConfigSelectors<boolean | undefined>;
import { LoadedConfigSelectors } from "../../node-config-provider/configLoader";
/**
* @internal
*/
export declare const ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT";
/**
* @internal
*/
export declare const CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint";
/**
* @internal
*/
export declare const DEFAULT_USE_FIPS_ENDPOINT = false;
/**
* Don't delete this, used by older clients.
* @deprecated replaced by nodeFipsConfigSelectors in newer clients.
* @internal
*/
export declare const NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS: LoadedConfigSelectors<boolean>;
/**
* @internal
*/
export declare const nodeFipsConfigSelectors: LoadedConfigSelectors<boolean | undefined>;
import { Endpoint, Provider, UrlParser } from "@smithy/types";
import { EndpointsInputConfig, EndpointsResolvedConfig } from "./resolveEndpointsConfig";
/**
* @public
* @deprecated superseded by default endpointRuleSet generation.
*/
export interface CustomEndpointsInputConfig extends EndpointsInputConfig {
/**
* The fully qualified endpoint of the webservice.
*/
endpoint: string | Endpoint | Provider<Endpoint>;
}
/**
* @internal
* @deprecated superseded by default endpointRuleSet generation.
*/
interface PreviouslyResolved {
urlParser: UrlParser;
}
/**
* @internal
* @deprecated superseded by default endpointRuleSet generation.
*/
export interface CustomEndpointsResolvedConfig extends EndpointsResolvedConfig {
/**
* Whether the endpoint is specified by caller.
* @internal
*/
isCustomEndpoint: true;
}
/**
* @internal
*
* @deprecated superseded by default endpointRuleSet generation.
*/
export declare const resolveCustomEndpointsConfig: <T>(input: T & CustomEndpointsInputConfig & PreviouslyResolved) => T & CustomEndpointsResolvedConfig;
export {};
import { Endpoint, Provider, RegionInfoProvider, UrlParser } from "@smithy/types";
/**
* @public
* @deprecated see \@smithy/middleware-endpoint resolveEndpointConfig.
*/
export interface EndpointsInputConfig {
/**
* The fully qualified endpoint of the webservice. This is only required when using
* a custom endpoint (for example, when using a local version of S3).
*/
endpoint?: string | Endpoint | Provider<Endpoint>;
/**
* Whether TLS is enabled for requests.
*/
tls?: boolean;
/**
* Enables IPv6/IPv4 dualstack endpoint.
*/
useDualstackEndpoint?: boolean | Provider<boolean>;
}
/**
* @internal
* @deprecated see \@smithy/middleware-endpoint resolveEndpointConfig.
*/
interface PreviouslyResolved {
regionInfoProvider: RegionInfoProvider;
urlParser: UrlParser;
region: Provider<string>;
useFipsEndpoint: Provider<boolean>;
}
/**
* @internal
* @deprecated see \@smithy/middleware-endpoint resolveEndpointConfig.
*/
export interface EndpointsResolvedConfig extends Required<EndpointsInputConfig> {
/**
* Resolved value for input {@link EndpointsInputConfig.endpoint}
*/
endpoint: Provider<Endpoint>;
/**
* Whether the endpoint is specified by caller.
* @internal
*/
isCustomEndpoint?: boolean;
/**
* Resolved value for input {@link EndpointsInputConfig.useDualstackEndpoint}
*/
useDualstackEndpoint: Provider<boolean>;
}
/**
* All generated clients should migrate to Endpoints 2.0 endpointRuleSet traits.
*
* @internal
* @deprecated endpoints rulesets use \@smithy/middleware-endpoint resolveEndpointConfig.
*/
export declare const resolveEndpointsConfig: <T>(input: T & EndpointsInputConfig & PreviouslyResolved) => T & EndpointsResolvedConfig;
export {};
import { Provider, RegionInfoProvider, UrlParser } from "@smithy/types";
interface GetEndpointFromRegionOptions {
region: Provider<string>;
tls?: boolean;
regionInfoProvider: RegionInfoProvider;
urlParser: UrlParser;
useDualstackEndpoint: Provider<boolean>;
useFipsEndpoint: Provider<boolean>;
}
export declare const getEndpointFromRegion: (input: GetEndpointFromRegionOptions) => Promise<import("@smithy/types").Endpoint>;
export {};
/**
* Checks whether region can be a host component.
*
* @param region - to check.
* @param check - checking function.
*
* @internal
*/
export declare const checkRegion: (region: string, check?: (value: string, allowSubDomains?: boolean) => boolean) => void;
import { LoadedConfigSelectors, LocalConfigOptions } from "../../node-config-provider/configLoader";
/**
* @internal
*/
export declare const REGION_ENV_NAME = "AWS_REGION";
/**
* @internal
*/
export declare const REGION_INI_NAME = "region";
/**
* @internal
*/
export declare const NODE_REGION_CONFIG_OPTIONS: LoadedConfigSelectors<string>;
/**
* @internal
*/
export declare const NODE_REGION_CONFIG_FILE_OPTIONS: LocalConfigOptions;
/**
* Returns the region of the host from the EC2 Instance Metadata Service (IMDSv2),
* or undefined if unavailable.
*
* @internal
*/
export declare const getInstanceMetadataRegion: () => Promise<string | undefined>;
/**
* @internal
*/
export declare const getRealRegion: (region: string) => string;
/**
* @internal
*/
export declare const isFipsRegion: (region: string) => boolean;
import { Provider } from "@smithy/types";
/**
* @public
*/
export interface RegionInputConfig {
/**
* The AWS region to which this client will send requests
*/
region?: string | Provider<string>;
/**
* Enables FIPS compatible endpoints.
*/
useFipsEndpoint?: boolean | Provider<boolean>;
}
interface PreviouslyResolved {
}
/**
* @internal
*/
export interface RegionResolvedConfig {
/**
* Resolved value for input config {@link RegionInputConfig.region}
*/
region: Provider<string>;
/**
* Resolved value for input {@link RegionInputConfig.useFipsEndpoint}
*/
useFipsEndpoint: Provider<boolean>;
}
/**
* @internal
*/
export declare const resolveRegionConfig: <T>(input: T & RegionInputConfig & PreviouslyResolved) => T & RegionResolvedConfig;
export {};
import { EndpointVariantTag } from "./EndpointVariantTag";
/**
* Provides hostname information for specific host label.
*
* @internal
* @deprecated unused as of endpointsRuleSets.
*/
export type EndpointVariant = {
hostname: string;
tags: EndpointVariantTag[];
};
/**
*
*
* The tag which mentions which area variant is providing information for.
* Can be either "fips" or "dualstack".
*
* @internal
* @deprecated unused for endpointRuleSets.
*/
export type EndpointVariantTag = "fips" | "dualstack";
import { EndpointVariant } from "./EndpointVariant";
/**
* @internal
* @deprecated unused as of endpointsRuleSets.
*/
export interface GetHostnameFromVariantsOptions {
useFipsEndpoint: boolean;
useDualstackEndpoint: boolean;
}
/**
* @internal
* @deprecated unused as of endpointsRuleSets.
*/
export declare const getHostnameFromVariants: (variants: EndpointVariant[] | undefined, { useFipsEndpoint, useDualstackEndpoint }: GetHostnameFromVariantsOptions) => string | undefined;
import { RegionInfo } from "@smithy/types";
import { PartitionHash } from "./PartitionHash";
import { RegionHash } from "./RegionHash";
/**
* @internal
* @deprecated unused as of endpointsRuleSets.
*/
export interface GetRegionInfoOptions {
useFipsEndpoint?: boolean;
useDualstackEndpoint?: boolean;
signingService: string;
regionHash: RegionHash;
partitionHash: PartitionHash;
}
/**
* @internal
* @deprecated unused as of endpointsRuleSets.
*/
export declare const getRegionInfo: (region: string, { useFipsEndpoint, useDualstackEndpoint, signingService, regionHash, partitionHash, }: GetRegionInfoOptions) => RegionInfo;
/**
* @internal
* @deprecated unused for endpointRuleSets.
*/
export interface GetResolvedHostnameOptions {
regionHostname?: string;
partitionHostname?: string;
}
/**
* @internal
* @deprecated unused for endpointRuleSets.
*/
export declare const getResolvedHostname: (resolvedRegion: string, { regionHostname, partitionHostname }: GetResolvedHostnameOptions) => string | undefined;
import { PartitionHash } from "./PartitionHash";
/**
* @internal
* @deprecated unused for endpointRuleSets.
*/
export interface GetResolvedPartitionOptions {
partitionHash: PartitionHash;
}
/**
* @internal
* @deprecated unused for endpointRuleSets.
*/
export declare const getResolvedPartition: (region: string, { partitionHash }: GetResolvedPartitionOptions) => string;
/**
* @internal
* @deprecated unused for endpointRuleSets.
*/
export interface GetResolvedSigningRegionOptions {
regionRegex: string;
signingRegion?: string;
useFipsEndpoint: boolean;
}
/**
* @internal
* @deprecated unused for endpointRuleSets.
*/
export declare const getResolvedSigningRegion: (hostname: string, { signingRegion, regionRegex, useFipsEndpoint }: GetResolvedSigningRegionOptions) => string | undefined;
import { EndpointVariant } from "./EndpointVariant";
/**
* The hash of partition with the information specific to that partition.
* The information includes the list of regions belonging to that partition,
* and the hostname to be used for the partition.
*
* @internal
* @deprecated unused for endpointRuleSets.
*/
export type PartitionHash = Record<string, {
regions: string[];
regionRegex: string;
variants: EndpointVariant[];
endpoint?: string;
}>;
import { EndpointVariant } from "./EndpointVariant";
/**
* The hash of region with the information specific to that region.
* The information can include hostname, signingService and signingRegion.
*
* @internal
* @deprecated unused for endpointRuleSets.
*/
export type RegionHash = Record<string, {
variants: EndpointVariant[];
signingService?: string;
signingRegion?: string;
}>;
/**
* @internal
*/
export declare const AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV";
/**
* @internal
*/
export declare const AWS_REGION_ENV = "AWS_REGION";
/**
* @internal
*/
export declare const AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION";
/**
* @internal
*/
export declare const ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED";
/**
* @internal
*/
export declare const DEFAULTS_MODE_OPTIONS: string[];
/**
* @internal
*/
export declare const IMDS_REGION_PATH = "/latest/meta-data/placement/region";
/**
* @internal
*/
export declare const IMDS_TOKEN_PATH = "/latest/api/token";
/**
* @internal
*/
export declare const X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token";
/**
* @internal
*/
export declare const X_AWS_EC2_METADATA_TOKEN_TTL = "x-aws-ec2-metadata-token-ttl-seconds";
import { DefaultsMode } from "@smithy/core/client";
import { LoadedConfigSelectors } from "../node-config-provider/configLoader";
/**
* @internal
*/
export declare const NODE_DEFAULTS_MODE_CONFIG_OPTIONS: LoadedConfigSelectors<DefaultsMode>;
import { DefaultsMode, ResolvedDefaultsMode } from "@smithy/core/client";
import { Provider } from "@smithy/types";
/**
* @internal
*/
export interface ResolveDefaultsModeConfigOptions {
defaultsMode?: DefaultsMode | Provider<DefaultsMode>;
}
/**
* Validate the defaultsMode configuration. If the value is set to "auto", it
* resolves the value to "mobile" if the app is running in a mobile browser,
* otherwise it resolves to "standard".
*
* @default "legacy"
* @internal
*/
export declare const resolveDefaultsModeConfig: ({ defaultsMode, }?: ResolveDefaultsModeConfigOptions) => Provider<ResolvedDefaultsMode>;
import { DefaultsMode, ResolvedDefaultsMode } from "@smithy/core/client";
import { Provider } from "@smithy/types";
/**
* @internal
*/
export interface ResolveDefaultsModeConfigOptions {
defaultsMode?: DefaultsMode | Provider<DefaultsMode>;
region?: string | Provider<string>;
}
/**
* Validate the defaultsMode configuration. If the value is set to "auto", it
* resolves the value to "in-region", "cross-region", or "standard".
*
* @default "legacy"
* @internal
*/
export declare const resolveDefaultsModeConfig: ({ region, defaultsMode, }?: ResolveDefaultsModeConfigOptions) => Provider<ResolvedDefaultsMode>;
import { DefaultsMode, ResolvedDefaultsMode } from "@smithy/core/client";
import { Provider } from "@smithy/types";
/**
* @internal
*/
export interface ResolveDefaultsModeConfigOptions {
defaultsMode?: DefaultsMode | Provider<DefaultsMode>;
}
/**
* Validate the defaultsMode configuration. If the value is set to "auto", it
* resolves the value to "mobile".
*
* @default "legacy"
* @internal
*/
export declare const resolveDefaultsModeConfig: ({ defaultsMode, }?: ResolveDefaultsModeConfigOptions) => Provider<ResolvedDefaultsMode>;
export { ProviderError, ProviderErrorOptionsType } from "./property-provider/ProviderError";
export { CredentialsProviderError } from "./property-provider/CredentialsProviderError";
export { TokenProviderError } from "./property-provider/TokenProviderError";
export { chain } from "./property-provider/chain";
export { fromValue } from "./property-provider/fromValue";
export { memoize } from "./property-provider/memoize";
export { booleanSelector } from "./util-config-provider/booleanSelector";
export { numberSelector } from "./util-config-provider/numberSelector";
export { SelectorType } from "./util-config-provider/types";
export declare const getHomeDir: symbol;
export declare const ENV_PROFILE: symbol;
export declare const DEFAULT_PROFILE = "default";
export declare const getProfileName: symbol;
export declare const getSSOTokenFilepath: symbol;
export declare const getSSOTokenFromFile: symbol;
export declare const CONFIG_PREFIX_SEPARATOR: symbol;
export declare const loadSharedConfigFiles: symbol;
export declare const loadSsoSessionData: symbol;
export declare const parseKnownFiles: symbol;
export declare const externalDataInterceptor: symbol;
export declare const readFile: symbol;
export { SSOToken } from "./shared-ini-file-loader/getSSOTokenFromFile";
export { SharedConfigInit } from "./shared-ini-file-loader/loadSharedConfigFiles";
export { SsoSessionInit } from "./shared-ini-file-loader/loadSsoSessionData";
export { SourceProfileInit } from "./shared-ini-file-loader/parseKnownFiles";
export { Profile, ParsedIniData, SharedConfigFiles } from "./shared-ini-file-loader/types";
export { ReadFileOptions } from "./shared-ini-file-loader/readFile";
export declare const loadConfig: symbol;
export declare const fromStatic: symbol;
export { LocalConfigOptions, LoadedConfigSelectors } from "./node-config-provider/configLoader";
export { EnvOptions, GetterFromEnv } from "./node-config-provider/fromEnv";
export { NodeSharedConfigInit, GetterFromConfig } from "./node-config-provider/fromSharedConfigFiles";
export declare const ENV_USE_DUALSTACK_ENDPOINT: symbol;
export declare const CONFIG_USE_DUALSTACK_ENDPOINT: symbol;
export declare const DEFAULT_USE_DUALSTACK_ENDPOINT = false;
export declare const NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS: symbol;
export declare const nodeDualstackConfigSelectors: symbol;
export declare const ENV_USE_FIPS_ENDPOINT: symbol;
export declare const CONFIG_USE_FIPS_ENDPOINT: symbol;
export declare const DEFAULT_USE_FIPS_ENDPOINT = false;
export declare const NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS: symbol;
export declare const nodeFipsConfigSelectors: symbol;
export { resolveCustomEndpointsConfig, CustomEndpointsInputConfig, CustomEndpointsResolvedConfig } from "./config-resolver/endpointsConfig/resolveCustomEndpointsConfig";
export { resolveEndpointsConfig, EndpointsInputConfig, EndpointsResolvedConfig } from "./config-resolver/endpointsConfig/resolveEndpointsConfig";
export declare const REGION_ENV_NAME: symbol;
export declare const REGION_INI_NAME: symbol;
export declare const NODE_REGION_CONFIG_OPTIONS: symbol;
export declare const NODE_REGION_CONFIG_FILE_OPTIONS: symbol;
export { resolveRegionConfig, RegionInputConfig, RegionResolvedConfig } from "./config-resolver/regionConfig/resolveRegionConfig";
export { PartitionHash } from "./config-resolver/regionInfo/PartitionHash";
export { RegionHash } from "./config-resolver/regionInfo/RegionHash";
export { EndpointVariant } from "./config-resolver/regionInfo/EndpointVariant";
export { EndpointVariantTag } from "./config-resolver/regionInfo/EndpointVariantTag";
export { getRegionInfo, GetRegionInfoOptions } from "./config-resolver/regionInfo/getRegionInfo";
export { resolveDefaultsModeConfig, ResolveDefaultsModeConfigOptions } from "./defaults-mode/resolveDefaultsModeConfig.browser";
export { ProviderError, ProviderErrorOptionsType } from "./property-provider/ProviderError";
export { CredentialsProviderError } from "./property-provider/CredentialsProviderError";
export { TokenProviderError } from "./property-provider/TokenProviderError";
export { chain } from "./property-provider/chain";
export { fromValue } from "./property-provider/fromValue";
export { memoize } from "./property-provider/memoize";
export { booleanSelector } from "./util-config-provider/booleanSelector";
export { numberSelector } from "./util-config-provider/numberSelector";
export { SelectorType } from "./util-config-provider/types";
export { getHomeDir } from "./shared-ini-file-loader/getHomeDir";
export { ENV_PROFILE, DEFAULT_PROFILE, getProfileName } from "./shared-ini-file-loader/getProfileName";
export { getSSOTokenFilepath } from "./shared-ini-file-loader/getSSOTokenFilepath";
export { getSSOTokenFromFile, SSOToken } from "./shared-ini-file-loader/getSSOTokenFromFile";
export { CONFIG_PREFIX_SEPARATOR } from "./shared-ini-file-loader/constants";
export { loadSharedConfigFiles, SharedConfigInit } from "./shared-ini-file-loader/loadSharedConfigFiles";
export { loadSsoSessionData, SsoSessionInit } from "./shared-ini-file-loader/loadSsoSessionData";
export { parseKnownFiles, SourceProfileInit } from "./shared-ini-file-loader/parseKnownFiles";
export { externalDataInterceptor } from "./shared-ini-file-loader/externalDataInterceptor";
export { Profile, ParsedIniData, SharedConfigFiles } from "./shared-ini-file-loader/types";
export { readFile, ReadFileOptions } from "./shared-ini-file-loader/readFile";
export { loadConfig, LocalConfigOptions, LoadedConfigSelectors } from "./node-config-provider/configLoader";
export { EnvOptions, GetterFromEnv } from "./node-config-provider/fromEnv";
export { fromStatic } from "./node-config-provider/fromStatic";
export { NodeSharedConfigInit, GetterFromConfig } from "./node-config-provider/fromSharedConfigFiles";
export { ENV_USE_DUALSTACK_ENDPOINT, CONFIG_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_DUALSTACK_ENDPOINT, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, nodeDualstackConfigSelectors, } from "./config-resolver/endpointsConfig/NodeUseDualstackEndpointConfigOptions";
export { ENV_USE_FIPS_ENDPOINT, CONFIG_USE_FIPS_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, nodeFipsConfigSelectors, } from "./config-resolver/endpointsConfig/NodeUseFipsEndpointConfigOptions";
export { resolveCustomEndpointsConfig, CustomEndpointsInputConfig, CustomEndpointsResolvedConfig } from "./config-resolver/endpointsConfig/resolveCustomEndpointsConfig";
export { resolveEndpointsConfig, EndpointsInputConfig, EndpointsResolvedConfig } from "./config-resolver/endpointsConfig/resolveEndpointsConfig";
export { REGION_ENV_NAME, REGION_INI_NAME, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS, } from "./config-resolver/regionConfig/config";
export { resolveRegionConfig, RegionInputConfig, RegionResolvedConfig } from "./config-resolver/regionConfig/resolveRegionConfig";
export { PartitionHash } from "./config-resolver/regionInfo/PartitionHash";
export { RegionHash } from "./config-resolver/regionInfo/RegionHash";
export { EndpointVariant } from "./config-resolver/regionInfo/EndpointVariant";
export { EndpointVariantTag } from "./config-resolver/regionInfo/EndpointVariantTag";
export { getRegionInfo, GetRegionInfoOptions } from "./config-resolver/regionInfo/getRegionInfo";
export { resolveDefaultsModeConfig, ResolveDefaultsModeConfigOptions } from "./defaults-mode/resolveDefaultsModeConfig";
export { ProviderError, ProviderErrorOptionsType } from "./property-provider/ProviderError";
export { CredentialsProviderError } from "./property-provider/CredentialsProviderError";
export { TokenProviderError } from "./property-provider/TokenProviderError";
export { chain } from "./property-provider/chain";
export { fromValue } from "./property-provider/fromValue";
export { memoize } from "./property-provider/memoize";
export { booleanSelector } from "./util-config-provider/booleanSelector";
export { numberSelector } from "./util-config-provider/numberSelector";
export { SelectorType } from "./util-config-provider/types";
export declare const getHomeDir: symbol;
export declare const ENV_PROFILE: symbol;
export declare const DEFAULT_PROFILE = "default";
export declare const getProfileName: symbol;
export declare const getSSOTokenFilepath: symbol;
export declare const getSSOTokenFromFile: symbol;
export declare const CONFIG_PREFIX_SEPARATOR: symbol;
export declare const loadSharedConfigFiles: symbol;
export declare const loadSsoSessionData: symbol;
export declare const parseKnownFiles: symbol;
export declare const externalDataInterceptor: symbol;
export declare const readFile: symbol;
export { SSOToken } from "./shared-ini-file-loader/getSSOTokenFromFile";
export { SharedConfigInit } from "./shared-ini-file-loader/loadSharedConfigFiles";
export { SsoSessionInit } from "./shared-ini-file-loader/loadSsoSessionData";
export { SourceProfileInit } from "./shared-ini-file-loader/parseKnownFiles";
export { Profile, ParsedIniData, SharedConfigFiles } from "./shared-ini-file-loader/types";
export { ReadFileOptions } from "./shared-ini-file-loader/readFile";
export declare const loadConfig: symbol;
export declare const fromStatic: symbol;
export { LocalConfigOptions, LoadedConfigSelectors } from "./node-config-provider/configLoader";
export { EnvOptions, GetterFromEnv } from "./node-config-provider/fromEnv";
export { NodeSharedConfigInit, GetterFromConfig } from "./node-config-provider/fromSharedConfigFiles";
export declare const ENV_USE_DUALSTACK_ENDPOINT: symbol;
export declare const CONFIG_USE_DUALSTACK_ENDPOINT: symbol;
export declare const DEFAULT_USE_DUALSTACK_ENDPOINT = false;
export declare const NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS: symbol;
export declare const nodeDualstackConfigSelectors: symbol;
export declare const ENV_USE_FIPS_ENDPOINT: symbol;
export declare const CONFIG_USE_FIPS_ENDPOINT: symbol;
export declare const DEFAULT_USE_FIPS_ENDPOINT = false;
export declare const NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS: symbol;
export declare const nodeFipsConfigSelectors: symbol;
export { resolveCustomEndpointsConfig, CustomEndpointsInputConfig, CustomEndpointsResolvedConfig } from "./config-resolver/endpointsConfig/resolveCustomEndpointsConfig";
export { resolveEndpointsConfig, EndpointsInputConfig, EndpointsResolvedConfig } from "./config-resolver/endpointsConfig/resolveEndpointsConfig";
export declare const REGION_ENV_NAME: symbol;
export declare const REGION_INI_NAME: symbol;
export declare const NODE_REGION_CONFIG_OPTIONS: symbol;
export declare const NODE_REGION_CONFIG_FILE_OPTIONS: symbol;
export { resolveRegionConfig, RegionInputConfig, RegionResolvedConfig } from "./config-resolver/regionConfig/resolveRegionConfig";
export { PartitionHash } from "./config-resolver/regionInfo/PartitionHash";
export { RegionHash } from "./config-resolver/regionInfo/RegionHash";
export { EndpointVariant } from "./config-resolver/regionInfo/EndpointVariant";
export { EndpointVariantTag } from "./config-resolver/regionInfo/EndpointVariantTag";
export { getRegionInfo, GetRegionInfoOptions } from "./config-resolver/regionInfo/getRegionInfo";
export { resolveDefaultsModeConfig, ResolveDefaultsModeConfigOptions } from "./defaults-mode/resolveDefaultsModeConfig.native";
import { Provider } from "@smithy/types";
import { EnvOptions, GetterFromEnv } from "./fromEnv";
import { GetterFromConfig, NodeSharedConfigInit } from "./fromSharedConfigFiles";
import { FromStaticConfig } from "./fromStatic";
/**
* @internal
*/
export type LocalConfigOptions = NodeSharedConfigInit & EnvOptions;
/**
* @internal
*/
export interface LoadedConfigSelectors<T> {
/**
* A getter function getting the config values from all the environment
* variables.
*/
environmentVariableSelector: GetterFromEnv<T>;
/**
* A getter function getting config values associated with the inferred
* profile from shared INI files
*/
configFileSelector: GetterFromConfig<T>;
/**
* Default value or getter
*/
default: FromStaticConfig<T>;
}
/**
* @internal
*/
export declare const loadConfig: <T = string>({ environmentVariableSelector, configFileSelector, default: defaultValue }: LoadedConfigSelectors<T>, configuration?: LocalConfigOptions) => Provider<T>;
import { Logger, Provider } from "@smithy/types";
/**
* @internal
*/
export interface EnvOptions {
/**
* The SigV4 service signing name.
*/
signingName?: string;
/**
* For credential resolution trace logging.
*/
logger?: Logger;
}
export type GetterFromEnv<T> = (env: Record<string, string | undefined>, options?: EnvOptions) => T | undefined;
/**
* Get config value given the environment variable name or getter from
* environment variable.
*/
export declare const fromEnv: <T = string>(envVarSelector: GetterFromEnv<T>, options?: EnvOptions) => Provider<T>;
import { ParsedIniData, Profile, Provider } from "@smithy/types";
import { SourceProfileInit } from "../shared-ini-file-loader/parseKnownFiles";
/**
* @internal
*/
export interface NodeSharedConfigInit extends SourceProfileInit {
/**
* The preferred shared ini file to load the config. "config" option refers to
* the shared config file(defaults to `~/.aws/config`). "credentials" option
* refers to the shared credentials file(defaults to `~/.aws/credentials`)
*/
preferredFile?: "config" | "credentials";
}
/**
* @internal
*/
export type GetterFromConfig<T> = (profile: Profile, configFile?: ParsedIniData) => T | undefined;
/**
* Get config value from the shared config files with inferred profile name.
* @internal
*/
export declare const fromSharedConfigFiles: <T = string>(configSelector: GetterFromConfig<T>, { preferredFile, ...init }?: NodeSharedConfigInit) => Provider<T>;
import { Provider } from "@smithy/types";
/**
* @internal
*/
export type FromStaticConfig<T> = T | (() => T) | Provider<T>;
/**
* @internal
*/
export declare const fromStatic: <T>(defaultValue: FromStaticConfig<T>) => Provider<T>;
/**
* Attempts to extract the name of the variable that the functional selector is looking for.
* Improves readability over the raw Function.toString() value.
* @internal
* @param functionString - function's string representation.
*
* @returns constant value used within the function.
*/
export declare function getSelectorName(functionString: string): string;
import { Provider } from "@smithy/types";
/**
* Compose a single credential provider function from multiple credential
* providers. The first provider in the argument list will always be invoked;
* subsequent providers in the list will be invoked in the order in which the
* were received if the preceding provider did not successfully resolve.
* If no providers were received or no provider resolves successfully, the
* returned promise will be rejected.
*
* @internal
*/
export declare const chain: <T>(...providers: Array<Provider<T>>) => Provider<T>;
import { ProviderError, ProviderErrorOptionsType } from "./ProviderError";
/**
* An error representing a failure of an individual credential provider.
* This error class has special meaning to the {@link chain} method. If a
* provider in the chain is rejected with an error, the chain will only proceed
* to the next provider if the value of the `tryNextLink` property on the error
* is truthy. This allows individual providers to halt the chain and also
* ensures the chain will stop if an entirely unexpected error is encountered.
*
* @public
*/
export declare class CredentialsProviderError extends ProviderError {
name: string;
/**
* @override
* @deprecated constructor should be given a logger.
*/
constructor(message: string);
/**
* @override
* @deprecated constructor should be given a logger.
*/
constructor(message: string, tryNextLink: boolean | undefined);
/**
* @override
* This signature is preferred for logging capability.
*/
constructor(message: string, options: ProviderErrorOptionsType);
}
import { Provider } from "@smithy/types";
/**
* @internal
*/
export declare const fromValue: <T>(staticValue: T) => Provider<T>;
import { MemoizedProvider, Provider } from "@smithy/types";
interface MemoizeOverload {
/**
*
* Decorates a provider function with either static memoization.
*
* To create a statically memoized provider, supply a provider as the only
* argument to this function. The provider will be invoked once, and all
* invocations of the provider returned by `memoize` will return the same
* promise object.
*
* @param provider The provider whose result should be cached indefinitely.
*/
<T>(provider: Provider<T>): MemoizedProvider<T>;
/**
* Decorates a provider function with refreshing memoization.
*
* @param provider The provider whose result should be cached.
* @param isExpired A function that will evaluate the resolved value and
* determine if it is expired. For example, when
* memoizing AWS credential providers, this function
* should return `true` when the credential's
* expiration is in the past (or very near future) and
* `false` otherwise.
* @param requiresRefresh A function that will evaluate the resolved value and
* determine if it represents static value or one that
* will eventually need to be refreshed. For example,
* AWS credentials that have no defined expiration will
* never need to be refreshed, so this function would
* return `true` if the credentials resolved by the
* underlying provider had an expiration and `false`
* otherwise.
*/
<T>(provider: Provider<T>, isExpired: (resolved: T) => boolean, requiresRefresh?: (resolved: T) => boolean): MemoizedProvider<T>;
}
/**
* @internal
*/
export declare const memoize: MemoizeOverload;
export {};
import { Logger } from "@smithy/types";
/**
* @public
*/
export type ProviderErrorOptionsType = {
tryNextLink?: boolean | undefined;
logger?: Logger;
};
/**
* An error representing a failure of an individual provider.
* This error class has special meaning to the {@link chain} method. If a
* provider in the chain is rejected with an error, the chain will only proceed
* to the next provider if the value of the `tryNextLink` property on the error
* is truthy. This allows individual providers to halt the chain and also
* ensures the chain will stop if an entirely unexpected error is encountered.
*
* @public
*/
export declare class ProviderError extends Error {
name: string;
readonly tryNextLink: boolean;
/**
* @deprecated constructor should be given a logger.
*/
constructor(message: string);
/**
* @deprecated constructor should be given a logger.
*/
constructor(message: string, tryNextLink: boolean | undefined);
/**
* This signature is preferred for logging capability.
*/
constructor(message: string, options: ProviderErrorOptionsType);
/**
* @deprecated use new operator.
*/
static from(error: Error, options?: boolean | ProviderErrorOptionsType): ProviderError;
}
import { ProviderError, ProviderErrorOptionsType } from "./ProviderError";
/**
* An error representing a failure of an individual token provider.
* This error class has special meaning to the {@link chain} method. If a
* provider in the chain is rejected with an error, the chain will only proceed
* to the next provider if the value of the `tryNextLink` property on the error
* is truthy. This allows individual providers to halt the chain and also
* ensures the chain will stop if an entirely unexpected error is encountered.
*
* @public
*/
export declare class TokenProviderError extends ProviderError {
name: string;
/**
* @override
* @deprecated constructor should be given a logger.
*/
constructor(message: string);
/**
* @override
* @deprecated constructor should be given a logger.
*/
constructor(message: string, tryNextLink: boolean | undefined);
/**
* @override
* This signature is preferred for logging capability.
*/
constructor(message: string, options: ProviderErrorOptionsType);
}
/**
* @internal
*/
export declare const CONFIG_PREFIX_SEPARATOR = ".";
/**
* @internal
*/
export declare const externalDataInterceptor: {
getFileRecord(): Record<string, Promise<string>>;
interceptFile(path: string, contents: string): void;
getTokenRecord(): Record<string, any>;
interceptToken(id: string, contents: any): void;
};
import { ParsedIniData } from "@smithy/types";
/**
* Returns the config data from parsed ini data.
* * Returns data for `default`
* * Returns profile name without prefix.
* * Returns non-profiles as is.
*/
export declare const getConfigData: (data: ParsedIniData) => ParsedIniData;
export declare const ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
export declare const getConfigFilepath: () => string;
export declare const ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
export declare const getCredentialsFilepath: () => string;
/**
* Get the HOME directory for the current runtime.
*
* @internal
*/
export declare const getHomeDir: () => string;
/**
* @internal
*/
export declare const ENV_PROFILE = "AWS_PROFILE";
/**
* @internal
*/
export declare const DEFAULT_PROFILE = "default";
/**
* Returns profile with priority order code - ENV - default.
* @internal
*/
export declare const getProfileName: (init: {
profile?: string;
}) => string;
import { ParsedIniData } from "@smithy/types";
/**
* Returns the sso-session data from parsed ini data by reading
* ssoSessionName after sso-session prefix including/excluding quotes
*/
export declare const getSsoSessionData: (data: ParsedIniData) => ParsedIniData;
/**
* Returns the filepath of the file where SSO token is stored.
* @internal
*/
export declare const getSSOTokenFilepath: (id: string) => string;
/**
* Cached SSO token retrieved from SSO login flow.
* @public
*/
export interface SSOToken {
/**
* A base64 encoded string returned by the sso-oidc service.
*/
accessToken: string;
/**
* The expiration time of the accessToken as an RFC 3339 formatted timestamp.
*/
expiresAt: string;
/**
* The token used to obtain an access token in the event that the accessToken is invalid or expired.
*/
refreshToken?: string;
/**
* The unique identifier string for each client. The client ID generated when performing the registration
* portion of the OIDC authorization flow. This is used to refresh the accessToken.
*/
clientId?: string;
/**
* A secret string generated when performing the registration portion of the OIDC authorization flow.
* This is used to refresh the accessToken.
*/
clientSecret?: string;
/**
* The expiration time of the client registration (clientId and clientSecret) as an RFC 3339 formatted timestamp.
*/
registrationExpiresAt?: string;
/**
* The configured sso_region for the profile that credentials are being resolved for.
*/
region?: string;
/**
* The configured sso_start_url for the profile that credentials are being resolved for.
*/
startUrl?: string;
}
/**
* For testing only.
* @internal
* @deprecated minimize use in application code.
*/
export declare const tokenIntercept: Record<string, any>;
/**
* Returns the SSO token from the file system.
*
* @internal
* @param id - can be either a start URL or the SSO session name.
*/
export declare const getSSOTokenFromFile: (id: string) => Promise<any>;
import { Logger, SharedConfigFiles } from "@smithy/types";
/**
* @public
*/
export interface SharedConfigInit {
/**
* The path at which to locate the ini credentials file. Defaults to the
* value of the `AWS_SHARED_CREDENTIALS_FILE` environment variable (if
* defined) or `~/.aws/credentials` otherwise.
*/
filepath?: string;
/**
* The path at which to locate the ini config file. Defaults to the value of
* the `AWS_CONFIG_FILE` environment variable (if defined) or
* `~/.aws/config` otherwise.
*/
configFilepath?: string;
/**
* Configuration files are normally cached after the first time they are loaded. When this
* property is set, the provider will always reload any configuration files loaded before.
*/
ignoreCache?: boolean;
/**
* For credential resolution trace logging.
*/
logger?: Logger;
}
export { CONFIG_PREFIX_SEPARATOR } from "./constants";
/**
* Loads the config and credentials files.
* @internal
*/
export declare const loadSharedConfigFiles: (init?: SharedConfigInit) => Promise<SharedConfigFiles>;
import { ParsedIniData } from "@smithy/types";
/**
* Subset of {@link SharedConfigInit}.
* @internal
*/
export interface SsoSessionInit {
/**
* The path at which to locate the ini config file. Defaults to the value of
* the `AWS_CONFIG_FILE` environment variable (if defined) or
* `~/.aws/config` otherwise.
*/
configFilepath?: string;
}
/**
* @internal
*/
export declare const loadSsoSessionData: (init?: SsoSessionInit) => Promise<ParsedIniData>;
import { ParsedIniData } from "@smithy/types";
/**
* Merge multiple profile config files such that settings each file are kept together
*
* @internal
*/
export declare const mergeConfigFiles: (...files: ParsedIniData[]) => ParsedIniData;
import { ParsedIniData } from "@smithy/types";
export declare const parseIni: (iniData: string) => ParsedIniData;
import { ParsedIniData } from "@smithy/types";
import { SharedConfigInit } from "./loadSharedConfigFiles";
/**
* @public
*/
export interface SourceProfileInit extends SharedConfigInit {
/**
* The configuration profile to use.
*/
profile?: string;
}
/**
* Load profiles from credentials and config INI files and normalize them into a
* single profile list.
*
* @internal
*/
export declare const parseKnownFiles: (init: SourceProfileInit) => Promise<ParsedIniData>;
/**
* Runtime file cache.
* @internal
*/
export declare const filePromises: Record<string, Promise<string>>;
/**
* For testing only.
* @internal
* @deprecated minimize use in application code.
*/
export declare const fileIntercept: Record<string, Promise<string>>;
/**
* @internal
*/
export interface ReadFileOptions {
ignoreCache?: boolean;
}
/**
* @internal
*/
export declare const readFile: (path: string, options?: ReadFileOptions) => Promise<string>;
import { ParsedIniData as __ParsedIniData, Profile as __Profile, SharedConfigFiles as __SharedConfigFiles } from "@smithy/types";
/**
* @internal
* @deprecated Use Profile from "\@smithy/types" instead
*/
export type Profile = __Profile;
/**
* @internal
* @deprecated Use ParsedIniData from "\@smithy/types" instead
*/
export type ParsedIniData = __ParsedIniData;
/**
* @internal
* @deprecated Use SharedConfigFiles from "\@smithy/types" instead
*/
export type SharedConfigFiles = __SharedConfigFiles;
import { SelectorType } from "./types";
/**
* Returns boolean value true/false for string value "true"/"false",
* if the string is defined in obj[key]
* Returns undefined, if obj[key] is not defined.
* Throws error for all other cases.
*
* @internal
*/
export declare const booleanSelector: (obj: Record<string, string | undefined>, key: string, type: SelectorType) => boolean | undefined;
import { SelectorType } from "./types";
/**
* Returns number value for string value, if the string is defined in obj[key].
* Returns undefined, if obj[key] is not defined.
* Throws error for all other cases.
*
* @internal
*/
export declare const numberSelector: (obj: Record<string, string | undefined>, key: string, type: SelectorType) => number | undefined;
export declare enum SelectorType {
ENV = "env",
CONFIG = "shared config entry"
}
export { toEndpointV1 } from "@smithy/core/transport";
export { BinaryDecisionDiagram } from "./util-endpoints/bdd/BinaryDecisionDiagram";
export { EndpointCache } from "./util-endpoints/cache/EndpointCache";
export { decideEndpoint } from "./util-endpoints/decideEndpoint";
export { isIpAddress } from "./util-endpoints/lib/isIpAddress";
export { isValidHostLabel } from "@smithy/core/transport";
export { customEndpointFunctions } from "./util-endpoints/utils/customEndpointFunctions";
export { resolveEndpoint } from "./util-endpoints/resolveEndpoint";
export { EndpointError } from "./util-endpoints/types";
export { ConditionObject, DeprecatedObject, EndpointFunctions, EndpointObject, EndpointObjectHeaders, EndpointObjectProperties, EndpointParams, EndpointResolverOptions, EndpointRuleObject, ErrorRuleObject, EvaluateOptions, Expression, FunctionArgv, FunctionObject, FunctionReturn, ParameterObject, ReferenceObject, ReferenceRecord, RuleSetObject, RuleSetRules, TreeRuleObject, } from "./util-endpoints/types";
export declare const getEndpointFromInstructions: <T extends import("@smithy/types").EndpointParameters, CommandInput extends object, Config extends object>(commandInput: CommandInput, instructionsSupplier: import("./middleware-endpoint/adaptors/getEndpointFromInstructions").EndpointParameterInstructionsSupplier, clientConfig: Partial<import("./middleware-endpoint/resolveEndpointConfig").EndpointResolvedConfig<T>> & Config, context?: import("@smithy/types").HandlerExecutionContext) => Promise<import("@smithy/types").EndpointV2>;
export declare const resolveEndpointConfig: <T, P extends import("@smithy/types").EndpointParameters = import("@smithy/types").EndpointParameters>(input: T & import("./middleware-endpoint/resolveEndpointConfig").EndpointInputConfig<P> & import("./middleware-endpoint/resolveEndpointConfig").PreviouslyResolved<P>) => T & import("./middleware-endpoint/resolveEndpointConfig").EndpointResolvedConfig<P>;
export declare const endpointMiddleware: <T extends import("@smithy/types").EndpointParameters>({ config, instructions, }: {
config: import("./middleware-endpoint/resolveEndpointConfig").EndpointResolvedConfig<T>;
instructions: import("@smithy/types").EndpointParameterInstructions;
}) => import("@smithy/types").SerializeMiddleware<any, any>;
export declare const getEndpointPlugin: <T extends import("@smithy/types").EndpointParameters>(config: import("./middleware-endpoint/resolveEndpointConfig").EndpointResolvedConfig<T>, instructions: import("@smithy/types").EndpointParameterInstructions) => import("@smithy/types").Pluggable<any, any>;
export { resolveParams, EndpointParameterInstructionsSupplier } from "./middleware-endpoint/adaptors/getEndpointFromInstructions";
export { toEndpointV1 as middlewareEndpointToEndpointV1 } from "./middleware-endpoint/adaptors/toEndpointV1";
export { endpointMiddlewareOptions } from "./middleware-endpoint/getEndpointPlugin";
export { EndpointInputConfig, EndpointResolvedConfig } from "./middleware-endpoint/resolveEndpointConfig";
export { resolveEndpointRequiredConfig } from "./middleware-endpoint/resolveEndpointRequiredConfig";
export { EndpointRequiredInputConfig, EndpointRequiredResolvedConfig, } from "./middleware-endpoint/resolveEndpointRequiredConfig";
export { EndpointParameterInstructions, BuiltInParamInstruction, ClientContextParamInstruction, ContextParamInstruction, OperationContextParamInstruction, StaticContextParamInstruction, } from "@smithy/types";
export { toEndpointV1 } from "@smithy/core/transport";
export { BinaryDecisionDiagram } from "./util-endpoints/bdd/BinaryDecisionDiagram";
export { EndpointCache } from "./util-endpoints/cache/EndpointCache";
export { decideEndpoint } from "./util-endpoints/decideEndpoint";
export { isIpAddress } from "./util-endpoints/lib/isIpAddress";
export { isValidHostLabel } from "@smithy/core/transport";
export { customEndpointFunctions } from "./util-endpoints/utils/customEndpointFunctions";
export { resolveEndpoint } from "./util-endpoints/resolveEndpoint";
export { EndpointError } from "./util-endpoints/types";
export { ConditionObject, DeprecatedObject, EndpointFunctions, EndpointObject, EndpointObjectHeaders, EndpointObjectProperties, EndpointParams, EndpointResolverOptions, EndpointRuleObject, ErrorRuleObject, EvaluateOptions, Expression, FunctionArgv, FunctionObject, FunctionReturn, ParameterObject, ReferenceObject, ReferenceRecord, RuleSetObject, RuleSetRules, TreeRuleObject, } from "./util-endpoints/types";
export declare const getEndpointFromInstructions: <T extends import("@smithy/types").EndpointParameters, CommandInput extends object, Config extends object>(commandInput: CommandInput, instructionsSupplier: import("./middleware-endpoint/adaptors/getEndpointFromInstructions").EndpointParameterInstructionsSupplier, clientConfig: Partial<import("./middleware-endpoint/resolveEndpointConfig").EndpointResolvedConfig<T>> & Config, context?: import("@smithy/types").HandlerExecutionContext) => Promise<import("@smithy/types").EndpointV2>;
export declare const resolveEndpointConfig: <T, P extends import("@smithy/types").EndpointParameters = import("@smithy/types").EndpointParameters>(input: T & import("./middleware-endpoint/resolveEndpointConfig").EndpointInputConfig<P> & import("./middleware-endpoint/resolveEndpointConfig").PreviouslyResolved<P>) => T & import("./middleware-endpoint/resolveEndpointConfig").EndpointResolvedConfig<P>;
export declare const endpointMiddleware: <T extends import("@smithy/types").EndpointParameters>({ config, instructions, }: {
config: import("./middleware-endpoint/resolveEndpointConfig").EndpointResolvedConfig<T>;
instructions: import("@smithy/types").EndpointParameterInstructions;
}) => import("@smithy/types").SerializeMiddleware<any, any>;
export declare const getEndpointPlugin: <T extends import("@smithy/types").EndpointParameters>(config: import("./middleware-endpoint/resolveEndpointConfig").EndpointResolvedConfig<T>, instructions: import("@smithy/types").EndpointParameterInstructions) => import("@smithy/types").Pluggable<any, any>;
export { resolveParams, EndpointParameterInstructionsSupplier } from "./middleware-endpoint/adaptors/getEndpointFromInstructions";
export { toEndpointV1 as middlewareEndpointToEndpointV1 } from "./middleware-endpoint/adaptors/toEndpointV1";
export { endpointMiddlewareOptions } from "./middleware-endpoint/getEndpointPlugin";
export { EndpointInputConfig, EndpointResolvedConfig } from "./middleware-endpoint/resolveEndpointConfig";
export { resolveEndpointRequiredConfig } from "./middleware-endpoint/resolveEndpointRequiredConfig";
export { EndpointRequiredInputConfig, EndpointRequiredResolvedConfig, } from "./middleware-endpoint/resolveEndpointRequiredConfig";
export { EndpointParameterInstructions, BuiltInParamInstruction, ClientContextParamInstruction, ContextParamInstruction, OperationContextParamInstruction, StaticContextParamInstruction, } from "@smithy/types";
/**
* Normalize some key of the client config to an async provider.
* @internal
*
* @param configKey - the key to look up in config.
* @param canonicalEndpointParamKey - this is the name the EndpointRuleSet uses.
* it will most likely not contain the config
* value, but we use it as a fallback.
* @param config - container of the config values.
* @param isClientContextParam - whether this is a client context parameter.
*
* @returns async function that will resolve with the value.
*/
export declare const createConfigValueProvider: <Config extends Record<string, unknown>>(configKey: string, canonicalEndpointParamKey: string, config: Config, isClientContextParam?: boolean) => () => Promise<any>;
export declare const getEndpointFromConfig: (serviceId?: string) => Promise<string | undefined>;
/**
* @internal
*/
export declare const getEndpointFromConfig: (serviceId?: string) => Promise<string | undefined>;
import { EndpointParameterInstructions, EndpointParameters, EndpointV2, HandlerExecutionContext } from "@smithy/types";
import { EndpointResolvedConfig } from "../resolveEndpointConfig";
/**
* @internal
*/
export type EndpointParameterInstructionsSupplier = Partial<{
getEndpointParameterInstructions(): EndpointParameterInstructions;
}>;
/**
* @internal
*/
export type GetEndpointFromConfig = (serviceId?: string) => Promise<string | undefined>;
/**
* @internal
*/
export declare function bindGetEndpointFromInstructions(getEndpointFromConfig: GetEndpointFromConfig): <T extends EndpointParameters, CommandInput extends object, Config extends object>(commandInput: CommandInput, instructionsSupplier: EndpointParameterInstructionsSupplier, clientConfig: Partial<EndpointResolvedConfig<T>> & Config, context?: HandlerExecutionContext) => Promise<EndpointV2>;
/**
* @internal
*/
export declare const resolveParams: <T extends EndpointParameters, CommandInput, Config>(commandInput: CommandInput, instructionsSupplier: EndpointParameterInstructionsSupplier, clientConfig: Partial<EndpointResolvedConfig<T>> & Config) => Promise<EndpointParameters>;
import { LoadedConfigSelectors } from "@smithy/core/config";
export declare const getEndpointUrlConfig: (serviceId: string) => LoadedConfigSelectors<string | undefined>;
/**
* @deprecated Use `toEndpointV1` from `@smithy/core/transport` instead.
* @internal
*/
export { toEndpointV1 } from "@smithy/core/transport";
import { EndpointParameterInstructions, EndpointParameters, SerializeMiddleware } from "@smithy/types";
import { GetEndpointFromConfig } from "./adaptors/getEndpointFromInstructions";
import { EndpointResolvedConfig } from "./resolveEndpointConfig";
/**
* @internal
*/
export declare function bindEndpointMiddleware(getEndpointFromConfig: GetEndpointFromConfig): <T extends EndpointParameters>({ config, instructions, }: {
config: EndpointResolvedConfig<T>;
instructions: EndpointParameterInstructions;
}) => SerializeMiddleware<any, any>;
import { EndpointParameterInstructions, EndpointParameters, Pluggable, RelativeMiddlewareOptions, SerializeHandlerOptions } from "@smithy/types";
import { GetEndpointFromConfig } from "./adaptors/getEndpointFromInstructions";
import { EndpointResolvedConfig } from "./resolveEndpointConfig";
/**
* @internal
*/
export declare const endpointMiddlewareOptions: SerializeHandlerOptions & RelativeMiddlewareOptions;
/**
* @internal
*/
export declare function bindGetEndpointPlugin(getEndpointFromConfig: GetEndpointFromConfig): <T extends EndpointParameters>(config: EndpointResolvedConfig<T>, instructions: EndpointParameterInstructions) => Pluggable<any, any>;
import { Endpoint, EndpointParameters, EndpointV2, Logger, Provider, UrlParser } from "@smithy/types";
import { GetEndpointFromConfig } from "./adaptors/getEndpointFromInstructions";
/**
* Endpoint config interfaces and resolver for Endpoint v2. They live in separate package to allow per-service onboarding.
* When all services onboard Endpoint v2, the resolver in config-resolver package can be removed.
* This interface includes all the endpoint parameters with built-in bindings of "AWS::*" and "SDK::*"
*
* @public
*/
export interface EndpointInputConfig<T extends EndpointParameters = EndpointParameters> {
/**
* The fully qualified endpoint of the webservice. This is only for using
* a custom endpoint (for example, when using a local version of S3).
*
* Endpoint transformations such as S3 applying a bucket to the hostname are
* still applicable to this custom endpoint.
*/
endpoint?: string | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;
/**
* Providing a custom endpointProvider will override
* built-in transformations of the endpoint such as S3 adding the bucket
* name to the hostname, since they are part of the default endpointProvider.
*/
endpointProvider?: (params: T, context?: {
logger?: Logger;
}) => EndpointV2;
/**
* Whether TLS is enabled for requests.
* @deprecated
*/
tls?: boolean;
/**
* Enables IPv6/IPv4 dualstack endpoint.
*/
useDualstackEndpoint?: boolean | Provider<boolean | undefined>;
/**
* Enables FIPS compatible endpoints.
*/
useFipsEndpoint?: boolean | Provider<boolean | undefined>;
/**
* This field is used internally so you should not fill any value to this field.
*
* @internal
*/
serviceConfiguredEndpoint?: never;
}
/**
* @internal
*/
export interface PreviouslyResolved<T extends EndpointParameters = EndpointParameters> {
urlParser: UrlParser;
endpointProvider: (params: T, context?: {
logger?: Logger;
}) => EndpointV2;
logger?: Logger;
serviceId?: string;
}
/**
* This supersedes the similarly named EndpointsResolvedConfig (no parametric types)
* from resolveEndpointsConfig.ts in \@smithy/config-resolver.
*
* @internal
*/
export interface EndpointResolvedConfig<T extends EndpointParameters = EndpointParameters> {
/**
* Custom endpoint provided by the user.
* This is normalized to a single interface from the various acceptable types.
* This field will be undefined if a custom endpoint is not provided.
*/
endpoint?: Provider<Endpoint>;
endpointProvider: (params: T, context?: {
logger?: Logger;
}) => EndpointV2;
/**
* Whether TLS is enabled for requests.
* @deprecated
*/
tls: boolean;
/**
* Whether the endpoint is specified by caller.
* This should be used over checking the existence of `endpoint`, since
* that may have been set by other means, such as the default regional
* endpoint provider function.
*
* @internal
*/
isCustomEndpoint?: boolean;
/**
* Resolved value for input {@link EndpointsInputConfig.useDualstackEndpoint}
*/
useDualstackEndpoint: Provider<boolean>;
/**
* Resolved value for input {@link EndpointsInputConfig.useFipsEndpoint}
*/
useFipsEndpoint: Provider<boolean>;
/**
* Unique service identifier.
* @internal
*/
serviceId?: string;
/**
* A configured endpoint global or specific to the service from ENV or AWS SDK configuration files.
* @internal
*/
serviceConfiguredEndpoint?: Provider<string | undefined>;
}
/**
* @internal
*/
export declare function bindResolveEndpointConfig(getEndpointFromConfig: GetEndpointFromConfig): <T, P extends EndpointParameters = EndpointParameters>(input: T & EndpointInputConfig<P> & PreviouslyResolved<P>) => T & EndpointResolvedConfig<P>;
import { Endpoint, EndpointV2, Provider } from "@smithy/types";
/**
* This is an additional config resolver layer for clients using the default
* endpoints ruleset. It modifies the input and output config types to make
* the endpoint configuration property required.
*
* It must be placed after the `resolveEndpointConfig`
* resolver. This replaces the "CustomEndpoints" config resolver, which was used
* prior to default endpoint rulesets.
*
* @public
*/
export interface EndpointRequiredInputConfig {
endpoint: string | Endpoint | Provider<Endpoint> | EndpointV2 | Provider<EndpointV2>;
}
/**
* @internal
*/
interface PreviouslyResolved {
endpoint?: Provider<Endpoint>;
}
/**
* @internal
*/
export interface EndpointRequiredResolvedConfig {
endpoint: Provider<Endpoint>;
}
/**
* @internal
*/
export declare const resolveEndpointRequiredConfig: <T>(input: T & EndpointRequiredInputConfig & PreviouslyResolved) => T & EndpointRequiredResolvedConfig;
export {};
/**
* @internal
*/
export { DOT_PATTERN, S3_HOSTNAME_PATTERN, isArnBucketName, isDnsCompatibleBucketName, resolveParamsForS3 } from "./s3";
import { EndpointParameters } from "@smithy/types";
/**
* @internal
*/
export declare const resolveParamsForS3: (endpointParams: EndpointParameters) => Promise<EndpointParameters>;
/**
* @internal
*/
export declare const DOT_PATTERN: RegExp;
/**
* @internal
*/
export declare const S3_HOSTNAME_PATTERN: RegExp;
/**
* Determines whether a given string is DNS compliant per the rules outlined by
* S3. Length, capitaization, and leading dot restrictions are enforced by the
* DOMAIN_PATTERN regular expression.
* @internal
*
* @see https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html
*/
export declare const isDnsCompatibleBucketName: (bucketName: string) => boolean;
/**
* @internal
*/
export declare const isArnBucketName: (bucketName: string) => boolean;
import { EndpointObjectHeaders, ParameterObject } from "@smithy/types";
import { Expression, FunctionArgv } from "../types/shared";
/**
* @internal
*/
type BddCondition = [
string,
FunctionArgv
] | [
string,
FunctionArgv,
string
];
/**
* @internal
*/
type BddResult = [
-1
] | [
-1,
Expression
] | [
string,
Record<string, ParameterObject>,
EndpointObjectHeaders
] | [
string,
Record<string, ParameterObject>
];
/**
* @internal
*/
export declare class BinaryDecisionDiagram {
nodes: Int32Array;
root: number;
conditions: BddCondition[];
results: BddResult[];
private constructor();
static from(bdd: Int32Array, root: number, conditions: BddCondition[] | any[], results: BddResult[] | any[]): BinaryDecisionDiagram;
}
export {};
import { EndpointParams, EndpointV2 } from "@smithy/types";
/**
* Cache for endpoint ruleSet resolution.
*
* @internal
*/
export declare class EndpointCache {
private capacity;
private data;
private parameters;
/**
* @param [size] - desired average maximum capacity. A buffer of 10 additional keys will be allowed
* before keys are dropped.
* @param [params] - list of params to consider as part of the cache key.
*
* If the params list is not populated, no caching will happen.
* This may be out of order depending on how the object is created and arrives to this class.
*/
constructor({ size, params }: {
size?: number;
params?: string[];
});
/**
* @param endpointParams - query for endpoint.
* @param resolver - provider of the value if not present.
* @returns endpoint corresponding to the query.
*/
get(endpointParams: EndpointParams, resolver: () => EndpointV2): EndpointV2;
size(): number;
/**
* @returns cache key or false if not cachable.
*/
private hash;
}
export declare const debugId = "endpoints";
export { debugId } from "./debugId";
export { toDebugString } from "./toDebugString";
import { EndpointParameters, EndpointV2 } from "@smithy/types";
import { GetAttrValue } from "../lib";
import { EndpointObject, FunctionObject, FunctionReturn } from "../types";
export declare function toDebugString(input: EndpointParameters): string;
export declare function toDebugString(input: EndpointV2): string;
export declare function toDebugString(input: GetAttrValue): string;
export declare function toDebugString(input: FunctionObject): string;
export declare function toDebugString(input: FunctionReturn): string;
export declare function toDebugString(input: EndpointObject): string;
import { EndpointV2 } from "@smithy/types";
import { BinaryDecisionDiagram } from "./bdd/BinaryDecisionDiagram";
import { EndpointResolverOptions } from "./types";
/**
* Resolves an endpoint URL by processing the endpoints bdd and options.
*/
export declare const decideEndpoint: (bdd: BinaryDecisionDiagram, options: EndpointResolverOptions) => EndpointV2;
/**
* Inlined from @smithy/core/config to avoid circular dependency.
*
* @internal
*/
type LoadedConfigSelectors<T> = {
environmentVariableSelector: (env: Record<string, string | undefined>) => T | undefined;
configFileSelector: (profile: Record<string, string | undefined>, configFile?: Record<string, Record<string, string | undefined>>) => T | undefined;
default: T | (() => T);
};
export declare const getEndpointUrlConfig: (serviceId: string) => LoadedConfigSelectors<string | undefined>;
export {};
/**
* Evaluates two boolean values value1 and value2 for equality and returns
* true if both values match.
*/
export declare const booleanEquals: (value1: boolean, value2: boolean) => boolean;
/**
* Evaluates arguments in order and returns the first non-empty result,
* otherwise returns the result of the last argument.
*
* @internal
*/
export declare function coalesce<T>(...args: (T | undefined)[]): T | undefined;
export type GetAttrValue = string | boolean | {
[key: string]: GetAttrValue;
} | Array<GetAttrValue>;
/**
* Returns value corresponding to pathing string for an array or object.
*/
export declare const getAttr: (value: GetAttrValue, path: string) => GetAttrValue;
/**
* Parses path as a getAttr expression, returning a list of strings.
*/
export declare const getAttrPathList: (path: string) => Array<string>;
export { booleanEquals } from "./booleanEquals";
export { coalesce } from "./coalesce";
export { getAttr } from "./getAttr";
export { GetAttrValue } from "./getAttr";
export { isSet } from "./isSet";
export { isValidHostLabel } from "@smithy/core/transport";
export { ite } from "./ite";
export { not } from "./not";
export { parseURL } from "./parseURL";
export { split } from "./split";
export { stringEquals } from "./stringEquals";
export { substring } from "./substring";
export { uriEncode } from "./uriEncode";
/**
* Validates if the provided value is an IP address.
*/
export declare const isIpAddress: (value: string) => boolean;
/**
* Evaluates whether a value is set (aka not null or undefined).
* Returns true if the value is set, otherwise returns false.
*/
export declare const isSet: (value: unknown) => value is {};
/**
* An if-then-else function that returns one of two values based on a boolean condition.
*
* @internal
*/
export declare function ite<T>(condition: boolean, trueValue: T | undefined, falseValue: T | undefined): T | undefined;
/**
* Performs logical negation on the provided boolean value,
* returning the negated value.
*/
export declare const not: (value: boolean) => boolean;
import { Endpoint, EndpointURL } from "@smithy/types";
/**
* Parses a string, URL, or Endpoint into it’s Endpoint URL components.
*/
export declare const parseURL: (value: string | URL | Endpoint) => EndpointURL | null;
/**
* The split function divides a string into an array of substrings based on a non-empty delimiter.
* The behavior is controlled by the limit parameter:
*
* limit = 0: Split all occurrences (unlimited).
* limit = 1: No split performed (returns original string as single element array).
* limit > 1: Split into at most 'limit' parts (performs limit-1 splits).
*
* @internal
*/
export declare function split(value: string, delimiter: string, limit: number): string[];
/**
* Evaluates two string values value1 and value2 for equality and returns
* true if both values match.
*/
export declare const stringEquals: (value1: string, value2: string) => boolean;
/**
* Computes the substring of a given string, conditionally indexing from the end of the string.
* When the string is long enough to fully include the substring, return the substring.
* Otherwise, return None. The start index is inclusive and the stop index is exclusive.
* The length of the returned string will always be stop-start.
*/
export declare const substring: (input: string, start: number, stop: number, reverse: boolean) => string | null;
/**
* Performs percent-encoding per RFC3986 section 2.1
*/
export declare const uriEncode: (value: string) => string;
import { EndpointV2 } from "@smithy/types";
import { EndpointResolverOptions, RuleSetObject } from "./types";
/**
* Resolves an endpoint URL by processing the endpoints ruleset and options.
*/
export declare const resolveEndpoint: (ruleSetObject: RuleSetObject, options: EndpointResolverOptions) => EndpointV2;
export declare class EndpointError extends Error {
constructor(message: string);
}
import { FunctionReturn } from "./shared";
export type EndpointFunctions = Record<string, (...args: any[]) => FunctionReturn>;
import { EndpointObject as __EndpointObject, EndpointObjectHeaders as __EndpointObjectHeaders, EndpointObjectProperties as __EndpointObjectProperties, EndpointRuleObject as __EndpointRuleObject } from "@smithy/types";
export type EndpointObjectProperties = __EndpointObjectProperties;
export type EndpointObjectHeaders = __EndpointObjectHeaders;
export type EndpointObject = __EndpointObject;
export type EndpointRuleObject = __EndpointRuleObject;
import { ErrorRuleObject as __ErrorRuleObject } from "@smithy/types";
export type ErrorRuleObject = __ErrorRuleObject;
export { EndpointError } from "./EndpointError";
export { EndpointFunctions } from "./EndpointFunctions";
export { EndpointObject, EndpointObjectHeaders, EndpointObjectProperties, EndpointRuleObject, } from "./EndpointRuleObject";
export { ErrorRuleObject } from "./ErrorRuleObject";
export { DeprecatedObject, ParameterObject, RuleSetObject } from "./RuleSetObject";
export { RuleSetRules, TreeRuleObject } from "./TreeRuleObject";
export { ConditionObject, EndpointParams, EndpointResolverOptions, EvaluateOptions, Expression, FunctionArgv, FunctionObject, FunctionReturn, ReferenceObject, ReferenceRecord, } from "./shared";
import { DeprecatedObject as __DeprecatedObject, ParameterObject as __ParameterObject, RuleSetObject as __RuleSetObject } from "@smithy/types";
export type DeprecatedObject = __DeprecatedObject;
export type ParameterObject = __ParameterObject;
export type RuleSetObject = __RuleSetObject;
import { EndpointARN, EndpointPartition, EndpointURL, Logger } from "@smithy/types";
export type ReferenceObject = {
ref: string;
};
export type FunctionObject = {
fn: string;
argv: FunctionArgv;
};
export type FunctionArgv = Array<Expression | boolean | number>;
export type FunctionReturn = string | boolean | number | EndpointARN | EndpointPartition | EndpointURL | {
[key: string]: FunctionReturn;
} | Array<FunctionReturn> | null;
export type ConditionObject = FunctionObject & {
assign?: string;
};
export type Expression = string | ReferenceObject | FunctionObject;
export type EndpointParams = Record<string, string | boolean>;
export type EndpointResolverOptions = {
endpointParams: EndpointParams;
logger?: Logger;
};
export type ReferenceRecord = Record<string, FunctionReturn>;
export type EvaluateOptions = EndpointResolverOptions & {
referenceRecord: ReferenceRecord;
};
import { RuleSetRules as __RuleSetRules, TreeRuleObject as __TreeRuleObject } from "@smithy/types";
export type RuleSetRules = __RuleSetRules;
export type TreeRuleObject = __TreeRuleObject;
export { callFunction } from "./evaluateExpression";
import { EndpointFunctions } from "../types/EndpointFunctions";
export declare const customEndpointFunctions: {
[key: string]: EndpointFunctions;
};
import { EndpointFunctions } from "../types";
export declare const endpointFunctions: EndpointFunctions;
import { ConditionObject, EvaluateOptions } from "../types";
export declare const evaluateCondition: (condition: ConditionObject, options: EvaluateOptions) => {
result: boolean;
toAssign: {
name: string;
value: import("../types").FunctionReturn;
};
} | {
result: boolean;
toAssign?: undefined;
};
import { ConditionObject, EvaluateOptions, FunctionReturn } from "../types";
export declare const evaluateConditions: (conditions: ConditionObject[] | undefined, options: EvaluateOptions) => {
result: boolean;
referenceRecord: Record<string, FunctionReturn>;
} | {
result: boolean;
referenceRecord?: undefined;
};
import { EndpointV2 } from "@smithy/types";
import { EndpointRuleObject, EvaluateOptions } from "../types";
export declare const evaluateEndpointRule: (endpointRule: EndpointRuleObject, options: EvaluateOptions) => EndpointV2 | undefined;
import { ErrorRuleObject, EvaluateOptions } from "../types";
export declare const evaluateErrorRule: (errorRule: ErrorRuleObject, options: EvaluateOptions) => void;
import { EvaluateOptions, Expression, FunctionObject, FunctionReturn } from "../types";
export declare const evaluateExpression: (obj: Expression, keyName: string, options: EvaluateOptions) => FunctionReturn;
export declare const callFunction: ({ fn, argv }: FunctionObject, options: EvaluateOptions) => FunctionReturn;
export declare const group: {
evaluateExpression: (obj: Expression, keyName: string, options: EvaluateOptions) => FunctionReturn;
callFunction: ({ fn, argv }: FunctionObject, options: EvaluateOptions) => FunctionReturn;
};
import { EndpointV2 } from "@smithy/types";
import { EvaluateOptions, RuleSetRules, TreeRuleObject } from "../types";
export declare const evaluateRules: (rules: RuleSetRules, options: EvaluateOptions) => EndpointV2;
export declare const evaluateTreeRule: (treeRule: TreeRuleObject, options: EvaluateOptions) => EndpointV2 | undefined;
export declare const group: {
evaluateRules: (rules: RuleSetRules, options: EvaluateOptions) => EndpointV2;
evaluateTreeRule: (treeRule: TreeRuleObject, options: EvaluateOptions) => EndpointV2 | undefined;
};
import { EvaluateOptions } from "../types";
export declare const evaluateTemplate: (template: string, options: EvaluateOptions) => string;
export { evaluateTreeRule } from "./evaluateRules";
import { EndpointObjectHeaders, EvaluateOptions } from "../types";
export declare const getEndpointHeaders: (headers: EndpointObjectHeaders, options: EvaluateOptions) => Record<string, string[]>;
import { EndpointObjectProperty } from "@smithy/types";
import { EndpointObjectProperties, EvaluateOptions } from "../types";
export declare const getEndpointProperties: (properties: EndpointObjectProperties, options: EvaluateOptions) => Record<string, EndpointObjectProperty>;
export declare const getEndpointProperty: (property: EndpointObjectProperty, options: EvaluateOptions) => EndpointObjectProperty;
export declare const group: {
getEndpointProperty: (property: EndpointObjectProperty, options: EvaluateOptions) => EndpointObjectProperty;
getEndpointProperties: (properties: EndpointObjectProperties, options: EvaluateOptions) => Record<string, EndpointObjectProperty>;
};
export { getEndpointProperty } from "./getEndpointProperties";
import { EvaluateOptions, Expression } from "../types";
export declare const getEndpointUrl: (endpointUrl: Expression, options: EvaluateOptions) => URL;
import { EvaluateOptions, ReferenceObject } from "../types";
export declare const getReferenceValue: ({ ref }: ReferenceObject, options: EvaluateOptions) => string | number | boolean | import("@smithy/types").EndpointPartition | import("@smithy/types").EndpointARN | import("@smithy/types").EndpointURL | {
[key: string]: import("../types").FunctionReturn;
} | import("../types").FunctionReturn[];
export { customEndpointFunctions } from "./customEndpointFunctions";
export { evaluateRules, evaluateTreeRule, group } from "./evaluateRules";
import { AvailableMessage, AvailableMessages, Decoder, Encoder, Message, MessageDecoder, MessageEncoder, MessageHeaders } from "@smithy/types";
/**
* A Codec that can convert binary-packed event stream messages into
* JavaScript objects and back again into their binary format.
*/
export declare class EventStreamCodec implements MessageEncoder, MessageDecoder {
private readonly headerMarshaller;
private messageBuffer;
private isEndOfStream;
constructor(toUtf8: Encoder, fromUtf8: Decoder);
feed(message: ArrayBufferView): void;
endOfStream(): void;
getMessage(): AvailableMessage;
getAvailableMessages(): AvailableMessages;
/**
* Convert a structured JavaScript object with tagged headers into a binary
* event stream message.
*/
encode({ headers: rawHeaders, body }: Message): Uint8Array;
/**
* Convert a binary event stream message into a JavaScript object with an
* opaque, binary body and tagged, parsed headers.
*/
decode(message: ArrayBufferView): Message;
/**
* Convert a structured JavaScript object with tagged headers into a binary
* event stream message header.
*/
formatHeaders(rawHeaders: MessageHeaders): Uint8Array;
}
import { Decoder, Encoder, MessageHeaders } from "@smithy/types";
/**
* @internal
*/
export declare class HeaderMarshaller {
private readonly toUtf8;
private readonly fromUtf8;
constructor(toUtf8: Encoder, fromUtf8: Decoder);
format(headers: MessageHeaders): Uint8Array;
private formatHeaderValue;
parse(headers: DataView): MessageHeaders;
}
import { Int64 as IInt64 } from "@smithy/types";
export interface Int64 extends IInt64 {
}
/**
* A lossless representation of a signed, 64-bit integer. Instances of this
* class may be used in arithmetic expressions as if they were numeric
* primitives, but the binary representation will be preserved unchanged as the
* `bytes` property of the object. The bytes should be encoded as big-endian,
* two's complement integers.
*/
export declare class Int64 {
readonly bytes: Uint8Array;
constructor(bytes: Uint8Array);
static fromNumber(number: number): Int64;
/**
* Called implicitly by infix arithmetic operators.
*/
valueOf(): number;
toString(): string;
}
import { Int64 } from "./Int64";
/**
* An event stream message. The headers and body properties will always be
* defined, with empty headers represented as an object with no keys and an
* empty body represented as a zero-length Uint8Array.
*/
export interface Message {
headers: MessageHeaders;
body: Uint8Array;
}
export type MessageHeaders = Record<string, MessageHeaderValue>;
type HeaderValue<K extends string, V> = {
type: K;
value: V;
};
export type BooleanHeaderValue = HeaderValue<"boolean", boolean>;
export type ByteHeaderValue = HeaderValue<"byte", number>;
export type ShortHeaderValue = HeaderValue<"short", number>;
export type IntegerHeaderValue = HeaderValue<"integer", number>;
export type LongHeaderValue = HeaderValue<"long", Int64>;
export type BinaryHeaderValue = HeaderValue<"binary", Uint8Array>;
export type StringHeaderValue = HeaderValue<"string", string>;
export type TimestampHeaderValue = HeaderValue<"timestamp", Date>;
export type UuidHeaderValue = HeaderValue<"uuid", string>;
export type MessageHeaderValue = BooleanHeaderValue | ByteHeaderValue | ShortHeaderValue | IntegerHeaderValue | LongHeaderValue | BinaryHeaderValue | StringHeaderValue | TimestampHeaderValue | UuidHeaderValue;
export {};
import { Message, MessageDecoder } from "@smithy/types";
/**
* @internal
*/
export interface MessageDecoderStreamOptions {
inputStream: AsyncIterable<Uint8Array>;
decoder: MessageDecoder;
}
/**
* @internal
*/
export declare class MessageDecoderStream implements AsyncIterable<Message> {
private readonly options;
constructor(options: MessageDecoderStreamOptions);
[Symbol.asyncIterator](): AsyncIterator<Message>;
private asyncIterator;
}
import { Message, MessageEncoder } from "@smithy/types";
/**
* @internal
*/
export interface MessageEncoderStreamOptions {
messageStream: AsyncIterable<Message>;
encoder: MessageEncoder;
includeEndFrame?: boolean;
}
/**
* @internal
*/
export declare class MessageEncoderStream implements AsyncIterable<Uint8Array> {
private readonly options;
constructor(options: MessageEncoderStreamOptions);
[Symbol.asyncIterator](): AsyncIterator<Uint8Array>;
private asyncIterator;
}
import { Message } from "@smithy/types";
/**
* @internal
*/
export interface SmithyMessageDecoderStreamOptions<T> {
readonly messageStream: AsyncIterable<Message>;
readonly deserializer: (input: Message) => Promise<T | undefined>;
}
/**
* @internal
*/
export declare class SmithyMessageDecoderStream<T> implements AsyncIterable<T> {
private readonly options;
constructor(options: SmithyMessageDecoderStreamOptions<T>);
[Symbol.asyncIterator](): AsyncIterator<T>;
private asyncIterator;
}
import { Message } from "@smithy/types";
/**
* @internal
*/
export interface SmithyMessageEncoderStreamOptions<T> {
inputStream: AsyncIterable<T>;
serializer: (event: T) => Message;
}
/**
* @internal
*/
export declare class SmithyMessageEncoderStream<T> implements AsyncIterable<Message> {
private readonly options;
constructor(options: SmithyMessageEncoderStreamOptions<T>);
[Symbol.asyncIterator](): AsyncIterator<Message>;
private asyncIterator;
}
/**
* @internal
*/
export interface MessageParts {
headers: DataView;
body: Uint8Array;
}
/**
* @internal
*/
export declare function splitMessage({ byteLength, byteOffset, buffer }: ArrayBufferView): MessageParts;
import { EventStreamMarshaller, EventStreamSerdeProvider } from "@smithy/types";
/**
* @public
*/
export interface EventStreamSerdeInputConfig {
}
/**
* @internal
*/
export interface EventStreamSerdeResolvedConfig {
eventStreamMarshaller: EventStreamMarshaller;
}
/**
* @internal
*/
interface PreviouslyResolved {
/**
* Provide the event stream marshaller for the given runtime
* @internal
*/
eventStreamSerdeProvider: EventStreamSerdeProvider;
}
/**
* @internal
*/
export declare const resolveEventStreamSerdeConfig: <T>(input: T & PreviouslyResolved & EventStreamSerdeInputConfig) => T & EventStreamSerdeResolvedConfig;
export {};
import { Decoder, Encoder, EventStreamSerdeProvider, EventStreamMarshaller as IEventStreamMarshaller, Message } from "@smithy/types";
/**
* @internal
*/
export interface EventStreamMarshallerOptions {
utf8Encoder: Encoder;
utf8Decoder: Decoder;
}
/**
* @internal
*/
export declare class EventStreamMarshaller implements IEventStreamMarshaller {
private readonly eventStreamCodec;
private readonly utfEncoder;
constructor({ utf8Encoder, utf8Decoder }: EventStreamMarshallerOptions);
deserialize<T>(body: AsyncIterable<Uint8Array>, deserializer: (input: Record<string, Message>) => Promise<T>): AsyncIterable<T>;
serialize<T>(inputStream: AsyncIterable<T>, serializer: (event: T) => Message): AsyncIterable<Uint8Array>;
}
/**
* @internal
*/
export declare const eventStreamSerdeProvider: EventStreamSerdeProvider;
/**
* @internal
*/
export declare function getChunkedStream(source: AsyncIterable<Uint8Array>): AsyncIterable<Uint8Array>;
import { Encoder, Message } from "@smithy/types";
import { EventStreamCodec } from "../eventstream-codec/EventStreamCodec";
/**
* @internal
*/
export type UnmarshalledStreamOptions<T> = {
eventStreamCodec: EventStreamCodec;
deserializer: (input: Record<string, Message>) => Promise<T>;
toUtf8: Encoder;
};
/**
* @internal
*/
export declare function getUnmarshalledStream<T extends Record<string, any>>(source: AsyncIterable<Uint8Array>, options: UnmarshalledStreamOptions<T>): AsyncIterable<T>;
/**
* @internal
*/
export declare function getMessageUnmarshaller<T extends Record<string, any>>(deserializer: (input: Record<string, Message>) => Promise<T>, toUtf8: Encoder): (input: Message) => Promise<T | undefined>;
import { Decoder, Encoder, EventStreamSerdeProvider, EventStreamMarshaller as IEventStreamMarshaller, Message } from "@smithy/types";
/**
* @internal
*/
export interface EventStreamMarshallerOptions {
utf8Encoder: Encoder;
utf8Decoder: Decoder;
}
/**
* Utility class used to serialize and deserialize event streams in
* browsers and ReactNative.
*
* In browsers where ReadableStream API is available:
* * deserialize from ReadableStream to an async iterable of output structure
* * serialize from async iterable of input structure to ReadableStream
* In ReactNative where only async iterable API is available:
* * deserialize from async iterable of binaries to async iterable of output structure
* * serialize from async iterable of input structure to async iterable of binaries
*
* We use ReadableStream API in browsers because of the consistency with other
* streaming operations, where ReadableStream API is used to denote streaming data.
* Whereas in ReactNative, ReadableStream API is not available, we use async iterable
* for streaming data, although it has lower throughput.
*
* @internal
*/
export declare class EventStreamMarshaller implements IEventStreamMarshaller {
private readonly universalMarshaller;
constructor({ utf8Encoder, utf8Decoder }: EventStreamMarshallerOptions);
deserialize<T>(body: ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>, deserializer: (input: Record<string, Message>) => Promise<T>): AsyncIterable<T>;
/**
* Generate a stream that serialize events into stream of binary chunks;
*
* Caveat is that streaming request payload doesn't work on browser with native
* xhr or fetch handler currently because they don't support upload streaming.
* reference:
* * https://bugs.chromium.org/p/chromium/issues/detail?id=688906
* * https://bugzilla.mozilla.org/show_bug.cgi?id=1387483
*
*/
serialize<T>(input: AsyncIterable<T>, serializer: (event: T) => Message): ReadableStream | AsyncIterable<Uint8Array>;
}
/**
* @internal
*/
export declare const eventStreamSerdeProvider: EventStreamSerdeProvider;
import { Readable } from "node:stream";
import { Decoder, Encoder, EventStreamSerdeProvider, EventStreamMarshaller as IEventStreamMarshaller, Message } from "@smithy/types";
/**
* @internal
*/
export interface EventStreamMarshallerOptions {
utf8Encoder: Encoder;
utf8Decoder: Decoder;
}
/**
* @internal
*/
export declare class EventStreamMarshaller implements IEventStreamMarshaller {
private readonly universalMarshaller;
constructor({ utf8Encoder, utf8Decoder }: EventStreamMarshallerOptions);
deserialize<T>(body: Readable, deserializer: (input: Record<string, Message>) => Promise<T>): AsyncIterable<T>;
serialize<T>(input: AsyncIterable<T>, serializer: (event: T) => Message): Readable;
}
/**
* @internal
*/
export declare const eventStreamSerdeProvider: EventStreamSerdeProvider;
/**
* Convert object stream piped in into an async iterable. This
* adaptor should be deprecated when Node stream iterator is stable.
* Caveat: this adaptor won't have backpressure to inwards stream
*
* Reference: https://nodejs.org/docs/latest-v11.x/api/stream.html#stream_readable_symbol_asynciterator
* @internal
*/
export declare function readableToIterable<T>(readStream: Readable): AsyncIterable<T>;
/**
* A util function converting ReadableStream into an async iterable.
* Reference: https://jakearchibald.com/2017/async-iterators-and-generators/#making-streams-iterate
* @internal
*/
export declare const readableStreamToIterable: <T>(readableStream: ReadableStream<T>) => AsyncIterable<T>;
/**
* A util function converting async iterable to a ReadableStream.
* @internal
*/
export declare const iterableToReadableStream: <T>(asyncIterable: AsyncIterable<T>) => ReadableStream<T>;
import { NormalizedSchema } from "@smithy/core/schema";
import { EventStreamMarshaller, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
/**
* Separated module for async mixin of EventStream serde capability.
* This is used by the HttpProtocol base class from \@smithy/core/protocols.
*
* @public
*/
export declare class EventStreamSerde {
private readonly marshaller;
private readonly serializer;
private readonly deserializer;
private readonly serdeContext?;
private readonly defaultContentType;
/**
* Properties are injected by the HttpProtocol.
*/
constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType, }: {
marshaller: EventStreamMarshaller;
serializer: ShapeSerializer<string | Uint8Array>;
deserializer: ShapeDeserializer<string | Uint8Array>;
serdeContext?: SerdeFunctions;
defaultContentType: string;
});
/**
* @param eventStream - the iterable provided by the caller.
* @param requestSchema - the schema of the event stream container (struct).
* @param [initialRequest] - only provided if the initial-request is part of the event stream (RPC).
*
* @returns a stream suitable for the HTTP body of a request.
*/
serializeEventStream({ eventStream, requestSchema, initialRequest, }: {
eventStream: AsyncIterable<any>;
requestSchema: NormalizedSchema;
initialRequest?: any;
}): Promise<IHttpRequest["body"] | Uint8Array>;
/**
* @param response - http response from which to read the event stream.
* @param unionSchema - schema of the event stream container (struct).
* @param [initialResponseContainer] - provided and written to only if the initial response is part of the event stream (RPC).
*
* @returns the asyncIterable of the event stream for the end-user.
*/
deserializeEventStream({ response, responseSchema, initialResponseContainer, }: {
response: IHttpResponse;
responseSchema: NormalizedSchema;
initialResponseContainer?: any;
}): Promise<AsyncIterable<{
[key: string]: any;
$unknown?: unknown;
}>>;
/**
* @param unionMember - member name within the structure that contains an event stream union.
* @param unionSchema - schema of the union.
* @param event
*
* @returns the event body (bytes) and event type (string).
*/
private writeEventBody;
}
export { EventStreamCodec } from "./eventstream-codec/EventStreamCodec";
export { HeaderMarshaller } from "./eventstream-codec/HeaderMarshaller";
export { Int64 } from "./eventstream-codec/Int64";
export { Message, MessageHeaders, MessageHeaderValue, BooleanHeaderValue, ByteHeaderValue, ShortHeaderValue, IntegerHeaderValue, LongHeaderValue, BinaryHeaderValue, StringHeaderValue, TimestampHeaderValue, UuidHeaderValue, } from "./eventstream-codec/Message";
export { MessageDecoderStream } from "./eventstream-codec/MessageDecoderStream";
export { MessageDecoderStreamOptions } from "./eventstream-codec/MessageDecoderStream";
export { MessageEncoderStream } from "./eventstream-codec/MessageEncoderStream";
export { MessageEncoderStreamOptions } from "./eventstream-codec/MessageEncoderStream";
export { SmithyMessageDecoderStream } from "./eventstream-codec/SmithyMessageDecoderStream";
export { SmithyMessageDecoderStreamOptions } from "./eventstream-codec/SmithyMessageDecoderStream";
export { SmithyMessageEncoderStream } from "./eventstream-codec/SmithyMessageEncoderStream";
export { SmithyMessageEncoderStreamOptions } from "./eventstream-codec/SmithyMessageEncoderStream";
export { EventStreamMarshaller, eventStreamSerdeProvider } from "./eventstream-serde/EventStreamMarshaller.browser";
export { EventStreamMarshallerOptions } from "./eventstream-serde/EventStreamMarshaller.browser";
export { readableStreamToIterable, iterableToReadableStream } from "./eventstream-serde/utils";
export { EventStreamMarshaller as UniversalEventStreamMarshaller, eventStreamSerdeProvider as universalEventStreamSerdeProvider, } from "./eventstream-serde-universal/EventStreamMarshaller";
export { EventStreamMarshallerOptions as UniversalEventStreamMarshallerOptions } from "./eventstream-serde-universal/EventStreamMarshaller";
export { getChunkedStream } from "./eventstream-serde-universal/getChunkedStream";
export { getUnmarshalledStream, getMessageUnmarshaller } from "./eventstream-serde-universal/getUnmarshalledStream";
export { UnmarshalledStreamOptions } from "./eventstream-serde-universal/getUnmarshalledStream";
export { resolveEventStreamSerdeConfig } from "./eventstream-serde-config-resolver/EventStreamSerdeConfig";
export { EventStreamSerdeInputConfig, EventStreamSerdeResolvedConfig, } from "./eventstream-serde-config-resolver/EventStreamSerdeConfig";
export { EventStreamSerde } from "./EventStreamSerde";
export { EventStreamCodec } from "./eventstream-codec/EventStreamCodec";
export { HeaderMarshaller } from "./eventstream-codec/HeaderMarshaller";
export { Int64 } from "./eventstream-codec/Int64";
export { Message, MessageHeaders, MessageHeaderValue, BooleanHeaderValue, ByteHeaderValue, ShortHeaderValue, IntegerHeaderValue, LongHeaderValue, BinaryHeaderValue, StringHeaderValue, TimestampHeaderValue, UuidHeaderValue, } from "./eventstream-codec/Message";
export { MessageDecoderStream } from "./eventstream-codec/MessageDecoderStream";
export { MessageDecoderStreamOptions } from "./eventstream-codec/MessageDecoderStream";
export { MessageEncoderStream } from "./eventstream-codec/MessageEncoderStream";
export { MessageEncoderStreamOptions } from "./eventstream-codec/MessageEncoderStream";
export { SmithyMessageDecoderStream } from "./eventstream-codec/SmithyMessageDecoderStream";
export { SmithyMessageDecoderStreamOptions } from "./eventstream-codec/SmithyMessageDecoderStream";
export { SmithyMessageEncoderStream } from "./eventstream-codec/SmithyMessageEncoderStream";
export { SmithyMessageEncoderStreamOptions } from "./eventstream-codec/SmithyMessageEncoderStream";
export { EventStreamMarshaller, eventStreamSerdeProvider } from "./eventstream-serde/EventStreamMarshaller";
export { EventStreamMarshallerOptions } from "./eventstream-serde/EventStreamMarshaller";
export { readableStreamToIterable, iterableToReadableStream } from "./eventstream-serde/utils";
export { EventStreamMarshaller as UniversalEventStreamMarshaller, eventStreamSerdeProvider as universalEventStreamSerdeProvider, } from "./eventstream-serde-universal/EventStreamMarshaller";
export { EventStreamMarshallerOptions as UniversalEventStreamMarshallerOptions } from "./eventstream-serde-universal/EventStreamMarshaller";
export { getChunkedStream } from "./eventstream-serde-universal/getChunkedStream";
export { getUnmarshalledStream, getMessageUnmarshaller } from "./eventstream-serde-universal/getUnmarshalledStream";
export { UnmarshalledStreamOptions } from "./eventstream-serde-universal/getUnmarshalledStream";
export { resolveEventStreamSerdeConfig } from "./eventstream-serde-config-resolver/EventStreamSerdeConfig";
export { EventStreamSerdeInputConfig, EventStreamSerdeResolvedConfig, } from "./eventstream-serde-config-resolver/EventStreamSerdeConfig";
export { EventStreamSerde } from "./EventStreamSerde";
import { Uint8ArrayBlobAdapter } from "@smithy/core/serde";
import { SerdeContext } from "@smithy/types";
/**
* Collect low-level response body stream to Uint8Array.
*
* @internal
*/
export declare const collectBody: (streamBody: any | undefined, context: {
streamCollector: SerdeContext["streamCollector"];
}) => Promise<Uint8ArrayBlobAdapter>;
/**
* Function that wraps encodeURIComponent to encode additional characters
* to fully adhere to RFC 3986.
*
* @internal
*/
export declare function extendedEncodeURIComponent(str: string): string;
import { NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
import { HttpRequest } from "@smithy/core/transport";
import { EndpointBearer, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, Schema, SerdeFunctions } from "@smithy/types";
import { HttpProtocol } from "./HttpProtocol";
/**
* Base for HTTP-binding protocols. Downstream examples
* include AWS REST JSON and AWS REST XML.
*
* @public
*/
export declare abstract class HttpBindingProtocol extends HttpProtocol {
/**
* @override
*/
protected compositeErrorRegistry: TypeRegistry;
serializeRequest<Input extends object>(operationSchema: OperationSchema, _input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
protected serializeQuery(ns: NormalizedSchema, data: any, query: HttpRequest["query"]): void;
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
/**
* The base method ignores HTTP bindings.
*
* @deprecated (only this signature) use signature without headerBindings.
* @override
*/
protected deserializeHttpMessage(schema: Schema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, headerBindings: Set<string>, dataObject: any): Promise<string[] & {
discardResponseBody?: boolean;
}>;
protected deserializeHttpMessage(schema: Schema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any): Promise<string[] & {
discardResponseBody?: boolean;
}>;
}
import { EventStreamSerde } from "@smithy/core/event-streams";
import { NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
import { ClientProtocol, Codec, Endpoint, EndpointBearer, EndpointV2, EventStreamMarshaller, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, Schema, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
import { SerdeContext } from "./SerdeContext";
/**
* Abstract base for HTTP-based client protocols.
*
* @public
*/
export declare abstract class HttpProtocol extends SerdeContext implements ClientProtocol<IHttpRequest, IHttpResponse> {
readonly options: {
defaultNamespace: string;
errorTypeRegistries?: TypeRegistry[];
};
/**
* An error registry having the namespace of the modeled service,
* but combining all error schemas found within the service closure.
*
* Used to look up error schema during deserialization.
*/
protected compositeErrorRegistry: TypeRegistry;
protected abstract serializer: ShapeSerializer<string | Uint8Array>;
protected abstract deserializer: ShapeDeserializer<string | Uint8Array>;
/**
* @param options.defaultNamespace - used by various implementing classes.
* @param options.errorTypeRegistries - registry instances that contribute to error deserialization.
*/
protected constructor(options: {
defaultNamespace: string;
errorTypeRegistries?: TypeRegistry[];
});
abstract getShapeId(): string;
abstract getPayloadCodec(): Codec<any, any>;
getRequestType(): new (...args: any[]) => IHttpRequest;
getResponseType(): new (...args: any[]) => IHttpResponse;
/**
* @override
*/
setSerdeContext(serdeContext: SerdeFunctions): void;
abstract serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
updateServiceEndpoint(request: IHttpRequest, endpoint: EndpointV2 | Endpoint): IHttpRequest;
abstract deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
protected setHostPrefix<Input extends object>(request: IHttpRequest, operationSchema: OperationSchema, input: Input): void;
protected abstract handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
protected deserializeMetadata(output: IHttpResponse): ResponseMetadata;
/**
* @param eventStream - the iterable provided by the caller.
* @param requestSchema - the schema of the event stream container (struct).
* @param [initialRequest] - only provided if the initial-request is part of the event stream (RPC).
*
* @returns a stream suitable for the HTTP body of a request.
*/
protected serializeEventStream({ eventStream, requestSchema, initialRequest, }: {
eventStream: AsyncIterable<any>;
requestSchema: NormalizedSchema;
initialRequest?: any;
}): Promise<IHttpRequest["body"]>;
/**
* @param response - http response from which to read the event stream.
* @param unionSchema - schema of the event stream container (struct).
* @param [initialResponseContainer] - provided and written to only if the initial response is part of the event stream (RPC).
*
* @returns the asyncIterable of the event stream.
*/
protected deserializeEventStream({ response, responseSchema, initialResponseContainer, }: {
response: IHttpResponse;
responseSchema: NormalizedSchema;
initialResponseContainer?: any;
}): Promise<AsyncIterable<{
[key: string]: any;
$unknown?: unknown;
}>>;
/**
* Loads eventStream capability async (for chunking).
*/
protected loadEventStreamCapability(): Promise<EventStreamSerde>;
/**
* Returns a platform-specific EventStreamMarshaller.
* Prefers user-injected marshaller from serdeContext (via client config),
* falls back to the dynamically imported provider.
*/
private resolveEventStreamMarshaller;
/**
* @returns content-type default header value for event stream events and other documents.
*/
protected getDefaultContentType(): string;
/**
* For HTTP binding protocols, this method is overridden in {@link HttpBindingProtocol}.
*
* @deprecated only use this for HTTP binding protocols.
*/
protected deserializeHttpMessage(schema: Schema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, headerBindings: Set<string>, dataObject: any): Promise<string[]>;
protected deserializeHttpMessage(schema: Schema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any): Promise<string[]>;
protected getEventStreamMarshaller(): EventStreamMarshaller;
}
export { collectBody } from "./collect-stream-body";
export { extendedEncodeURIComponent } from "./extended-encode-uri-component";
export { HttpBindingProtocol } from "./HttpBindingProtocol";
export { HttpProtocol } from "./HttpProtocol";
export { RpcProtocol } from "./RpcProtocol";
export { RequestBuilder, requestBuilder } from "./requestBuilder";
export { resolvedPath } from "./resolve-path";
export { FromStringShapeDeserializer } from "./serde/FromStringShapeDeserializer";
export { HttpInterceptingShapeDeserializer } from "./serde/HttpInterceptingShapeDeserializer";
export { HttpInterceptingShapeSerializer } from "./serde/HttpInterceptingShapeSerializer";
export { ToStringShapeSerializer } from "./serde/ToStringShapeSerializer";
export { determineTimestampFormat } from "./serde/determineTimestampFormat";
export { SerdeContext } from "./SerdeContext";
export { Field } from "./protocol-http/Field";
export { Fields, FieldsOptions } from "./protocol-http/Fields";
export { HttpHandler, HttpHandlerUserInput } from "./protocol-http/httpHandler";
export { HttpRequest, IHttpRequest } from "@smithy/core/transport";
export { HttpResponse } from "@smithy/core/transport";
export { isValidHostname } from "@smithy/core/transport";
export { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig, HttpHandlerExtensionConfiguration, HttpHandlerExtensionConfigType } from "./protocol-http/extensions/httpExtensionConfiguration";
export { FieldOptions, FieldPosition, HeaderBag, HttpMessage, HttpHandlerOptions } from "./protocol-http/types";
export { contentLengthMiddleware, contentLengthMiddlewareOptions, getContentLengthPlugin, } from "./middleware-content-length/contentLengthMiddleware";
export { escapeUri } from "./util-uri-escape/escape-uri";
export { escapeUriPath } from "./util-uri-escape/escape-uri-path";
export { buildQueryString } from "./querystring-builder/buildQueryString";
export { parseQueryString } from "@smithy/core/transport";
export { parseUrl } from "@smithy/core/transport";
import { BodyLengthCalculator, BuildHandlerOptions, BuildMiddleware, Pluggable } from "@smithy/types";
export declare function contentLengthMiddleware(bodyLengthChecker: BodyLengthCalculator): BuildMiddleware<any, any>;
export declare const contentLengthMiddlewareOptions: BuildHandlerOptions;
export declare const getContentLengthPlugin: (options: {
bodyLengthChecker: BodyLengthCalculator;
}) => Pluggable<any, any>;
import { HttpHandler } from "../httpHandler";
/**
* @internal
*/
export interface HttpHandlerExtensionConfiguration<HandlerConfig extends object = {}> {
setHttpHandler(handler: HttpHandler<HandlerConfig>): void;
httpHandler(): HttpHandler<HandlerConfig>;
updateHttpClientConfig(key: keyof HandlerConfig, value: HandlerConfig[typeof key]): void;
httpHandlerConfigs(): HandlerConfig;
}
/**
* @internal
*/
export type HttpHandlerExtensionConfigType<HandlerConfig extends object = {}> = Partial<{
httpHandler: HttpHandler<HandlerConfig>;
}>;
/**
* Helper function to resolve default extension configuration from runtime config
*
* @internal
*/
export declare const getHttpHandlerExtensionConfiguration: <HandlerConfig extends object = {}>(runtimeConfig: HttpHandlerExtensionConfigType<HandlerConfig>) => {
setHttpHandler(handler: HttpHandler<HandlerConfig>): void;
httpHandler(): HttpHandler<HandlerConfig>;
updateHttpClientConfig(key: keyof HandlerConfig, value: HandlerConfig[typeof key]): void;
httpHandlerConfigs(): HandlerConfig;
};
/**
* Helper function to resolve runtime config from default extension configuration
*
* @internal
*/
export declare const resolveHttpHandlerRuntimeConfig: <HandlerConfig extends object = {}>(httpHandlerExtensionConfiguration: HttpHandlerExtensionConfiguration<HandlerConfig>) => HttpHandlerExtensionConfigType<HandlerConfig>;
import { FieldPosition, FieldOptions } from "@smithy/types";
/**
* A name-value pair representing a single field
* transmitted in an HTTP Request or Response.
*
* The kind will dictate metadata placement within
* an HTTP message.
*
* All field names are case insensitive and
* case-variance must be treated as equivalent.
* Names MAY be normalized but SHOULD be preserved
* for accuracy during transmission.
*/
export declare class Field {
readonly name: string;
readonly kind: FieldPosition;
values: string[];
constructor({ name, kind, values }: FieldOptions);
/**
* Appends a value to the field.
*
* @param value The value to append.
*/
add(value: string): void;
/**
* Overwrite existing field values.
*
* @param values The new field values.
*/
set(values: string[]): void;
/**
* Remove all matching entries from list.
*
* @param value Value to remove.
*/
remove(value: string): void;
/**
* Get comma-delimited string.
*
* @returns String representation of {@link Field}.
*/
toString(): string;
/**
* Get string values as a list
*
* @returns Values in {@link Field} as a list.
*/
get(): string[];
}
import { FieldPosition } from "@smithy/types";
import { Field } from "./Field";
export type FieldsOptions = {
fields?: Field[];
encoding?: string;
};
/**
* Collection of Field entries mapped by name.
*/
export declare class Fields {
private readonly entries;
private readonly encoding;
constructor({ fields, encoding }: FieldsOptions);
/**
* Set entry for a {@link Field} name. The `name`
* attribute will be used to key the collection.
*
* @param field The {@link Field} to set.
*/
setField(field: Field): void;
/**
* Retrieve {@link Field} entry by name.
*
* @param name The name of the {@link Field} entry
* to retrieve
* @returns The {@link Field} if it exists.
*/
getField(name: string): Field | undefined;
/**
* Delete entry from collection.
*
* @param name Name of the entry to delete.
*/
removeField(name: string): void;
/**
* Helper function for retrieving specific types of fields.
* Used to grab all headers or all trailers.
*
* @param kind {@link FieldPosition} of entries to retrieve.
* @returns The {@link Field} entries with the specified
* {@link FieldPosition}.
*/
getByType(kind: FieldPosition): Field[];
}
import { HttpRequest, HttpResponse } from "@smithy/core/transport";
import { FetchHttpHandlerOptions, HttpHandlerOptions, NodeHttpHandlerOptions, RequestHandler } from "@smithy/types";
/**
* @internal
*/
export type HttpHandler<HttpHandlerConfig extends object = {}> = RequestHandler<HttpRequest, HttpResponse, HttpHandlerOptions> & {
/**
* @internal
*/
updateHttpClientConfig(key: keyof HttpHandlerConfig, value: HttpHandlerConfig[typeof key]): void;
/**
* @internal
*/
httpHandlerConfigs(): HttpHandlerConfig;
};
/**
* A type representing the accepted user inputs for the `requestHandler` field
* of a client's constructor object.
* You may provide an instance of an HttpHandler, or alternatively
* provide the constructor arguments as an object which will be passed
* to the constructor of the default request handler.
* The default class constructor to which your arguments will be passed
* varies. The Node.js default is the NodeHttpHandler and the browser/react-native
* default is the FetchHttpHandler. In rarer cases specific clients may be
* configured to use other default implementations such as Websocket or HTTP2.
* The fallback type Record<string, unknown> is part of the union to allow
* passing constructor params to an unknown requestHandler type.
*
* @public
*/
export type HttpHandlerUserInput = HttpHandler | NodeHttpHandlerOptions | FetchHttpHandlerOptions | Record<string, unknown>;
import { FieldOptions as __FieldOptions, FieldPosition as __FieldPosition, HeaderBag as __HeaderBag, HttpHandlerOptions as __HttpHandlerOptions, HttpMessage as __HttpMessage } from "@smithy/types";
/**
* @deprecated Use FieldOptions from `@smithy/types` instead
*/
export type FieldOptions = __FieldOptions;
/**
* @deprecated Use FieldPosition from `@smithy/types` instead
*/
export type FieldPosition = __FieldPosition;
/**
* @deprecated Use HeaderBag from `@smithy/types` instead
*/
export type HeaderBag = __HeaderBag;
/**
* @deprecated Use HttpMessage from `@smithy/types` instead
*/
export type HttpMessage = __HttpMessage;
/**
* @deprecated Use HttpHandlerOptions from `@smithy/types` instead
*/
export type HttpHandlerOptions = __HttpHandlerOptions;
import { QueryParameterBag } from "@smithy/types";
/**
* @internal
*/
export declare function buildQueryString(query: QueryParameterBag): string;
import { HttpRequest } from "@smithy/core/transport";
import { SerdeContext } from "@smithy/types";
/**
* used in code-generated serde.
*
* @internal
*/
export declare function requestBuilder(input: any, context: SerdeContext): RequestBuilder;
/**
* @internal
*/
export declare class RequestBuilder {
private input;
private context;
private query;
private method;
private headers;
private path;
private body;
private hostname;
private resolvePathStack;
constructor(input: any, context: SerdeContext);
build(): Promise<HttpRequest>;
/**
* Brevity setter for "hostname".
*/
hn(hostname: string): this;
/**
* Brevity initial builder for "basepath".
*/
bp(uriLabel: string): this;
/**
* Brevity incremental builder for "path".
*/
p(memberName: string, labelValueProvider: () => string | undefined, uriLabel: string, isGreedyLabel: boolean): this;
/**
* Brevity setter for "headers".
*/
h(headers: Record<string, string>): this;
/**
* Brevity setter for "query".
*/
q(query: Record<string, string>): this;
/**
* Brevity setter for "body".
*/
b(body: any): this;
/**
* Brevity setter for "method".
*/
m(method: string): this;
}
/**
* @internal
*/
export declare const resolvedPath: (resolvedPath: string, input: unknown, memberName: string, labelValueProvider: () => string | undefined, uriLabel: string, isGreedyLabel: boolean) => string;
import { TypeRegistry } from "@smithy/core/schema";
import { EndpointBearer, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, SerdeFunctions } from "@smithy/types";
import { HttpProtocol } from "./HttpProtocol";
/**
* Abstract base for RPC-over-HTTP protocols.
*
* @public
*/
export declare abstract class RpcProtocol extends HttpProtocol {
/**
* @override
*/
protected compositeErrorRegistry: TypeRegistry;
serializeRequest<Input extends object>(operationSchema: OperationSchema, _input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
}
import { NormalizedSchema } from "@smithy/core/schema";
import { CodecSettings, TimestampDateTimeSchema, TimestampEpochSecondsSchema, TimestampHttpDateSchema } from "@smithy/types";
/**
* Assuming the schema is a timestamp type, the function resolves the format using
* either the timestamp's own traits, or the default timestamp format from the CodecSettings.
*
* @internal
*/
export declare function determineTimestampFormat(ns: NormalizedSchema, settings: CodecSettings): TimestampDateTimeSchema | TimestampHttpDateSchema | TimestampEpochSecondsSchema;
import { CodecSettings, Schema, ShapeDeserializer } from "@smithy/types";
import { SerdeContext } from "../SerdeContext";
/**
* This deserializer reads strings.
*
* @public
*/
export declare class FromStringShapeDeserializer extends SerdeContext implements ShapeDeserializer<string> {
private settings;
constructor(settings: CodecSettings);
read(_schema: Schema, data: string): any;
private base64ToUtf8;
}
import { CodecSettings, Schema, SerdeFunctions, ShapeDeserializer } from "@smithy/types";
import { SerdeContext } from "../SerdeContext";
/**
* This deserializer is a dispatcher that decides whether to use a string deserializer
* or a codec deserializer based on HTTP traits.
*
* For example, in a JSON HTTP message, the deserialization of a field will differ depending on whether
* it is bound to the HTTP header (string) or body (JSON).
*
* @public
*/
export declare class HttpInterceptingShapeDeserializer<CodecShapeDeserializer extends ShapeDeserializer<any>> extends SerdeContext implements ShapeDeserializer<string | Uint8Array> {
private codecDeserializer;
private stringDeserializer;
constructor(codecDeserializer: CodecShapeDeserializer, codecSettings: CodecSettings);
/**
* @override
*/
setSerdeContext(serdeContext: SerdeFunctions): void;
read(schema: Schema, data: string | Uint8Array): any | Promise<any>;
}
import { CodecSettings, ConfigurableSerdeContext, Schema as ISchema, SerdeFunctions, ShapeSerializer } from "@smithy/types";
import { ToStringShapeSerializer } from "./ToStringShapeSerializer";
/**
* This serializer decides whether to dispatch to a string serializer or a codec serializer
* depending on HTTP binding traits within the given schema.
*
* For example, a JavaScript array is serialized differently when being written
* to a REST JSON HTTP header (comma-delimited string) and a REST JSON HTTP body (JSON array).
*
* @public
*/
export declare class HttpInterceptingShapeSerializer<CodecShapeSerializer extends ShapeSerializer<string | Uint8Array>> implements ShapeSerializer<string | Uint8Array>, ConfigurableSerdeContext {
private codecSerializer;
private stringSerializer;
private buffer;
constructor(codecSerializer: CodecShapeSerializer, codecSettings: CodecSettings, stringSerializer?: ToStringShapeSerializer);
/**
* @override
*/
setSerdeContext(serdeContext: SerdeFunctions): void;
write(schema: ISchema, value: unknown): void;
flush(): string | Uint8Array;
}
import { CodecSettings, Schema, ShapeSerializer } from "@smithy/types";
import { SerdeContext } from "../SerdeContext";
/**
* Serializes a shape to string.
*
* @public
*/
export declare class ToStringShapeSerializer extends SerdeContext implements ShapeSerializer<string> {
private settings;
private stringBuffer;
constructor(settings: CodecSettings);
write(schema: Schema, value: unknown): void;
flush(): string;
}
import { ConfigurableSerdeContext, SerdeFunctions } from "@smithy/types";
/**
* This in practice should be the client config object.
* @internal
*/
type SerdeContextType = SerdeFunctions & {
disableHostPrefix?: boolean;
};
/**
* @internal
*/
export declare abstract class SerdeContext implements ConfigurableSerdeContext {
protected serdeContext?: SerdeContextType;
setSerdeContext(serdeContext: SerdeContextType): void;
}
export {};
/**
* @internal
*/
export declare const escapeUriPath: (uri: string) => string;
/**
* @internal
*/
export declare const escapeUri: (uri: string) => string;
export { isRetryableByTrait, isClockSkewError, isClockSkewCorrectedError, isBrowserNetworkError, isThrottlingError, isTransientError, isServerError, isNodeJsHttp2TransientError, } from "./service-error-classification/service-error-classification";
export { AdaptiveRetryStrategy, AdaptiveRetryStrategyOptions } from "./util-retry/AdaptiveRetryStrategy";
export { ConfiguredRetryStrategy } from "./util-retry/ConfiguredRetryStrategy";
export { DefaultRateLimiter, DefaultRateLimiterOptions } from "./util-retry/DefaultRateLimiter";
export { StandardRetryStrategy, StandardRetryStrategyOptions } from "./util-retry/StandardRetryStrategy";
export { RETRY_MODES, DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "./util-retry/config";
export { DEFAULT_RETRY_DELAY_BASE, MAXIMUM_RETRY_DELAY, THROTTLING_RETRY_DELAY_BASE, INITIAL_RETRY_TOKENS, RETRY_COST, TIMEOUT_RETRY_COST, NO_RETRY_INCREMENT, INVOCATION_ID_HEADER, REQUEST_HEADER, } from "./util-retry/constants";
export { RateLimiter } from "./util-retry/types";
export { Retry } from "./util-retry/retries-2026-config";
export { AdaptiveRetryStrategy as DeprecatedAdaptiveRetryStrategy, AdaptiveRetryStrategyOptions as DeprecatedAdaptiveRetryStrategyOptions } from "./middleware-retry/retry-pre-sra-deprecated/AdaptiveRetryStrategy";
export { StandardRetryStrategy as DeprecatedStandardRetryStrategy, StandardRetryStrategyOptions as DeprecatedStandardRetryStrategyOptions } from "./middleware-retry/retry-pre-sra-deprecated/StandardRetryStrategy";
export { defaultDelayDecider } from "./middleware-retry/retry-pre-sra-deprecated/delayDecider";
export { defaultRetryDecider } from "./middleware-retry/retry-pre-sra-deprecated/retryDecider";
export declare const ENV_MAX_ATTEMPTS: symbol;
export declare const CONFIG_MAX_ATTEMPTS: symbol;
export declare const NODE_MAX_ATTEMPT_CONFIG_OPTIONS: symbol;
export declare const ENV_RETRY_MODE: symbol;
export declare const CONFIG_RETRY_MODE: symbol;
export declare const NODE_RETRY_MODE_CONFIG_OPTIONS: symbol;
export { resolveRetryConfig } from "./middleware-retry/configurations";
export { RetryInputConfig, RetryResolvedConfig, PreviouslyResolved } from "./middleware-retry/configurations";
export { omitRetryHeadersMiddleware, omitRetryHeadersMiddlewareOptions, getOmitRetryHeadersPlugin, } from "./middleware-retry/omitRetryHeadersMiddleware";
export { retryMiddlewareOptions } from "./middleware-retry/retryMiddleware";
export { getRetryAfterHint } from "./middleware-retry/parseRetryAfterHeader";
export declare const retryMiddleware: (options: import("./middleware-retry/configurations").RetryResolvedConfig) => <Output extends import("@smithy/types").MetadataBearer = import("@smithy/types").MetadataBearer>(next: import("@smithy/types").FinalizeHandler<any, Output>, context: import("@smithy/types").HandlerExecutionContext) => import("@smithy/types").FinalizeHandler<any, Output>;
export declare const getRetryPlugin: (options: import("./middleware-retry/configurations").RetryResolvedConfig) => import("@smithy/types").Pluggable<any, any>;
export { isRetryableByTrait, isClockSkewError, isClockSkewCorrectedError, isBrowserNetworkError, isThrottlingError, isTransientError, isServerError, isNodeJsHttp2TransientError, } from "./service-error-classification/service-error-classification";
export { AdaptiveRetryStrategy, AdaptiveRetryStrategyOptions } from "./util-retry/AdaptiveRetryStrategy";
export { ConfiguredRetryStrategy } from "./util-retry/ConfiguredRetryStrategy";
export { DefaultRateLimiter, DefaultRateLimiterOptions } from "./util-retry/DefaultRateLimiter";
export { StandardRetryStrategy, StandardRetryStrategyOptions } from "./util-retry/StandardRetryStrategy";
export { RETRY_MODES, DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "./util-retry/config";
export { DEFAULT_RETRY_DELAY_BASE, MAXIMUM_RETRY_DELAY, THROTTLING_RETRY_DELAY_BASE, INITIAL_RETRY_TOKENS, RETRY_COST, TIMEOUT_RETRY_COST, NO_RETRY_INCREMENT, INVOCATION_ID_HEADER, REQUEST_HEADER, } from "./util-retry/constants";
export { RateLimiter } from "./util-retry/types";
export { Retry } from "./util-retry/retries-2026-config";
export { AdaptiveRetryStrategy as DeprecatedAdaptiveRetryStrategy, AdaptiveRetryStrategyOptions as DeprecatedAdaptiveRetryStrategyOptions } from "./middleware-retry/retry-pre-sra-deprecated/AdaptiveRetryStrategy";
export { StandardRetryStrategy as DeprecatedStandardRetryStrategy, StandardRetryStrategyOptions as DeprecatedStandardRetryStrategyOptions } from "./middleware-retry/retry-pre-sra-deprecated/StandardRetryStrategy";
export { defaultDelayDecider } from "./middleware-retry/retry-pre-sra-deprecated/delayDecider";
export { defaultRetryDecider } from "./middleware-retry/retry-pre-sra-deprecated/retryDecider";
export { ENV_MAX_ATTEMPTS, CONFIG_MAX_ATTEMPTS, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, ENV_RETRY_MODE, CONFIG_RETRY_MODE, NODE_RETRY_MODE_CONFIG_OPTIONS, resolveRetryConfig, } from "./middleware-retry/configurations";
export { RetryInputConfig, RetryResolvedConfig, PreviouslyResolved } from "./middleware-retry/configurations";
export { omitRetryHeadersMiddleware, omitRetryHeadersMiddlewareOptions, getOmitRetryHeadersPlugin, } from "./middleware-retry/omitRetryHeadersMiddleware";
export { retryMiddlewareOptions } from "./middleware-retry/retryMiddleware";
export { getRetryAfterHint } from "./middleware-retry/parseRetryAfterHeader";
export declare const retryMiddleware: (options: import("./middleware-retry/configurations").RetryResolvedConfig) => <Output extends import("@smithy/types").MetadataBearer = import("@smithy/types").MetadataBearer>(next: import("@smithy/types").FinalizeHandler<any, Output>, context: import("@smithy/types").HandlerExecutionContext) => import("@smithy/types").FinalizeHandler<any, Output>;
export declare const getRetryPlugin: (options: import("./middleware-retry/configurations").RetryResolvedConfig) => import("@smithy/types").Pluggable<any, any>;
import { LoadedConfigSelectors } from "@smithy/core/config";
import { Logger, Provider, RetryStrategy, RetryStrategyV2 } from "@smithy/types";
/**
* @internal
*/
export declare const ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS";
/**
* @internal
*/
export declare const CONFIG_MAX_ATTEMPTS = "max_attempts";
/**
* @internal
*/
export declare const NODE_MAX_ATTEMPT_CONFIG_OPTIONS: LoadedConfigSelectors<number>;
/**
* @public
*/
export interface RetryInputConfig {
/**
* The maximum number of times requests that encounter retryable failures should be attempted.
*/
maxAttempts?: number | Provider<number>;
/**
* The strategy to retry the request. Using built-in exponential backoff strategy by default.
*/
retryStrategy?: RetryStrategy | RetryStrategyV2;
}
/**
* @internal
*/
export interface PreviouslyResolved {
/**
* Specifies provider for retry algorithm to use.
* @internal
*/
retryMode: string | Provider<string>;
logger?: Logger;
}
/**
* @internal
*/
export interface RetryResolvedConfig {
/**
* Resolved value for input config {@link RetryInputConfig.maxAttempts}
*/
maxAttempts: Provider<number>;
/**
* Resolved value for input config {@link RetryInputConfig.retryStrategy}
*/
retryStrategy: Provider<RetryStrategyV2 | RetryStrategy>;
logger?: Logger;
}
/**
* @internal
*/
export declare const resolveRetryConfig: <T>(input: T & PreviouslyResolved & RetryInputConfig, defaults?: {
defaultMaxAttempts?: number;
defaultBaseDelay?: number;
}) => T & RetryResolvedConfig;
/**
* @internal
*/
export declare const ENV_RETRY_MODE = "AWS_RETRY_MODE";
/**
* @internal
*/
export declare const CONFIG_RETRY_MODE = "retry_mode";
/**
* @internal
*/
export declare const NODE_RETRY_MODE_CONFIG_OPTIONS: LoadedConfigSelectors<string>;
import { HttpRequest } from "@smithy/core/protocols";
/**
* @internal
*/
export declare const isStreamingPayload: (request: HttpRequest) => boolean;
import { HttpRequest } from "@smithy/core/protocols";
/**
* @internal
*/
export declare const isStreamingPayload: (request: HttpRequest) => boolean;
import { HandlerExecutionContext, InitializeHandler, InitializeHandlerOptions, MetadataBearer, Pluggable } from "@smithy/types";
import { RetryResolvedConfig } from "./configurations";
/**
* This middleware is attached to operations designated as long-polling.
* @internal
*/
export declare const longPollMiddleware: () => <Output extends MetadataBearer = MetadataBearer>(next: InitializeHandler<any, Output>, context: HandlerExecutionContext) => InitializeHandler<any, Output>;
/**
* @internal
*/
export declare const longPollMiddlewareOptions: InitializeHandlerOptions;
/**
* @internal
*/
export declare const getLongPollPlugin: (options: RetryResolvedConfig) => Pluggable<any, any>;
import { FinalizeHandler, MetadataBearer, Pluggable, RelativeMiddlewareOptions } from "@smithy/types";
/**
* This is still in use.
* See AddOmitRetryHeadersDependency.java.
* @internal
*/
export declare const omitRetryHeadersMiddleware: () => <Output extends MetadataBearer = MetadataBearer>(next: FinalizeHandler<any, Output>) => FinalizeHandler<any, Output>;
/**
* @internal
*/
export declare const omitRetryHeadersMiddlewareOptions: RelativeMiddlewareOptions;
/**
* @internal
*/
export declare const getOmitRetryHeadersPlugin: (options: unknown) => Pluggable<any, any>;
import { Logger } from "@smithy/types";
/**
* @internal
*/
export declare function parseRetryAfterHeader(response: unknown, logger?: Logger): Date | undefined;
/**
* Backwards-compatibility alias.
* @internal
*/
export declare function getRetryAfterHint(response: unknown, logger?: Logger): Date | undefined;
import { FinalizeHandler, FinalizeHandlerArguments, MetadataBearer, Provider } from "@smithy/types";
import { RateLimiter } from "../../util-retry/types";
import { StandardRetryStrategy, StandardRetryStrategyOptions } from "./StandardRetryStrategy";
/**
* Strategy options to be passed to AdaptiveRetryStrategy
* @public
* @deprecated replaced by \@smithy/util-retry (SRA).
*/
export interface AdaptiveRetryStrategyOptions extends StandardRetryStrategyOptions {
rateLimiter?: RateLimiter;
}
/**
* @public
* @deprecated use AdaptiveRetryStrategy from @smithy/util-retry
*/
export declare class AdaptiveRetryStrategy extends StandardRetryStrategy {
private rateLimiter;
constructor(maxAttemptsProvider: Provider<number>, options?: AdaptiveRetryStrategyOptions);
retry<Input extends object, Ouput extends MetadataBearer>(next: FinalizeHandler<Input, Ouput>, args: FinalizeHandlerArguments<Input>): Promise<{
response: unknown;
output: Ouput;
}>;
}
import { RetryQuota } from "./types";
/**
* @internal
* @deprecated replaced by \@smithy/util-retry (SRA).
*/
export interface DefaultRetryQuotaOptions {
/**
* The total amount of retry token to be incremented from retry token balance
* if an SDK operation invocation succeeds without requiring a retry request.
*/
noRetryIncrement?: number;
/**
* The total amount of retry tokens to be decremented from retry token balance.
*/
retryCost?: number;
/**
* The total amount of retry tokens to be decremented from retry token balance
* when a throttling error is encountered.
*/
timeoutRetryCost?: number;
}
/**
* @internal
* @deprecated replaced by \@smithy/util-retry (SRA).
*/
export declare const getDefaultRetryQuota: (initialRetryTokens: number, options?: DefaultRetryQuotaOptions) => RetryQuota;
/**
* Calculate a capped, fully-jittered exponential backoff time.
* @internal
* @deprecated replaced by \@smithy/util-retry (SRA).
*/
export declare const defaultDelayDecider: (delayBase: number, attempts: number) => number;
import { SdkError } from "@smithy/types";
/**
* @internal
* @deprecated this is only used in the deprecated StandardRetryStrategy. Do not use in new code.
*/
export declare const defaultRetryDecider: (error: SdkError) => boolean;
import { FinalizeHandler, FinalizeHandlerArguments, MetadataBearer, Provider, RetryStrategy } from "@smithy/types";
import { DelayDecider, RetryDecider, RetryQuota } from "./types";
/**
* Strategy options to be passed to StandardRetryStrategy
* @public
* @deprecated use StandardRetryStrategy from @smithy/util-retry
*/
export interface StandardRetryStrategyOptions {
retryDecider?: RetryDecider;
delayDecider?: DelayDecider;
retryQuota?: RetryQuota;
}
/**
* @public
* @deprecated use StandardRetryStrategy from @smithy/util-retry
*/
export declare class StandardRetryStrategy implements RetryStrategy {
private readonly maxAttemptsProvider;
private retryDecider;
private delayDecider;
private retryQuota;
mode: string;
constructor(maxAttemptsProvider: Provider<number>, options?: StandardRetryStrategyOptions);
private shouldRetry;
private getMaxAttempts;
retry<Input extends object, Ouput extends MetadataBearer>(next: FinalizeHandler<Input, Ouput>, args: FinalizeHandlerArguments<Input>, options?: {
beforeRequest: Function;
afterRequest: Function;
}): Promise<{
response: unknown;
output: Ouput;
}>;
}
import { SdkError } from "@smithy/types";
/**
* Determines whether an error is retryable based on the number of retries
* already attempted, the HTTP status code, and the error received (if any).
*
* @param error - The error encountered.
*
* @deprecated
* @internal
*/
export interface RetryDecider {
(error: SdkError): boolean;
}
/**
* Determines the number of milliseconds to wait before retrying an action.
*
* @param delayBase - The base delay (in milliseconds).
* @param attempts - The number of times the action has already been tried.
*
* @deprecated
* @internal
*/
export interface DelayDecider {
(delayBase: number, attempts: number): number;
}
/**
* Interface that specifies the retry quota behavior.
* @deprecated
* @internal
*/
export interface RetryQuota {
/**
* returns true if retry tokens are available from the retry quota bucket.
*/
hasRetryTokens: (error: SdkError) => boolean;
/**
* returns token amount from the retry quota bucket.
* throws error is retry tokens are not available.
*/
retrieveRetryTokens: (error: SdkError) => number;
/**
* releases tokens back to the retry quota.
*/
releaseRetryTokens: (releaseCapacityAmount?: number) => void;
}
/**
* @deprecated
* @internal
*/
export interface RateLimiter {
/**
* If there is sufficient capacity (tokens) available, it immediately returns.
* If there is not sufficient capacity, it will either sleep a certain amount
* of time until the rate limiter can retrieve a token from its token bucket
* or raise an exception indicating there is insufficient capacity.
*/
getSendToken: () => Promise<void>;
/**
* Updates the client sending rate based on response.
* If the response was successful, the capacity and fill rate are increased.
* If the response was a throttling response, the capacity and fill rate are
* decreased. Transient errors do not affect the rate limiter.
*/
updateClientSendingRate: (response: any) => void;
}
import { HttpRequest } from "@smithy/core/protocols";
import { AbsoluteLocation, FinalizeHandler, FinalizeRequestHandlerOptions, HandlerExecutionContext, MetadataBearer, Pluggable } from "@smithy/types";
import { RetryResolvedConfig } from "./configurations";
/**
* @internal
*/
export type IsStreamingPayload = (request: HttpRequest) => boolean;
/**
* @internal
*/
export declare function bindRetryMiddleware(isStreamingPayload: IsStreamingPayload): (options: RetryResolvedConfig) => <Output extends MetadataBearer = MetadataBearer>(next: FinalizeHandler<any, Output>, context: HandlerExecutionContext) => FinalizeHandler<any, Output>;
/**
* @internal
*/
export declare const retryMiddlewareOptions: FinalizeRequestHandlerOptions & AbsoluteLocation;
/**
* @internal
*/
export declare function bindGetRetryPlugin(isStreamingPayload: IsStreamingPayload): (options: RetryResolvedConfig) => Pluggable<any, any>;
import { SdkError } from "@smithy/types";
export declare const asSdkError: (error: unknown) => SdkError;
/**
* Errors encountered when the client clock and server clock cannot agree on the
* current time.
*
* These errors are retryable, assuming the SDK has enabled clock skew
* correction.
*/
export declare const CLOCK_SKEW_ERROR_CODES: string[];
/**
* Errors that indicate the SDK is being throttled.
*
* These errors are always retryable.
*/
export declare const THROTTLING_ERROR_CODES: string[];
/**
* Error codes that indicate transient issues
*/
export declare const TRANSIENT_ERROR_CODES: string[];
/**
* Error codes that indicate transient issues
*/
export declare const TRANSIENT_ERROR_STATUS_CODES: number[];
/**
* Node.js system error codes that indicate timeout.
*/
export declare const NODEJS_TIMEOUT_ERROR_CODES: string[];
/**
* Node.js system error codes that indicate network error.
*/
export declare const NODEJS_NETWORK_ERROR_CODES: string[];
import { SdkError } from "@smithy/types";
export declare const isRetryableByTrait: (error: SdkError) => boolean;
/**
* @deprecated use isClockSkewCorrectedError. This is only used in deprecated code.
*/
export declare const isClockSkewError: (error: SdkError) => boolean;
/**
* @returns whether the error resulted in a systemClockOffset aka clock skew correction.
*/
export declare const isClockSkewCorrectedError: (error: SdkError) => true | undefined;
/**
*
* @internal
*/
export declare const isBrowserNetworkError: (error: SdkError) => boolean;
export declare const isThrottlingError: (error: SdkError) => boolean;
/**
* Though NODEJS_TIMEOUT_ERROR_CODES are platform specific, they are
* included here because there is an error scenario with unknown root
* cause where the NodeHttpHandler does not decorate the Error with
* the name "TimeoutError" to be checked by the TRANSIENT_ERROR_CODES condition.
*/
export declare const isTransientError: (error: SdkError, depth?: number) => boolean;
export declare const isServerError: (error: SdkError) => boolean;
/**
* @internal
*/
export declare function isNodeJsHttp2TransientError(error: Error & {
code?: string;
}): boolean;
import { Provider, RetryErrorInfo, RetryStrategyV2, RetryToken, StandardRetryToken } from "@smithy/types";
import { StandardRetryStrategyOptions } from "./StandardRetryStrategy";
import { RateLimiter } from "./types";
/**
* Strategy options to be passed to AdaptiveRetryStrategy
*
* @public
*/
export interface AdaptiveRetryStrategyOptions extends Partial<StandardRetryStrategyOptions> {
rateLimiter?: RateLimiter;
}
/**
* The AdaptiveRetryStrategy is a retry strategy for executing against a very
* resource constrained set of resources. Care should be taken when using this
* retry strategy. By default, it uses a dynamic backoff delay based on load
* currently perceived against the downstream resource and performs circuit
* breaking to disable retries in the event of high downstream failures using
* the DefaultRateLimiter.
*
* @public
*
* @see {@link StandardRetryStrategy}
* @see {@link DefaultRateLimiter }
*/
export declare class AdaptiveRetryStrategy implements RetryStrategyV2 {
readonly mode: string;
private rateLimiter;
private standardRetryStrategy;
constructor(maxAttemptsProvider: number | Provider<number>, options?: AdaptiveRetryStrategyOptions);
acquireInitialRetryToken(retryTokenScope: string): Promise<RetryToken>;
refreshRetryTokenForRetry(tokenToRenew: StandardRetryToken, errorInfo: RetryErrorInfo): Promise<RetryToken>;
recordSuccess(token: StandardRetryToken): void;
/**
* There is an existing integration which accesses this field.
* @deprecated
*/
maxAttemptsProvider(): Promise<number>;
}
/**
* @public
*/
export declare enum RETRY_MODES {
STANDARD = "standard",
ADAPTIVE = "adaptive"
}
/**
* The default value for how many HTTP requests an SDK should make for a
* single SDK operation invocation before giving up
*
* @public
*/
export declare const DEFAULT_MAX_ATTEMPTS = 3;
/**
* The default retry algorithm to use.
*
* @public
*/
export declare const DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD;
import { Provider, RetryBackoffStrategy, RetryStrategyV2 } from "@smithy/types";
import { StandardRetryStrategy } from "./StandardRetryStrategy";
/**
* This extension of the StandardRetryStrategy allows customizing the
* backoff computation.
*
* @public
*/
export declare class ConfiguredRetryStrategy extends StandardRetryStrategy implements RetryStrategyV2 {
private readonly computeNextBackoffDelay;
/**
* @param maxAttempts - the maximum number of retry attempts allowed.
* e.g., if set to 3, then 4 total requests are possible.
* @param computeNextBackoffDelay - a millisecond delay for each retry or a function that takes the retry attempt
* and returns the delay.
*
* @example exponential backoff.
* ```js
* new Client({
* retryStrategy: new ConfiguredRetryStrategy(3, (attempt) => attempt ** 2)
* });
* ```
* @example constant delay.
* ```js
* new Client({
* retryStrategy: new ConfiguredRetryStrategy(3, 2000)
* });
* ```
*/
constructor(maxAttempts: number | Provider<number>, computeNextBackoffDelay?: number | RetryBackoffStrategy["computeNextBackoffDelay"]);
}
/**
* The base number of milliseconds to use in calculating a suitable cool-down
* time when a retryable error is encountered.
*
* @public
*/
export declare const DEFAULT_RETRY_DELAY_BASE = 100;
/**
* The maximum amount of time (in milliseconds) that will be used as a delay
* between retry attempts.
*
* @public
*/
export declare const MAXIMUM_RETRY_DELAY: number;
/**
* The retry delay base (in milliseconds) to use when a throttling error is
* encountered.
*
* @public
*/
export declare const THROTTLING_RETRY_DELAY_BASE = 500;
/**
* Initial number of retry tokens in Retry Quota
*
* @public
*/
export declare const INITIAL_RETRY_TOKENS = 500;
/**
* The total amount of retry tokens to be decremented from retry token balance.
*
* @public
*/
export declare const RETRY_COST = 5;
/**
* The total amount of retry tokens to be decremented from retry token balance
* when a throttling error is encountered.
*
* @public
*/
export declare const TIMEOUT_RETRY_COST = 10;
/**
* The total amount of retry token to be incremented from retry token balance
* if an SDK operation invocation succeeds without requiring a retry request.
*
* @public
*
*/
export declare const NO_RETRY_INCREMENT = 1;
/**
* Header name for SDK invocation ID
*
* @public
*/
export declare const INVOCATION_ID_HEADER = "amz-sdk-invocation-id";
/**
* Header name for request retry information.
*
* @public
*/
export declare const REQUEST_HEADER = "amz-sdk-request";
import { RateLimiter } from "./types";
/**
* @public
*/
export interface DefaultRateLimiterOptions {
/**
* Coefficient for controlling how aggressively the rate decreases on throttle.
* @defaultValue 0.7
*/
beta?: number;
/**
* Minimum token bucket capacity in adaptive-tokens.
* @defaultValue 1
*/
minCapacity?: number;
/**
* Minimum fill rate in adaptive-tokens per second.
* @defaultValue 0.5
*/
minFillRate?: number;
/**
* Scale constant used in the cubic rate calculation.
* @defaultValue 0.4
*/
scaleConstant?: number;
/**
* Smoothing factor for the exponential moving average of the measured send rate.
* @defaultValue 0.8
*/
smooth?: number;
}
/**
* @public
*/
export declare class DefaultRateLimiter implements RateLimiter {
/**
* Only used in testing.
*/
private static setTimeoutFn;
private readonly beta;
private readonly minCapacity;
private readonly minFillRate;
private readonly scaleConstant;
private readonly smooth;
/**
* Whether adaptive retry rate limiting is active.
* Remains `false` until a throttling error is detected.
*/
private enabled;
/**
* Current number of available adaptive-tokens. When exhausted, requests wait based on fill rate.
*/
private availableTokens;
/**
* The most recent maximum fill rate in adaptive-tokens per second, recorded at the last throttle event.
*/
private lastMaxRate;
/**
* Smoothed measured send rate in requests per second.
*/
private measuredTxRate;
/**
* Number of requests observed in the current measurement time bucket.
*/
private requestCount;
/**
* Current token bucket fill rate in adaptive-tokens per second. Defaults to {@link minFillRate}.
*/
private fillRate;
/**
* Timestamp in seconds of the most recent throttle event.
*/
private lastThrottleTime;
/**
* Timestamp in seconds of the last token bucket refill.
*/
private lastTimestamp;
/**
* The time bucket (in seconds) used for measuring the send rate.
*/
private lastTxRateBucket;
/**
* Maximum token bucket capacity in adaptive-tokens. Defaults to {@link minCapacity}.
* Updated in {@link updateTokenBucketRate} to match the new fill rate, floored by {@link minCapacity}.
*/
private maxCapacity;
/**
* Calculated time window in seconds used in the cubic rate recovery function.
*/
private timeWindow;
constructor(options?: DefaultRateLimiterOptions);
getSendToken(): Promise<void>;
updateClientSendingRate(response: any): void;
private getCurrentTimeInSeconds;
private acquireTokenBucket;
private refillTokenBucket;
private calculateTimeWindow;
/**
* Returns a new fill rate in adaptive-tokens per second by reducing
* the given rate by a factor of {@link beta}.
*/
private cubicThrottle;
/**
* Returns a new fill rate in adaptive-tokens per second using a CUBIC
* congestion control curve. The rate recovers toward {@link lastMaxRate},
* then continues growing beyond it. The caller caps the result at
* `2 * measuredTxRate`.
*/
private cubicSuccess;
private enableTokenBucket;
/**
* Set a new fill rate for adaptive-tokens.
* The max capacity is updated to allow for one second of time to approximately
* refill the adaptive-token capacity.
*/
private updateTokenBucketRate;
private updateMeasuredRate;
private getPrecise;
}
import { StandardRetryBackoffStrategy } from "@smithy/types";
/**
* @internal
*/
export declare class DefaultRetryBackoffStrategy implements StandardRetryBackoffStrategy {
protected x: number;
/**
* @param i - attempt count starting from zero.
*/
computeNextBackoffDelay(i: number): number;
setDelayBase(delay: number): void;
}
import { StandardRetryToken } from "@smithy/types";
/**
* @internal
*/
export declare class DefaultRetryToken implements StandardRetryToken {
private readonly delay;
private readonly count;
private readonly cost;
private readonly longPoll;
$retryLog: {
acquisitionDelay: number;
};
constructor(delay: number, count: number, cost: number | undefined, longPoll: boolean);
getRetryCount(): number;
getRetryDelay(): number;
getRetryCost(): number | undefined;
isLongPoll(): boolean;
}
/**
* @internal
*/
export declare abstract class Retry {
static v2026: boolean;
static delay(): 50 | 100;
static throttlingDelay(): 1000 | 500;
static cost(): 5 | 14;
static throttlingCost(): 5 | 10;
static modifiedCostType(): "TRANSIENT" | "THROTTLING";
}
import { Provider, RetryErrorInfo, RetryStrategyV2, StandardRetryBackoffStrategy, StandardRetryToken } from "@smithy/types";
/**
* @public
*/
export type StandardRetryStrategyOptions = {
/**
* Maximum number of attempts. If set to 1, no retries will be made.
*/
maxAttempts: number;
/**
* When present, overrides the base delay for non-throttling retries.
*/
baseDelay?: number;
/**
* Backoff calculator.
*/
backoff?: StandardRetryBackoffStrategy;
};
/**
* @public
*/
export declare class StandardRetryStrategy implements RetryStrategyV2 {
readonly mode: string;
protected readonly retryBackoffStrategy: StandardRetryBackoffStrategy;
private capacity;
private readonly maxAttemptsProvider;
private readonly baseDelay;
constructor(maxAttempts: number);
constructor(maxAttemptsProvider: Provider<number>);
constructor(options: StandardRetryStrategyOptions);
acquireInitialRetryToken(retryTokenScope: string): Promise<StandardRetryToken>;
refreshRetryTokenForRetry(token: StandardRetryToken, errorInfo: RetryErrorInfo): Promise<StandardRetryToken>;
recordSuccess(token: StandardRetryToken): void;
/**
* This number decreases when retries are executed and refills when requests or retries succeed.
* @returns the current available retry capacity.
*/
getCapacity(): number;
/**
* There is an existing integration which accesses this field.
* @deprecated
*/
maxAttempts(): Promise<number>;
private getMaxAttempts;
/**
* 0 - OK to retry.
* 1 - error is not classified as retryable.
* 2 - attempt count exhausted.
* 3 - no capacity left (retry tokens exhausted).
*
* @returns 0 or the number of the highest priority (lowest integer) reason why retry is not possible.
*/
private retryCode;
private getCapacityCost;
private isRetryableError;
}
/**
* @public
*/
export interface RateLimiter {
/**
* If there is sufficient capacity (tokens) available, it immediately returns.
* If there is not sufficient capacity, it will either sleep a certain amount
* of time until the rate limiter can retrieve a token from its token bucket
* or raise an exception indicating there is insufficient capacity.
*/
getSendToken: () => Promise<void>;
/**
* Updates the client sending rate based on response.
* If the response was successful, the capacity and fill rate are increased.
* If the response was a throttling response, the capacity and fill rate are
* decreased. Transient errors do not affect the rate limiter.
*/
updateClientSendingRate: (response: any) => void;
}
import { Schema, SchemaRef } from "@smithy/types";
/**
* Dereferences a SchemaRef if needed.
* @internal
*/
export declare const deref: (schemaRef: SchemaRef) => Schema;
export { deref } from "./deref";
export { deserializerMiddlewareOption, getSchemaSerdePlugin, serializerMiddlewareOption, } from "./middleware/getSchemaSerdePlugin";
export { ListSchema, list } from "./schemas/ListSchema";
export { MapSchema, map } from "./schemas/MapSchema";
export { OperationSchema, op } from "./schemas/OperationSchema";
export { operation } from "./schemas/operation";
export { ErrorSchema, error } from "./schemas/ErrorSchema";
export { NormalizedSchema, isStaticSchema, simpleSchemaCacheN, simpleSchemaCacheS } from "./schemas/NormalizedSchema";
export { Schema } from "./schemas/Schema";
export { SimpleSchema, sim, simAdapter } from "./schemas/SimpleSchema";
export { StructureSchema, struct } from "./schemas/StructureSchema";
export { SCHEMA } from "./schemas/sentinels";
export { traitsCache, translateTraits } from "./schemas/translateTraits";
export { TypeRegistry } from "./TypeRegistry";
import { DeserializeHandlerOptions, MetadataBearer, Pluggable, SerializeHandlerOptions } from "@smithy/types";
import { PreviouslyResolved } from "./schema-middleware-types";
/**
* @internal
*/
export declare const deserializerMiddlewareOption: DeserializeHandlerOptions;
/**
* @internal
*/
export declare const serializerMiddlewareOption: SerializeHandlerOptions;
/**
* @internal
*/
export declare function getSchemaSerdePlugin<InputType extends object = any, OutputType extends MetadataBearer = any>(config: PreviouslyResolved): Pluggable<InputType, OutputType>;
import { ClientProtocol, SerdeContext, UrlParser } from "@smithy/types";
/**
* @internal
*/
export type PreviouslyResolved = Pick<SerdeContext & {
urlParser: UrlParser;
protocol: ClientProtocol<any, any>;
}, Exclude<keyof (SerdeContext & {
urlParser: UrlParser;
protocol: ClientProtocol<any, any>;
}), "endpoint">>;
import { DeserializeHandler, DeserializeHandlerArguments, HandlerExecutionContext } from "@smithy/types";
import { PreviouslyResolved } from "./schema-middleware-types";
/**
* @internal
*/
export declare const schemaDeserializationMiddleware: <O>(config: PreviouslyResolved) => (next: DeserializeHandler<any, any>, context: HandlerExecutionContext) => (args: DeserializeHandlerArguments<any>) => Promise<{
response: unknown;
output: O;
}>;
import { HandlerExecutionContext, SerializeHandler, SerializeHandlerArguments } from "@smithy/types";
import { PreviouslyResolved } from "./schema-middleware-types";
/**
* @internal
*/
export declare const schemaSerializationMiddleware: (config: PreviouslyResolved) => (next: SerializeHandler<any, any>, context: HandlerExecutionContext) => (args: SerializeHandlerArguments<any>) => Promise<import("@smithy/types").SerializeHandlerOutput<any>>;
import { SchemaRef, SchemaTraits } from "@smithy/types";
import { StructureSchema } from "./StructureSchema";
/**
* A schema for a structure shape having the error trait. These represent enumerated operation errors.
* Because Smithy-TS SDKs use classes for exceptions, whereas plain objects are used for all other data,
* and have an existing notion of a XYZServiceBaseException, the ErrorSchema differs from a StructureSchema
* by additionally holding the class reference for the corresponding ServiceException class.
*
* @internal
* @deprecated use StaticSchema
*/
export declare class ErrorSchema extends StructureSchema {
static readonly symbol: unique symbol;
/**
* @deprecated - field unused.
*/
ctor: any;
protected readonly symbol: symbol;
}
/**
* Factory for ErrorSchema, to reduce codegen output and register the schema.
*
* @internal
* @deprecated use StaticSchema
*
* @param namespace - shapeId namespace.
* @param name - shapeId name.
* @param traits - shape level serde traits.
* @param memberNames - list of member names.
* @param memberList - list of schemaRef corresponding to each
* @param ctor - class reference for the existing Error extending class.
*/
export declare const error: (namespace: string, name: string, traits: SchemaTraits, memberNames: string[], memberList: SchemaRef[],
/**
* @deprecated - field unused.
*/
ctor?: any) => ErrorSchema;
import { ListSchema as IListSchema, SchemaRef, SchemaTraits } from "@smithy/types";
import { Schema } from "./Schema";
/**
* A schema with a single member schema.
* The deprecated Set type may be represented as a list.
*
* @internal
* @deprecated use StaticSchema
*/
export declare class ListSchema extends Schema implements IListSchema {
static readonly symbol: unique symbol;
name: string;
traits: SchemaTraits;
valueSchema: SchemaRef;
protected readonly symbol: symbol;
}
/**
* Factory for ListSchema.
*
* @internal
* @deprecated use StaticSchema
*/
export declare const list: (namespace: string, name: string, traits: SchemaTraits, valueSchema: SchemaRef) => ListSchema;
import { MapSchema as IMapSchema, SchemaRef, SchemaTraits } from "@smithy/types";
import { Schema } from "./Schema";
/**
* A schema with a key schema and value schema.
* @internal
* @deprecated use StaticSchema
*/
export declare class MapSchema extends Schema implements IMapSchema {
static readonly symbol: unique symbol;
name: string;
traits: SchemaTraits;
/**
* This is expected to be StringSchema, but may have traits.
*/
keySchema: SchemaRef;
valueSchema: SchemaRef;
protected readonly symbol: symbol;
}
/**
* Factory for MapSchema.
* @internal
* @deprecated use StaticSchema
*/
export declare const map: (namespace: string, name: string, traits: SchemaTraits, keySchema: SchemaRef, valueSchema: SchemaRef) => MapSchema;
import { $MemberSchema, $Schema, $SchemaRef, NormalizedSchema as INormalizedSchema, SchemaRef, SchemaTraitsObject, StaticSchema } from "@smithy/types";
/**
* Cache for numeric schemaRef. Having separate cache objects for number/string improves
* lookup performance.
* @internal
*/
export declare const simpleSchemaCacheN: Array<NormalizedSchema | undefined>;
/**
* Cache for string schemaRef.
* @internal
*/
export declare const simpleSchemaCacheS: Record<string, NormalizedSchema>;
/**
* Wraps both class instances, numeric sentinel values, and member schema pairs.
* Presents a consistent interface for interacting with polymorphic schema representations.
*
* @public
*/
export declare class NormalizedSchema implements INormalizedSchema {
readonly ref: $SchemaRef;
private readonly memberName?;
static readonly symbol: unique symbol;
protected readonly symbol: symbol;
private readonly name;
private readonly schema;
private readonly _isMemberSchema;
private readonly traits;
private readonly memberTraits;
private normalizedTraits?;
/**
* @param ref - a polymorphic SchemaRef to be dereferenced/normalized.
* @param memberName - optional memberName if this NormalizedSchema should be considered a member schema.
*/
private constructor();
static [Symbol.hasInstance](lhs: unknown): lhs is NormalizedSchema;
/**
* Static constructor that attempts to avoid wrapping a NormalizedSchema within another.
*/
static of(ref: SchemaRef | $SchemaRef): NormalizedSchema;
/**
* @returns the underlying non-normalized schema.
*/
getSchema(): Exclude<$Schema, $MemberSchema | INormalizedSchema>;
/**
* @param withNamespace - qualifies the name.
* @returns e.g. `MyShape` or `com.namespace#MyShape`.
*/
getName(withNamespace?: boolean): string | undefined;
/**
* @returns the member name if the schema is a member schema.
*/
getMemberName(): string;
isMemberSchema(): boolean;
/**
* boolean methods on this class help control flow in shape serialization and deserialization.
*/
isListSchema(): boolean;
isMapSchema(): boolean;
/**
* To simplify serialization logic, static union schemas are considered a specialization
* of structs in the TypeScript typings and JS runtime, as well as static error schemas
* which have a different identifier.
*/
isStructSchema(): boolean;
isUnionSchema(): boolean;
isBlobSchema(): boolean;
isTimestampSchema(): boolean;
isUnitSchema(): boolean;
isDocumentSchema(): boolean;
isStringSchema(): boolean;
isBooleanSchema(): boolean;
isNumericSchema(): boolean;
isBigIntegerSchema(): boolean;
isBigDecimalSchema(): boolean;
isStreaming(): boolean;
/**
* @returns whether the schema has the idempotencyToken trait.
*/
isIdempotencyToken(): boolean;
/**
* @returns own traits merged with member traits, where member traits of the same trait key take priority.
* This method is cached.
*/
getMergedTraits(): SchemaTraitsObject;
/**
* @returns only the member traits. If the schema is not a member, this returns empty.
*/
getMemberTraits(): SchemaTraitsObject;
/**
* @returns only the traits inherent to the shape or member target shape if this schema is a member.
* If there are any member traits they are excluded.
*/
getOwnTraits(): SchemaTraitsObject;
/**
* @returns the map's key's schema. Returns a dummy Document schema if this schema is a Document.
*
* @throws Error if the schema is not a Map or Document.
*/
getKeySchema(): NormalizedSchema;
/**
* @returns the schema of the map's value or list's member.
* Returns a dummy Document schema if this schema is a Document.
*
* @throws Error if the schema is not a Map, List, nor Document.
*/
getValueSchema(): NormalizedSchema;
/**
* @returns the NormalizedSchema for the given member name. The returned instance will return true for `isMemberSchema()`
* and will have the member name given.
* @param memberName - which member to retrieve and wrap.
*
* @throws Error if member does not exist or the schema is neither a document nor structure.
* Note that errors are assumed to be structures and unions are considered structures for these purposes.
*/
getMemberSchema(memberName: string): NormalizedSchema;
/**
* This can be used for checking the members as a hashmap.
* Prefer the structIterator method for iteration.
*
* This does NOT return list and map members, it is only for structures.
*
* @deprecated use (checked) structIterator instead.
*
* @returns a map of member names to member schemas (normalized).
*/
getMemberSchemas(): Record<string, NormalizedSchema>;
/**
* @returns member name of event stream or empty string indicating none exists or this
* isn't a structure schema.
*/
getEventStreamMember(): string;
/**
* Allows iteration over members of a structure schema.
* Each yield is a pair of the member name and member schema.
*
* This avoids the overhead of calling Object.entries(ns.getMemberSchemas()).
*/
structIterator(): Generator<[
string,
NormalizedSchema
], undefined, undefined>;
}
/**
* @internal
*/
export declare const isStaticSchema: (sc: SchemaRef) => sc is StaticSchema;
import { OperationSchema, SchemaRef, SchemaTraits } from "@smithy/types";
/**
* Converts the static schema array into an object-form to adapt
* to the signature of ClientProtocol classes.
* @internal
*/
export declare const operation: (namespace: string, name: string, traits: SchemaTraits, input: SchemaRef, output: SchemaRef) => OperationSchema;
import { OperationSchema as IOperationSchema, SchemaRef, SchemaTraits } from "@smithy/types";
import { Schema } from "./Schema";
/**
* This is used as a reference container for the input/output pair of schema, and for trait
* detection on the operation that may affect client protocol logic.
*
* @internal
* @deprecated use StaticSchema
*/
export declare class OperationSchema extends Schema implements IOperationSchema {
static readonly symbol: unique symbol;
name: string;
traits: SchemaTraits;
input: SchemaRef;
output: SchemaRef;
protected readonly symbol: symbol;
}
/**
* Factory for OperationSchema.
* @internal
* @deprecated use StaticSchema
*/
export declare const op: (namespace: string, name: string, traits: SchemaTraits, input: SchemaRef, output: SchemaRef) => OperationSchema;
import { SchemaTraits, TraitsSchema } from "@smithy/types";
/**
* Abstract base for class-based Schema except NormalizedSchema.
*
* @internal
* @deprecated use StaticSchema
*/
export declare abstract class Schema implements TraitsSchema {
name: string;
namespace: string;
traits: SchemaTraits;
protected abstract readonly symbol: symbol;
static assign<T extends Schema>(instance: T, values: Pick<T, Exclude<keyof T, "getName" | "symbol">>): T;
static [Symbol.hasInstance](lhs: unknown): boolean;
getName(): string;
}
import { BigDecimalSchema, BigIntegerSchema, BlobSchema, BooleanSchema, DocumentSchema, ListSchemaModifier, MapSchemaModifier, NumericSchema, StreamingBlobSchema, StringSchema, TimestampDateTimeSchema, TimestampDefaultSchema, TimestampEpochSecondsSchema, TimestampHttpDateSchema } from "@smithy/types";
/**
* Schema sentinel runtime values.
* @internal
*
* @deprecated use inline numbers with type annotation to save space.
*/
export declare const SCHEMA: {
BLOB: BlobSchema;
STREAMING_BLOB: StreamingBlobSchema;
BOOLEAN: BooleanSchema;
STRING: StringSchema;
NUMERIC: NumericSchema;
BIG_INTEGER: BigIntegerSchema;
BIG_DECIMAL: BigDecimalSchema;
DOCUMENT: DocumentSchema;
TIMESTAMP_DEFAULT: TimestampDefaultSchema;
TIMESTAMP_DATE_TIME: TimestampDateTimeSchema;
TIMESTAMP_HTTP_DATE: TimestampHttpDateSchema;
TIMESTAMP_EPOCH_SECONDS: TimestampEpochSecondsSchema;
LIST_MODIFIER: ListSchemaModifier;
MAP_MODIFIER: MapSchemaModifier;
};
import { SchemaRef, SchemaTraits, TraitsSchema } from "@smithy/types";
import { Schema } from "./Schema";
/**
* Although numeric values exist for most simple schema, this class is used for cases where traits are
* attached to those schema, since a single number cannot easily represent both a schema and its traits.
*
* @internal
* @deprecated use StaticSchema
*/
export declare class SimpleSchema extends Schema implements TraitsSchema {
static readonly symbol: unique symbol;
name: string;
schemaRef: SchemaRef;
traits: SchemaTraits;
protected readonly symbol: symbol;
}
/**
* Factory for simple schema class objects.
*
* @internal
* @deprecated use StaticSchema
*/
export declare const sim: (namespace: string, name: string, schemaRef: SchemaRef, traits: SchemaTraits) => SimpleSchema;
/**
* @internal
* @deprecated
*/
export declare const simAdapter: (namespace: string, name: string, traits: SchemaTraits, schemaRef: SchemaRef) => SimpleSchema;
import { StructureSchema as IStructureSchema, SchemaRef, SchemaTraits } from "@smithy/types";
import { Schema } from "./Schema";
/**
* A structure schema has a known list of members. This is also used for unions.
*
* @internal
* @deprecated use StaticSchema
*/
export declare class StructureSchema extends Schema implements IStructureSchema {
static symbol: symbol;
name: string;
traits: SchemaTraits;
memberNames: string[];
memberList: SchemaRef[];
protected readonly symbol: symbol;
}
/**
* Factory for StructureSchema.
*
* @internal
* @deprecated use StaticSchema
*/
export declare const struct: (namespace: string, name: string, traits: SchemaTraits, memberNames: string[], memberList: SchemaRef[]) => StructureSchema;
import { SchemaTraits, SchemaTraitsObject } from "@smithy/types";
/**
* Module-level cache for translateTraits() numeric bitmask inputs.
*
* @internal
*/
export declare const traitsCache: SchemaTraitsObject[];
/**
* @internal
* @param indicator - numeric indicator for preset trait combination.
* @returns equivalent trait object.
*/
export declare function translateTraits(indicator: SchemaTraits): SchemaTraitsObject;
import { Schema as ISchema, StaticErrorSchema } from "@smithy/types";
import { ErrorSchema } from "./schemas/ErrorSchema";
/**
* A way to look up schema by their ShapeId values.
*
* @public
*/
export declare class TypeRegistry {
readonly namespace: string;
private schemas;
private exceptions;
static readonly registries: Map<string, TypeRegistry>;
private constructor();
/**
* @param namespace - specifier.
* @returns the schema for that namespace, creating it if necessary.
*/
static for(namespace: string): TypeRegistry;
/**
* Copies entries from another instance without changing the namespace of self.
* The composition is additive but non-destructive and will not overwrite existing entries.
*
* @param other - another TypeRegistry.
*/
copyFrom(other: TypeRegistry): void;
/**
* Adds the given schema to a type registry with the same namespace, and this registry.
*
* @param shapeId - to be registered.
* @param schema - to be registered.
*/
register(shapeId: string, schema: ISchema): void;
/**
* @param shapeId - query.
* @returns the schema.
*/
getSchema(shapeId: string): ISchema;
/**
* Associates an error schema with its constructor.
*/
registerError(es: ErrorSchema | StaticErrorSchema, ctor: any): void;
/**
* @param es - query.
* @returns Error constructor that extends the service's base exception.
*/
getErrorCtor(es: ErrorSchema | StaticErrorSchema): any;
/**
* The smithy-typescript code generator generates a synthetic (i.e. unmodeled) base exception,
* because generated SDKs before the introduction of schemas have the notion of a ServiceBaseException, which
* is unique per service/model.
*
* This is generated under a unique prefix that is combined with the service namespace, and this
* method is used to retrieve it.
*
* The base exception synthetic schema is used when an error is returned by a service, but we cannot
* determine what existing schema to use to deserialize it.
*
* @returns the synthetic base exception of the service namespace associated with this registry instance.
*/
getBaseException(): StaticErrorSchema | undefined;
/**
* @param predicate - criterion.
* @returns a schema in this registry matching the predicate.
*/
find(predicate: (schema: ISchema) => boolean): number | "unit" | import("@smithy/types").StaticSimpleSchema | import("@smithy/types").StaticListSchema | import("@smithy/types").StaticMapSchema | import("@smithy/types").StaticStructureSchema | import("@smithy/types").StaticUnionSchema | StaticErrorSchema | import("@smithy/types").StaticOperationSchema | import("@smithy/types").NormalizedSchema | import("@smithy/types").TraitsSchema | import("@smithy/types").MemberSchema | undefined;
/**
* Unloads the current TypeRegistry.
*/
clear(): void;
private normalizeShapeId;
}
/**
* This deliberately avoids differentiating to Buffer.concat in Node.js in favor of being isomorphic.
* This implementation pattern is highly recognizable/optimizable by JS engines.
* @internal
*/
export declare function concatBytes(arrays: Uint8Array[], length?: number): Uint8Array;
import { SchemaRef } from "@smithy/types";
/**
* @internal
* @deprecated the former functionality has been internalized to the CborCodec.
*/
export declare const copyDocumentWithTransform: (source: any, schemaRef: SchemaRef, transform?: (_: any, schemaRef: SchemaRef) => any) => any;
/**
* Builds a proper UTC HttpDate timestamp from a Date object
* since not all environments will have this as the expected
* format.
* - Prior to ECMAScript 2018, the format of the return value
* - varied according to the platform. The most common return
* - value was an RFC-1123 formatted date stamp, which is a
* - slightly updated version of RFC-822 date stamps.
*
* @internal
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString}
*/
export declare function dateToUtcString(date: Date): string;
/**
* Parses a value into a Date. Returns undefined if the input is null or
* undefined, throws an error if the input is not a string that can be parsed
* as an RFC 3339 date.
* Input strings must conform to RFC3339 section 5.6, and cannot have a UTC
* offset. Fractional precision is supported.
*
* @internal
* @see {@link https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14}
* @param value - the value to parse
* @returns a Date or undefined
*/
export declare const parseRfc3339DateTime: (value: unknown) => Date | undefined;
/**
* Parses a value into a Date. Returns undefined if the input is null or
* undefined, throws an error if the input is not a string that can be parsed
* as an RFC 3339 date.
* Input strings must conform to RFC3339 section 5.6, and can have a UTC
* offset. Fractional precision is supported.
*
* @internal
* @see {@link https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14}
* @param value - the value to parse
* @returns a Date or undefined
*/
export declare const parseRfc3339DateTimeWithOffset: (value: unknown) => Date | undefined;
/**
* Parses a value into a Date. Returns undefined if the input is null or
* undefined, throws an error if the input is not a string that can be parsed
* as an RFC 7231 IMF-fixdate or obs-date.
* Input strings must conform to RFC7231 section 7.1.1.1. Fractional seconds are supported.
*
* @internal
* @see {@link https://datatracker.ietf.org/doc/html/rfc7231.html#section-7.1.1.1}
* @param value - the value to parse
* @returns a Date or undefined
*/
export declare const parseRfc7231DateTime: (value: unknown) => Date | undefined;
/**
* Parses a value into a Date. Returns undefined if the input is null or
* undefined, throws an error if the input is not a number or a parseable string.
* Input strings must be an integer or floating point number. Fractional seconds are supported.
*
* @internal
* @param value - the value to parse
* @returns a Date or undefined
*/
export declare const parseEpochTimestamp: (value: unknown) => Date | undefined;
import { Checksum, SourceData } from "@smithy/types";
/**
* @internal
*/
export declare class Hash implements Checksum {
private readonly algorithmIdentifier;
private readonly secret?;
private hash;
constructor(algorithmIdentifier: string, secret?: SourceData);
update(toHash: SourceData, encoding?: "utf8" | "ascii" | "latin1"): void;
digest(): Promise<Uint8Array>;
reset(): void;
}
import { fromBase64 } from "./util-base64/fromBase64.browser";
import { toBase64 } from "./util-base64/toBase64.browser";
import { fromUtf8 } from "./util-utf8/fromUtf8.browser";
import { toUtf8 } from "./util-utf8/toUtf8.browser";
export { copyDocumentWithTransform } from "./copyDocumentWithTransform";
export { dateToUtcString, parseRfc3339DateTime, parseRfc3339DateTimeWithOffset, parseRfc7231DateTime, parseEpochTimestamp, } from "./date-utils";
export { LazyJsonString, AutomaticJsonStringConversion } from "./lazy-json";
export { logger, parseBoolean, expectBoolean, expectNumber, expectFloat32, expectInt, expectInt32, expectShort, expectByte, expectNonNull, expectObject, expectString, expectUnion, expectLong, strictParseDouble, strictParseFloat, strictParseFloat32, strictParseLong, strictParseInt, strictParseInt32, strictParseShort, strictParseByte, limitedParseDouble, handleFloat, limitedParseFloat, limitedParseFloat32, } from "./parse-utils";
export { quoteHeader } from "./quote-header";
export { _parseEpochTimestamp, _parseRfc3339DateTimeWithOffset, _parseRfc7231DateTime, } from "./schema-serde-lib/schema-date-utils";
export { splitEvery } from "./split-every";
export { splitHeader } from "./split-header";
export { NumericValue, nv, NumericType } from "./value/NumericValue";
export { fromHex, toHex } from "./util-hex-encoding/hex-encoding";
export { toBase64, fromBase64 };
export { calculateBodyLength } from "./util-body-length/calculateBodyLength.browser";
export { toUint8Array } from "./util-utf8/toUint8Array.browser";
export { toUtf8, fromUtf8 };
export { concatBytes } from "./concatBytes";
export { StringEncoding } from "./util-buffer-from/buffer-from";
export declare const fromArrayBuffer: symbol;
export declare const fromString: symbol;
export { isArrayBuffer } from "./is-array-buffer/is-array-buffer";
export { deserializerMiddleware } from "./middleware-serde/deserializerMiddleware";
export { deserializerMiddlewareOption, serializerMiddlewareOption, getSerdePlugin, V1OrV2Endpoint } from "./middleware-serde/serdePlugin";
export { serializerMiddleware } from "./middleware-serde/serializerMiddleware";
export declare const Hash: symbol;
declare const Uint8ArrayBlobAdapter_base: import("./util-stream/blob/Uint8ArrayBlobAdapter").Uint8ArrayBlobAdapterConstructor;
export declare class Uint8ArrayBlobAdapter extends Uint8ArrayBlobAdapter_base {
}
export { ChecksumStream, ChecksumStreamInit } from "./util-stream/checksum/ChecksumStream.browser";
export { createChecksumStream } from "./util-stream/checksum/createChecksumStream.browser";
export { createBufferedReadable } from "./util-stream/createBufferedReadable.browser";
export { getAwsChunkedEncodingStream } from "./util-stream/getAwsChunkedEncodingStream.browser";
export { headStream } from "./util-stream/headStream.browser";
export { sdkStreamMixin } from "./util-stream/sdk-stream-mixin.browser";
export { splitStream } from "./util-stream/splitStream.browser";
export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
export { streamCollector } from "./util-stream/stream-collector.browser";
export declare const v4: () => string;
export declare const generateIdempotencyToken: () => string;
import { fromBase64 } from "./util-base64/fromBase64";
import { toBase64 } from "./util-base64/toBase64";
import { fromUtf8 } from "./util-utf8/fromUtf8";
import { toUtf8 } from "./util-utf8/toUtf8";
export { copyDocumentWithTransform } from "./copyDocumentWithTransform";
export { dateToUtcString, parseRfc3339DateTime, parseRfc3339DateTimeWithOffset, parseRfc7231DateTime, parseEpochTimestamp, } from "./date-utils";
export { LazyJsonString, AutomaticJsonStringConversion } from "./lazy-json";
export { logger, parseBoolean, expectBoolean, expectNumber, expectFloat32, expectInt, expectInt32, expectShort, expectByte, expectNonNull, expectObject, expectString, expectUnion, expectLong, strictParseDouble, strictParseFloat, strictParseFloat32, strictParseLong, strictParseInt, strictParseInt32, strictParseShort, strictParseByte, limitedParseDouble, handleFloat, limitedParseFloat, limitedParseFloat32, } from "./parse-utils";
export { quoteHeader } from "./quote-header";
export { _parseEpochTimestamp, _parseRfc3339DateTimeWithOffset, _parseRfc7231DateTime, } from "./schema-serde-lib/schema-date-utils";
export { splitEvery } from "./split-every";
export { splitHeader } from "./split-header";
export { NumericValue, nv, NumericType } from "./value/NumericValue";
export { fromHex, toHex } from "./util-hex-encoding/hex-encoding";
export { toBase64, fromBase64 };
export { calculateBodyLength } from "./util-body-length/calculateBodyLength";
export { toUint8Array } from "./util-utf8/toUint8Array";
export { toUtf8, fromUtf8 };
export { concatBytes } from "./concatBytes";
export { fromArrayBuffer, fromString, StringEncoding } from "./util-buffer-from/buffer-from";
export { isArrayBuffer } from "./is-array-buffer/is-array-buffer";
export { deserializerMiddleware } from "./middleware-serde/deserializerMiddleware";
export { deserializerMiddlewareOption, serializerMiddlewareOption, getSerdePlugin, V1OrV2Endpoint } from "./middleware-serde/serdePlugin";
export { serializerMiddleware } from "./middleware-serde/serializerMiddleware";
export { Hash } from "./hash-node/hash-node";
declare const Uint8ArrayBlobAdapter_base: import("./util-stream/blob/Uint8ArrayBlobAdapter").Uint8ArrayBlobAdapterConstructor;
export declare class Uint8ArrayBlobAdapter extends Uint8ArrayBlobAdapter_base {
}
export { ChecksumStream, ChecksumStreamInit } from "./util-stream/checksum/ChecksumStream";
export { createChecksumStream } from "./util-stream/checksum/createChecksumStream";
export { createBufferedReadable } from "./util-stream/createBufferedReadable";
export { getAwsChunkedEncodingStream } from "./util-stream/getAwsChunkedEncodingStream";
export { headStream } from "./util-stream/headStream";
export { sdkStreamMixin } from "./util-stream/sdk-stream-mixin";
export { splitStream } from "./util-stream/splitStream";
export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
export { streamCollector } from "./util-stream/stream-collector";
export declare const v4: () => string;
export declare const generateIdempotencyToken: () => string;
export { copyDocumentWithTransform } from "./copyDocumentWithTransform";
export { dateToUtcString, parseRfc3339DateTime, parseRfc3339DateTimeWithOffset, parseRfc7231DateTime, parseEpochTimestamp, } from "./date-utils";
export { LazyJsonString, AutomaticJsonStringConversion } from "./lazy-json";
export { logger, parseBoolean, expectBoolean, expectNumber, expectFloat32, expectInt, expectInt32, expectShort, expectByte, expectNonNull, expectObject, expectString, expectUnion, expectLong, strictParseDouble, strictParseFloat, strictParseFloat32, strictParseLong, strictParseInt, strictParseInt32, strictParseShort, strictParseByte, limitedParseDouble, handleFloat, limitedParseFloat, limitedParseFloat32, } from "./parse-utils";
export { quoteHeader } from "./quote-header";
export { _parseEpochTimestamp, _parseRfc3339DateTimeWithOffset, _parseRfc7231DateTime, } from "./schema-serde-lib/schema-date-utils";
export { splitEvery } from "./split-every";
export { splitHeader } from "./split-header";
export { NumericValue, nv, NumericType } from "./value/NumericValue";
export { fromHex, toHex } from "./util-hex-encoding/hex-encoding";
export { fromBase64 } from "./util-base64/fromBase64.browser";
export { toBase64 } from "./util-base64/toBase64.browser";
export { calculateBodyLength } from "./util-body-length/calculateBodyLength.browser";
export { fromUtf8 } from "./util-utf8/fromUtf8.browser";
export { toUint8Array } from "./util-utf8/toUint8Array.browser";
export { toUtf8 } from "./util-utf8/toUtf8.browser";
export { concatBytes } from "./concatBytes";
export { StringEncoding } from "./util-buffer-from/buffer-from";
export declare const fromArrayBuffer: symbol;
export declare const fromString: symbol;
export { isArrayBuffer } from "./is-array-buffer/is-array-buffer";
export { deserializerMiddleware } from "./middleware-serde/deserializerMiddleware";
export { deserializerMiddlewareOption, serializerMiddlewareOption, getSerdePlugin, V1OrV2Endpoint } from "./middleware-serde/serdePlugin";
export { serializerMiddleware } from "./middleware-serde/serializerMiddleware";
export declare const Hash: symbol;
declare const Uint8ArrayBlobAdapter_base: import("./util-stream/blob/Uint8ArrayBlobAdapter").Uint8ArrayBlobAdapterConstructor;
export declare class Uint8ArrayBlobAdapter extends Uint8ArrayBlobAdapter_base {
}
export { ChecksumStream, ChecksumStreamInit } from "./util-stream/checksum/ChecksumStream.browser";
export { createChecksumStream } from "./util-stream/checksum/createChecksumStream.browser";
export { createBufferedReadable } from "./util-stream/createBufferedReadable.browser";
export { getAwsChunkedEncodingStream } from "./util-stream/getAwsChunkedEncodingStream.browser";
export { headStream } from "./util-stream/headStream.browser";
export { sdkStreamMixin } from "./util-stream/sdk-stream-mixin.browser";
export { splitStream } from "./util-stream/splitStream.browser";
export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
export { streamCollector } from "./util-stream/stream-collector.browser";
export declare const v4: () => string;
export declare const generateIdempotencyToken: () => string;
/**
* @internal
*/
export declare const isArrayBuffer: (arg: any) => arg is ArrayBuffer;
/**
* A model field with this type means that you may provide a JavaScript
* object in lieu of a JSON string, and it will be serialized to JSON
* automatically before being sent in a request.
* For responses, you will receive a "LazyJsonString", which is a boxed String object
* with additional mixin methods.
* To get the string value, call `.toString()`, or to get the JSON object value,
* call `.deserializeJSON()` or parse it yourself.
*
* @public
*/
export type AutomaticJsonStringConversion = Parameters<typeof JSON.stringify>[0] | LazyJsonString;
/**
* @internal
*/
export interface LazyJsonString extends String {
/**
* @returns the JSON parsing of the string value.
*/
deserializeJSON(): any;
/**
* @returns the original string value rather than a JSON.stringified value.
*/
toJSON(): string;
}
/**
* Extension of the native String class in the previous implementation
* has negative global performance impact on method dispatch for strings,
* and is generally discouraged.
* This current implementation may look strange, but is necessary to preserve the interface and
* behavior of extending the String class.
*
* @internal
*/
export declare const LazyJsonString: {
new (s: string): LazyJsonString;
(s: string): LazyJsonString;
from(s: any): LazyJsonString;
/**
* @deprecated use #from.
*/
fromObject(s: any): LazyJsonString;
};
import { DeserializeMiddleware, ResponseDeserializer, SerdeContext, SerdeFunctions } from "@smithy/types";
/**
* @internal
* @deprecated will be replaced by schemaSerdePlugin from core/schema.
*/
export declare const deserializerMiddleware: <Input extends object = any, Output extends object = any, CommandSerdeContext extends SerdeContext = any>(options: SerdeFunctions, deserializer: ResponseDeserializer<any, any, CommandSerdeContext>) => DeserializeMiddleware<Input, Output>;
import { DeserializeHandlerOptions, Endpoint, MetadataBearer, Pluggable, Provider, RequestSerializer, ResponseDeserializer, SerdeContext, SerdeFunctions, SerializeHandlerOptions, UrlParser } from "@smithy/types";
/**
* @deprecated will be replaced by schemaSerdePlugin from core/schema.
*/
export declare const deserializerMiddlewareOption: DeserializeHandlerOptions;
/**
* @deprecated will be replaced by schemaSerdePlugin from core/schema.
*/
export declare const serializerMiddlewareOption: SerializeHandlerOptions;
/**
* Modifies the EndpointBearer to make it compatible with Endpoints 2.0 change.
*
* @internal
* @deprecated
*/
export type V1OrV2Endpoint = {
urlParser?: UrlParser;
endpoint?: Provider<Endpoint>;
};
/**
* @internal
* @deprecated will be replaced by schemaSerdePlugin from core/schema.
*/
export declare function getSerdePlugin<InputType extends object = any, CommandSerdeContext extends SerdeContext = any, OutputType extends MetadataBearer = any>(config: SerdeFunctions, serializer: RequestSerializer<any, CommandSerdeContext>, deserializer: ResponseDeserializer<OutputType, any, CommandSerdeContext>): Pluggable<InputType, OutputType>;
import { RequestSerializer, SerdeContext, SerdeFunctions, SerializeMiddleware } from "@smithy/types";
/**
* @internal
* @deprecated will be replaced by schemaSerdePlugin from core/schema.
*/
export declare const serializerMiddleware: <Input extends object = any, Output extends object = any, CommandSerdeContext extends SerdeContext = any>(options: SerdeFunctions, serializer: RequestSerializer<any, CommandSerdeContext>) => SerializeMiddleware<Input, Output>;
/**
* Give an input string, strictly parses a boolean value.
*
* @internal
* @param value - The boolean string to parse.
* @returns true for "true", false for "false", otherwise an error is thrown.
*/
export declare const parseBoolean: (value: string) => boolean;
/**
* Asserts a value is a boolean and returns it.
* Casts strings and numbers with a warning if there is evidence that they were
* intended to be booleans.
* otherwise an error is thrown.
*
* @internal
* @param value - A value that is expected to be a boolean.
* @returns The value if it's a boolean, undefined if it's null/undefined,
*/
export declare const expectBoolean: (value: any) => boolean | undefined;
/**
* Asserts a value is a number and returns it.
* Casts strings with a warning if the string is a parseable number.
* This is to unblock slight API definition/implementation inconsistencies.
* otherwise an error is thrown.
*
* @internal
* @param value - A value that is expected to be a number.
* @returns The value if it's a number, undefined if it's null/undefined,
*/
export declare const expectNumber: (value: any) => number | undefined;
/**
* Asserts a value is a 32-bit float and returns it.
* otherwise an error is thrown.
*
* @internal
* @param value - A value that is expected to be a 32-bit float.
* @returns The value if it's a float, undefined if it's null/undefined,
*/
export declare const expectFloat32: (value: any) => number | undefined;
/**
* Asserts a value is an integer and returns it.
* otherwise an error is thrown.
*
* @internal
* @param value - A value that is expected to be an integer.
* @returns The value if it's an integer, undefined if it's null/undefined,
*/
export declare const expectLong: (value: any) => number | undefined;
/**
* @internal
*
* @deprecated Use expectLong
*/
export declare const expectInt: (value: any) => number | undefined;
/**
* Asserts a value is a 32-bit integer and returns it.
* otherwise an error is thrown.
*
* @internal
* @param value - A value that is expected to be an integer.
* @returns The value if it's an integer, undefined if it's null/undefined,
*/
export declare const expectInt32: (value: any) => number | undefined;
/**
* Asserts a value is a 16-bit integer and returns it.
* otherwise an error is thrown.
*
* @internal
* @param value - A value that is expected to be an integer.
* @returns The value if it's an integer, undefined if it's null/undefined,
*/
export declare const expectShort: (value: any) => number | undefined;
/**
* Asserts a value is an 8-bit integer and returns it.
* otherwise an error is thrown.
*
* @internal
* @param value - A value that is expected to be an integer.
* @returns The value if it's an integer, undefined if it's null/undefined,
*/
export declare const expectByte: (value: any) => number | undefined;
/**
* Asserts a value is not null or undefined and returns it, or throws an error.
*
* @internal
* @param value - A value that is expected to be defined
* @param location - The location where we're expecting to find a defined object (optional)
* @returns The value if it's not undefined, otherwise throws an error
*/
export declare const expectNonNull: <T>(value: T | null | undefined, location?: string) => T;
/**
* Asserts a value is an JSON-like object and returns it. This is expected to be used
* with values parsed from JSON (arrays, objects, numbers, strings, booleans).
* otherwise an error is thrown.
*
* @internal
* @param value - A value that is expected to be an object
* @returns The value if it's an object, undefined if it's null/undefined,
*/
export declare const expectObject: (value: any) => Record<string, any> | undefined;
/**
* Asserts a value is a string and returns it.
* Numbers and boolean will be cast to strings with a warning.
* otherwise an error is thrown.
*
* @internal
* @param value - A value that is expected to be a string.
* @returns The value if it's a string, undefined if it's null/undefined,
*/
export declare const expectString: (value: any) => string | undefined;
/**
* Asserts a value is a JSON-like object with only one non-null/non-undefined key and
* returns it.
* non-undefined key.
* an error is thrown.
*
* @internal
* @param value - A value that is expected to be an object with exactly one non-null,
* @returns the value if it's a union, undefined if it's null/undefined, otherwise
*/
export declare const expectUnion: (value: unknown) => Record<string, any> | undefined;
/**
* Parses a value into a double. If the value is null or undefined, undefined
* will be returned. If the value is a string, it will be parsed by the standard
* parseFloat with one exception: NaN may only be explicitly set as the string
* "NaN", any implicit Nan values will result in an error being thrown. If any
* other type is provided, an exception will be thrown.
*
* @internal
* @param value - A number or string representation of a double.
* @returns The value as a number, or undefined if it's null/undefined.
*/
export declare const strictParseDouble: (value: string | number) => number | undefined;
/**
* @internal
*
* @deprecated Use strictParseDouble
*/
export declare const strictParseFloat: (value: string | number) => number | undefined;
/**
* Parses a value into a float. If the value is null or undefined, undefined
* will be returned. If the value is a string, it will be parsed by the standard
* parseFloat with one exception: NaN may only be explicitly set as the string
* "NaN", any implicit Nan values will result in an error being thrown. If any
* other type is provided, an exception will be thrown.
*
* @internal
* @param value - A number or string representation of a float.
* @returns The value as a number, or undefined if it's null/undefined.
*/
export declare const strictParseFloat32: (value: string | number) => number | undefined;
/**
* Asserts a value is a number and returns it. If the value is a string
* representation of a non-numeric number type (NaN, Infinity, -Infinity),
* the value will be parsed. Any other string value will result in an exception
* being thrown. Null or undefined will be returned as undefined. Any other
* type will result in an exception being thrown.
*
* @internal
* @param value - A number or string representation of a non-numeric float.
* @returns The value as a number, or undefined if it's null/undefined.
*/
export declare const limitedParseDouble: (value: string | number) => number | undefined;
/**
* @internal
*
* @deprecated Use limitedParseDouble
*/
export declare const handleFloat: (value: string | number) => number | undefined;
/**
* @internal
*
* @deprecated Use limitedParseDouble
*/
export declare const limitedParseFloat: (value: string | number) => number | undefined;
/**
* Asserts a value is a 32-bit float and returns it. If the value is a string
* representation of a non-numeric number type (NaN, Infinity, -Infinity),
* the value will be parsed. Any other string value will result in an exception
* being thrown. Null or undefined will be returned as undefined. Any other
* type will result in an exception being thrown.
*
* @internal
* @param value - A number or string representation of a non-numeric float.
* @returns The value as a number, or undefined if it's null/undefined.
*/
export declare const limitedParseFloat32: (value: string | number) => number | undefined;
/**
* Parses a value into an integer. If the value is null or undefined, undefined
* will be returned. If the value is a string, it will be parsed by parseFloat
* and the result will be asserted to be an integer. If the parsed value is not
* an integer, or the raw value is any type other than a string or number, an
* exception will be thrown.
*
* @internal
* @param value - A number or string representation of an integer.
* @returns The value as a number, or undefined if it's null/undefined.
*/
export declare const strictParseLong: (value: string | number) => number | undefined;
/**
* @internal
*
* @deprecated Use strictParseLong
*/
export declare const strictParseInt: (value: string | number) => number | undefined;
/**
* Parses a value into a 32-bit integer. If the value is null or undefined, undefined
* will be returned. If the value is a string, it will be parsed by parseFloat
* and the result will be asserted to be an integer. If the parsed value is not
* an integer, or the raw value is any type other than a string or number, an
* exception will be thrown.
*
* @internal
* @param value - A number or string representation of a 32-bit integer.
* @returns The value as a number, or undefined if it's null/undefined.
*/
export declare const strictParseInt32: (value: string | number) => number | undefined;
/**
* Parses a value into a 16-bit integer. If the value is null or undefined, undefined
* will be returned. If the value is a string, it will be parsed by parseFloat
* and the result will be asserted to be an integer. If the parsed value is not
* an integer, or the raw value is any type other than a string or number, an
* exception will be thrown.
*
* @internal
* @param value - A number or string representation of a 16-bit integer.
* @returns The value as a number, or undefined if it's null/undefined.
*/
export declare const strictParseShort: (value: string | number) => number | undefined;
/**
* Parses a value into an 8-bit integer. If the value is null or undefined, undefined
* will be returned. If the value is a string, it will be parsed by parseFloat
* and the result will be asserted to be an integer. If the parsed value is not
* an integer, or the raw value is any type other than a string or number, an
* exception will be thrown.
*
* @internal
* @param value - A number or string representation of an 8-bit integer.
* @returns The value as a number, or undefined if it's null/undefined.
*/
export declare const strictParseByte: (value: string | number) => number | undefined;
/**
* @internal
*/
export declare const logger: {
warn: {
(...data: any[]): void;
(message?: any, ...optionalParams: any[]): void;
};
};
/**
* @public
* @param part - header list element
* @returns quoted string if part contains delimiter.
*/
export declare function quoteHeader(part: string): string;
/**
* Parses a value into a Date. Returns undefined if the input is null or
* undefined, throws an error if the input is not a number or a parseable string.
* Input strings must be an integer or floating point number. Fractional seconds are supported.
*
* @internal
* @param value - the value to parse
* @returns a Date or undefined
*/
export declare const _parseEpochTimestamp: (value: unknown) => Date | undefined;
/**
* Parses a value into a Date. Returns undefined if the input is null or
* undefined, throws an error if the input is not a string that can be parsed
* as an RFC 3339 date.
* Input strings must conform to RFC3339 section 5.6, and can have a UTC
* offset. Fractional precision is supported.
*
* @internal
* @see {@link https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14}
* @param value - the value to parse
* @returns a Date or undefined
*/
export declare const _parseRfc3339DateTimeWithOffset: (value: unknown) => Date | undefined;
/**
* Parses a value into a Date. Returns undefined if the input is null or
* undefined, throws an error if the input is not a string that can be parsed
* as an RFC 7231 date.
* Input strings must conform to RFC7231 section 7.1.1.1. Fractional seconds are supported.
* RFC 850 and unix asctime formats are also accepted.
* todo: practically speaking, are RFC 850 and asctime even used anymore?
* todo: can we remove those parts?
*
* @internal
* @see {@link https://datatracker.ietf.org/doc/html/rfc7231.html#section-7.1.1.1}
* @param value - the value to parse.
* @returns a Date or undefined.
*/
export declare const _parseRfc7231DateTime: (value: unknown) => Date | undefined;
/**
* Given an input string, splits based on the delimiter after a given
* number of delimiters has been encountered.
*
* @internal
* @param value - The input string to split.
* @param delimiter - The delimiter to split on.
* @param numDelimiters - The number of delimiters to have encountered to split.
*/
export declare function splitEvery(value: string, delimiter: string, numDelimiters: number): Array<string>;
/**
* @param value - header string value.
* @returns value split by commas that aren't in quotes.
*/
export declare const splitHeader: (value: string) => string[];
export declare const alphabetByEncoding: Record<string, number>;
export declare const alphabetByValue: Array<string>;
export declare const bitsPerLetter = 6;
export declare const bitsPerByte = 8;
export declare const maxLetterValue = 63;
/**
* Converts a base-64 encoded string to a Uint8Array of bytes.
*
* @param input The base-64 encoded string
*
* @see https://tools.ietf.org/html/rfc4648#section-4
*/
export declare const fromBase64: (input: string) => Uint8Array;
/**
* Converts a base-64 encoded string to a Uint8Array of bytes using Node.JS's
* `buffer` module.
*
* @param input The base-64 encoded string
*/
export declare const fromBase64: (input: string) => Uint8Array;
/**
* Converts a Uint8Array of binary data or a utf-8 string to a base-64 encoded string.
*
* @param _input - the binary data or string to encode.
* @returns base64 string.
*
* @see https://tools.ietf.org/html/rfc4648#section-4
*/
export declare function toBase64(_input: Uint8Array | string): string;
/**
* Converts a Uint8Array of binary data or a utf-8 string to a base-64 encoded string using
* Node.JS's `buffer` module.
*
* @param _input - the binary data or string to encode.
* @returns base64 string.
*/
export declare const toBase64: (_input: Uint8Array | string) => string;
/**
* @internal
*/
export declare const calculateBodyLength: (body: any) => number | undefined;
/**
* @internal
*/
export declare const calculateBodyLength: (body: any) => number | undefined;
/**
* @internal
*/
export declare const fromArrayBuffer: (input: ArrayBuffer, offset?: number, length?: number) => Buffer;
/**
* @internal
*/
export type StringEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex";
/**
* @internal
*/
export declare const fromString: (input: string, encoding?: StringEncoding) => Buffer;
/**
* Converts a hexadecimal encoded string to a Uint8Array of bytes.
*
* @param encoded The hexadecimal encoded string
*/
export declare function fromHex(encoded: string): Uint8Array;
/**
* Converts a Uint8Array of binary data to a hexadecimal encoded string.
*
* @param bytes The binary data to encode
*/
export declare function toHex(bytes: Uint8Array): string;
import { Decoder, Encoder } from "@smithy/types";
/**
* Adapter for conversions of the native Uint8Array type.
* @public
*/
export interface IUint8ArrayBlobAdapter extends Uint8Array {
/**
* @param encoding - default 'utf-8'.
* @returns the blob as string.
*/
transformToString(encoding?: string): string;
}
export interface Uint8ArrayBlobAdapterConstructor {
new (...args: any): IUint8ArrayBlobAdapter;
fromString(source: string, encoding?: string): IUint8ArrayBlobAdapter;
mutate(source: Uint8Array): IUint8ArrayBlobAdapter;
}
export declare function bindUint8ArrayBlobAdapter(toUtf8: Encoder, fromUtf8: Decoder, toBase64: Encoder, fromBase64: Decoder): Uint8ArrayBlobAdapterConstructor;
/**
* Aggregates byteArrays on demand.
* @internal
*/
export declare class ByteArrayCollector {
readonly allocByteArray: (size: number) => Uint8Array;
byteLength: number;
private byteArrays;
constructor(allocByteArray: (size: number) => Uint8Array);
push(byteArray: Uint8Array): void;
flush(): Uint8Array;
private reset;
}
import { Checksum, Encoder } from "@smithy/types";
/**
* @internal
*/
export interface ChecksumStreamInit {
/**
* Base64 value of the expected checksum.
*/
expectedChecksum: string;
/**
* For error messaging, the location from which the checksum value was read.
*/
checksumSourceLocation: string;
/**
* The checksum calculator.
*/
checksum: Checksum;
/**
* The stream to be checked.
*/
source: ReadableStream;
/**
* Optional base 64 encoder if calling from a request context.
*/
base64Encoder?: Encoder;
}
declare const ChecksumStream_base: any;
/**
* This stub exists so that the readable returned by createChecksumStream
* identifies as "ChecksumStream" in alignment with the Node.js
* implementation.
*
* @extends ReadableStream
*/
export declare class ChecksumStream extends ChecksumStream_base {
}
export {};
import { Readable } from "node:stream";
import { Checksum, Encoder } from "@smithy/types";
/**
* @internal
*/
export interface ChecksumStreamInit<T extends Readable | ReadableStream> {
/**
* Base64 value of the expected checksum.
*/
expectedChecksum: string;
/**
* For error messaging, the location from which the checksum value was read.
*/
checksumSourceLocation: string;
/**
* The checksum calculator.
*/
checksum: Checksum;
/**
* The stream to be checked.
*/
source: T;
/**
* Optional base 64 encoder if calling from a request context.
*/
base64Encoder?: Encoder;
}
/**
* Wrapper for throwing checksum errors for streams without
* buffering the stream.
*
* Note: this effectively behaves as a duplex, reading from the source on one
* side and forwarding chunks to its own readable side on the other. It should
* not be rewritten back into a Duplex (or Transform). The source is observed
* and driven manually (pause/resume in onSourceData/_read) so data is pulled
* at the rate it is consumed and never buffered twice; this manual control is
* used deliberately for performance and would be lost with the built-in duplex
* machinery.
*
* @internal
*/
export declare class ChecksumStream extends Readable {
private expectedChecksum;
private checksumSourceLocation;
private checksum;
private source;
private base64Encoder;
constructor({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder, }: ChecksumStreamInit<Readable>);
/**
* Update the checksum and forward each source chunk to the readable side,
* pausing the source when the readable side signals backpressure.
*/
private onSourceData;
/**
* When the source finishes, perform the checksum comparison and end this stream.
*/
private onSourceEnd;
/**
* Surface source errors on this stream.
*/
private onSourceError;
/**
* Resume the source so it flows at the rate this stream is consumed.
* Do not call this directly.
* @internal
*/
_read(size: number): void;
/**
* Destroy the upstream source for cleanup so it is not left dangling, then
* complete this stream's destruction. The error is intentionally not forwarded
* to the source as the source is typically internal and without an error listener
* The error still surfaces on this stream via the callback.
* Do not call this directly.
* @internal
*/
_destroy(error: Error | null, callback: (error?: Error | null | undefined) => void): void;
}
import { ChecksumStreamInit } from "./ChecksumStream.browser";
/**
* Alias prevents compiler from turning
* ReadableStream into ReadableStream<any>, which is incompatible
* with the NodeJS.ReadableStream global type.
* @internal
*/
export type ReadableStreamType = ReadableStream;
/**
* Creates a stream adapter for throwing checksum errors for streams without
* buffering the stream.
* @internal
*/
export declare const createChecksumStream: ({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder, }: ChecksumStreamInit) => ReadableStreamType;
import { Readable } from "node:stream";
import { ChecksumStreamInit } from "./ChecksumStream";
import { ReadableStreamType } from "./createChecksumStream.browser";
/**
* Creates a stream mirroring the input stream's interface, but
* performs checksumming when reading to the end of the stream.
* @internal
*/
export declare function createChecksumStream(init: ChecksumStreamInit<ReadableStreamType>): ReadableStreamType;
/**
* @internal
*/
export declare function createChecksumStream(init: ChecksumStreamInit<Readable>): Readable;
import { Logger } from "@smithy/types";
import { ByteArrayCollector } from "./ByteArrayCollector";
export type BufferStore = [
string,
ByteArrayCollector,
ByteArrayCollector?
];
export type BufferUnion = string | Uint8Array;
export type Modes = 0 | 1 | 2;
/**
* the minimum size is met, except for the last chunk.
*
* @internal
* @param upstream - any ReadableStream.
* @param size - byte or character length minimum. Buffering occurs when a chunk fails to meet this value.
* @param logger - for emitting warnings when buffering occurs.
* @returns another stream of the same data, but buffers chunks until
*/
export declare function createBufferedReadableStream(upstream: ReadableStream, size: number, logger?: Logger): ReadableStream;
/**
* Replaces R/RS polymorphic implementation in environments with only ReadableStream.
* @internal
*/
export declare const createBufferedReadable: typeof createBufferedReadableStream;
/**
* @internal
* @param buffers
* @param mode
* @param chunk
* @returns the new buffer size after merging the chunk with its appropriate buffer.
*/
export declare function merge(buffers: BufferStore, mode: Modes, chunk: string | Uint8Array): number;
/**
* @internal
* @param buffers
* @param mode
* @returns the buffer matching the mode.
*/
export declare function flush(buffers: BufferStore, mode: Modes | -1): BufferUnion;
/**
* @internal
* @param chunk
* @returns size of the chunk in bytes or characters.
*/
export declare function sizeOf(chunk?: {
byteLength?: number;
length?: number;
}): number;
/**
* @internal
* @param chunk - from upstream Readable.
* @param allowBuffer - allow mode 2 (Buffer), otherwise Buffer will return mode 1.
* @returns type index of the chunk.
*/
export declare function modeOf(chunk: BufferUnion, allowBuffer?: boolean): Modes | -1;
import { Readable } from "node:stream";
import { Logger } from "@smithy/types";
/**
* the minimum size is met, except for the last chunk.
*
* @internal
* @param upstream - any Readable or ReadableStream.
* @param size - byte or character length minimum. Buffering occurs when a chunk fails to meet this value.
* @param logger - for emitting warnings when buffering occurs.
* @returns another stream of the same data and stream class, but buffers chunks until
*/
export declare function createBufferedReadable(upstream: Readable, size: number, logger?: Logger): Readable;
/**
* @internal
*/
export declare function createBufferedReadable(upstream: ReadableStream, size: number, logger?: Logger): ReadableStream;
import { GetAwsChunkedEncodingStream } from "@smithy/types";
/**
* @internal
*/
export declare const getAwsChunkedEncodingStream: GetAwsChunkedEncodingStream<ReadableStream>;
import { Readable } from "node:stream";
import { GetAwsChunkedEncodingStreamOptions } from "@smithy/types";
/**
* @internal
*/
export declare function getAwsChunkedEncodingStream(stream: Readable, options: GetAwsChunkedEncodingStreamOptions): Readable;
/**
* @internal
*/
export declare function getAwsChunkedEncodingStream(stream: ReadableStream, options: GetAwsChunkedEncodingStreamOptions): ReadableStream;
/**
* Caution: the input stream must be destroyed separately, this function does not do so.
* @internal
* @param stream
* @param bytes - read head bytes from the stream and discard the rest of it.
*/
export declare function headStream(stream: ReadableStream, bytes: number): Promise<Uint8Array>;
import { Readable } from "node:stream";
/**
* Caution: the input stream must be destroyed separately, this function does not do so.
*
* @internal
* @param stream - to be read.
* @param bytes - read head bytes from the stream and discard the rest of it.
*/
export declare const headStream: (stream: Readable | ReadableStream, bytes: number) => Promise<Uint8Array>;
import { SdkStream } from "@smithy/types";
/**
* The stream handling utility functions for browsers and React Native
*
* @internal
*/
export declare const sdkStreamMixin: (stream: unknown) => SdkStream<ReadableStream | Blob>;
import { Readable } from "node:stream";
import { SdkStream } from "@smithy/types";
/**
* The function that mixes in the utility functions to help consuming runtime-specific payload stream.
*
* @internal
*/
export declare const sdkStreamMixin: (stream: unknown) => SdkStream<ReadableStream | Blob> | SdkStream<Readable>;
/**
* @param stream
* @returns stream split into two identical streams.
*/
export declare function splitStream(stream: ReadableStream | Blob): Promise<[
ReadableStream,
ReadableStream
]>;
import { Readable } from "node:stream";
/**
* @internal
* @param stream - to be split.
* @returns stream split into two identical streams.
*/
export declare function splitStream(stream: Readable): Promise<[
Readable,
Readable
]>;
/**
* @internal
*/
export declare function splitStream(stream: ReadableStream): Promise<[
ReadableStream,
ReadableStream
]>;
/**
* @internal
*/
export declare const streamCollector: (stream: Blob | ReadableStream) => Promise<Uint8Array>;
/**
* @internal
*/
export declare function collectBlob(blob: Blob): Promise<Uint8Array>;
/**
* @internal
*/
export declare function collectReadableStream(stream: ReadableStream): Promise<Uint8Array>;
import { Readable } from "node:stream";
import { ReadableStream as IReadableStream } from "node:stream/web";
/**
* @internal
*/
export declare const streamCollector: (stream: Readable | IReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
/**
* Alias prevents compiler from turning
* ReadableStream into ReadableStream<any>, which is incompatible
* with the NodeJS.ReadableStream global type.
*
* @internal
*/
type ReadableStreamType = ReadableStream;
/**
* @internal
*/
export declare const isReadableStream: (stream: unknown) => stream is ReadableStreamType;
/**
* @internal
*/
export declare const isBlob: (blob: unknown) => blob is Blob;
export {};
export declare const fromUtf8: (input: string) => Uint8Array;
export declare const fromUtf8: (input: string) => Uint8Array;
/**
* @internal
*/
export declare const toUint8Array: (data: string | ArrayBuffer | ArrayBufferView) => Uint8Array;
export declare const toUint8Array: (data: string | ArrayBuffer | ArrayBufferView) => Uint8Array;
/**
*
* This does not convert non-utf8 strings to utf8, it only passes through strings if
* a string is received instead of a Uint8Array.
*
*/
export declare const toUtf8: (input: Uint8Array | string) => string;
/**
*
* This does not convert non-utf8 strings to utf8, it only passes through strings if
* a string is received instead of a Uint8Array.
*
*/
export declare const toUtf8: (input: Uint8Array | string) => string;
/**
* @internal
*/
export type GetRandomValues = (array: Uint8Array) => Uint8Array;
/**
* Creates a RFC4122 version 4 UUID generator.
*
* Uses the native crypto.randomUUID() if available, otherwise falls back
* to a manual implementation using the provided getRandomValues function.
*
* The fallback implementation:
* - Generates 16 random bytes using getRandomValues()
* - Sets the version bits to indicate version 4
* - Sets the variant bits to indicate RFC4122
* - Formats the bytes as a UUID string with dashes
*
* @param getRandomValues - platform-specific random byte source.
* @returns A function that generates version 4 UUID strings
* in the format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
* where x is any hexadecimal digit and y is one of 8, 9, a, or b.
*
* @internal
*/
export declare function bindV4(getRandomValues: GetRandomValues): () => string;
/**
* Types which may be represented by {@link NumericValue}.
*
* There is currently only one option, because BigInteger and Long should
* use JS BigInt directly, and all other numeric types can be contained in JS Number.
*
* @public
*/
export type NumericType = "bigDecimal";
/**
* Serialization container for Smithy simple types that do not have a
* direct JavaScript runtime representation.
*
* This container does not perform numeric mathematical operations.
* It is a container for discerning a value's true type.
*
* It allows storage of numeric types not representable in JS without
* making a decision on what numeric library to use.
*
* @public
*/
export declare class NumericValue {
readonly string: string;
readonly type: NumericType;
constructor(string: string, type: NumericType);
toString(): string;
static [Symbol.hasInstance](object: unknown): boolean;
}
/**
* Serde shortcut.
* @internal
*/
export declare function nv(input: string | unknown): NumericValue;
import { HandlerExecutionContext } from "@smithy/types";
/**
* @internal
*/
export declare const getSmithyContext: (context: HandlerExecutionContext) => Record<string, unknown>;
import { HeaderBag, HttpMessage, HttpRequest as IHttpRequest, QueryParameterBag, URI } from "@smithy/types";
type HttpRequestOptions = Partial<HttpMessage> & Partial<URI> & {
method?: string;
};
/**
* Use the distinct IHttpRequest interface from \@smithy/types instead.
* This should not be used due to
* overlapping with the concrete class' name.
*
* This is not marked deprecated since that would mark the concrete class
* deprecated as well.
*
* @internal
*/
export interface HttpRequest extends IHttpRequest {
}
export { IHttpRequest };
/**
* @public
*/
export declare class HttpRequest implements HttpMessage, URI {
method: string;
protocol: string;
hostname: string;
port?: number;
path: string;
query: QueryParameterBag;
headers: HeaderBag;
username?: string;
password?: string;
fragment?: string;
body?: any;
constructor(options: HttpRequestOptions);
/**
* Note: this does not deep-clone the body.
*/
static clone(request: IHttpRequest): HttpRequest;
/**
* This method only actually asserts that request is the interface {@link IHttpRequest},
* and not necessarily this concrete class. Left in place for API stability.
*
* Do not call instance methods on the input of this function, and
* do not assume it has the HttpRequest prototype.
*/
static isInstance(request: unknown): request is HttpRequest;
/**
* @deprecated use static HttpRequest.clone(request) instead. It's not safe to call
* this method because {@link HttpRequest.isInstance} incorrectly
* asserts that IHttpRequest (interface) objects are of type HttpRequest (class).
*/
clone(): HttpRequest;
}
import { HeaderBag, HttpMessage, HttpResponse as IHttpResponse } from "@smithy/types";
type HttpResponseOptions = Partial<HttpMessage> & {
statusCode: number;
reason?: string;
};
/**
* Use the distinct IHttpResponse interface from \@smithy/types instead.
* This should not be used due to
* overlapping with the concrete class' name.
*
* This is not marked deprecated since that would mark the concrete class
* deprecated as well.
*
* @internal
*/
export interface HttpResponse extends IHttpResponse {
}
/**
* @public
*/
export declare class HttpResponse {
statusCode: number;
reason?: string;
headers: HeaderBag;
body?: any;
constructor(options: HttpResponseOptions);
static isInstance(response: unknown): response is HttpResponse;
}
export {};
export { getSmithyContext } from "./getSmithyContext";
export { HttpRequest } from "./httpRequest";
export { IHttpRequest } from "./httpRequest";
export { HttpResponse } from "./httpResponse";
export { isValidHostLabel } from "./isValidHostLabel";
export { isValidHostname } from "./isValidHostname";
export { normalizeProvider } from "./normalizeProvider";
export { parseQueryString } from "./parseQueryString";
export { parseUrl } from "./parseUrl";
export { toEndpointV1 } from "./toEndpointV1";
/**
* Evaluates whether one or more string values are valid host labels per RFC 1123.
*
* If allowSubDomains is true, then the provided value may be zero or more dotted
* subdomains which are each validated per RFC 1123.
*/
export declare const isValidHostLabel: (value: string, allowSubDomains?: boolean) => boolean;
export declare function isValidHostname(hostname: string): boolean;
import { Provider } from "@smithy/types";
/**
* @internal
*
* @returns a provider function for the input value if it isn't already one.
*/
export declare const normalizeProvider: <T>(input: T | Provider<T>) => Provider<T>;
import { QueryParameterBag } from "@smithy/types";
/**
* @internal
*/
export declare function parseQueryString(querystring: string): QueryParameterBag;
import { UrlParser } from "@smithy/types";
/**
* @internal
*/
export declare const parseUrl: UrlParser;
import { Endpoint, EndpointV2 } from "@smithy/types";
/**
* Converts an endpoint to EndpointV1 format.
* @internal
*/
export declare const toEndpointV1: (endpoint: string | Endpoint | EndpointV2) => Endpoint;
+2
-2
{
"name": "@smithy/core",
"version": "3.29.2",
"version": "3.29.3",
"scripts": {

@@ -173,3 +173,3 @@ "benchmark:cbor": "node ./scripts/cbor-perf.mjs",

"dependencies": {
"@smithy/types": "^4.16.0",
"@smithy/types": "^4.16.1",
"tslib": "^2.6.2"

@@ -176,0 +176,0 @@ },