From e42eb49a5bee13e43fd57769a6390bb4d7a518b8 Mon Sep 17 00:00:00 2001 From: George Fu Date: Tue, 31 Dec 2024 17:17:43 -0500 Subject: [PATCH] docs: fix various tsdoc tags (#1481) * docs: fix various tsdoc tags * set changeset to empty --- .changeset/proud-bats-unite.md | 2 ++ .../resolveCustomEndpointsConfig.ts | 3 ++ .../endpointsConfig/resolveEndpointsConfig.ts | 5 ++- .../src/EventStreamSerdeConfig.ts | 3 ++ .../src/fetch-http-handler.ts | 17 +++++----- .../src/resolveEndpointConfig.ts | 5 ++- .../src/AdaptiveRetryStrategy.ts | 2 ++ .../src/StandardRetryStrategy.ts | 3 ++ .../middleware-retry/src/configurations.ts | 22 +++++++++++++ .../middleware-retry/src/defaultRetryQuota.ts | 6 ++++ packages/middleware-retry/src/delayDecider.ts | 1 + .../src/omitRetryHeadersMiddleware.ts | 15 +++++++-- packages/middleware-retry/src/retryDecider.ts | 1 + .../middleware-retry/src/retryMiddleware.ts | 12 +++++++ packages/middleware-retry/src/types.ts | 12 +++++++ .../middleware-stack/src/MiddlewareStack.ts | 3 ++ .../node-config-provider/src/configLoader.ts | 9 ++++++ .../src/fromSharedConfigFiles.ts | 7 ++++ .../node-config-provider/src/fromStatic.ts | 14 ++++++++ .../src/node-http-handler.ts | 8 +++++ .../src/node-http2-connection-manager.ts | 3 ++ .../src/node-http2-handler.ts | 7 +++- .../src/set-socket-timeout.ts | 3 +- .../src/stream-collector/index.ts | 4 +++ packages/protocol-http/src/httpHandler.ts | 2 -- packages/protocol-http/src/httpRequest.ts | 4 ++- packages/protocol-http/src/httpResponse.ts | 13 ++++++++ .../src/getProfileName.ts | 11 +++++++ .../src/getSSOTokenFilepath.ts | 1 + .../src/getSSOTokenFromFile.ts | 2 ++ .../src/loadSharedConfigFiles.ts | 10 ++++++ .../src/loadSsoSessionData.ts | 7 ++++ .../src/parseKnownFiles.ts | 3 ++ packages/shared-ini-file-loader/src/types.ts | 9 ++++-- packages/signature-v4/src/SignatureV4.ts | 9 ++++++ .../signature-v4/src/credentialDerivation.ts | 22 +++++++------ .../signature-v4/src/getCanonicalHeaders.ts | 2 +- .../signature-v4/src/getCanonicalQuery.ts | 2 +- packages/signature-v4/src/getPayloadHash.ts | 2 +- .../signature-v4/src/moveHeadersToQuery.ts | 2 +- packages/signature-v4/src/prepareRequest.ts | 2 +- .../smithy-client/src/extensions/retry.ts | 3 ++ packages/smithy-client/src/ser-utils.ts | 1 + .../src/blob/blob-payload-input-types.ts | 1 + packages/types/src/client.ts | 1 + packages/types/src/connection/config.ts | 3 ++ packages/types/src/connection/manager.ts | 6 ++++ packages/types/src/connection/pool.ts | 8 +++++ packages/types/src/encode.ts | 12 +++++++ .../types/src/endpoints/EndpointRuleObject.ts | 14 ++++++++ .../types/src/endpoints/ErrorRuleObject.ts | 3 ++ packages/types/src/endpoints/RuleSetObject.ts | 9 ++++++ .../types/src/endpoints/TreeRuleObject.ts | 6 ++++ packages/types/src/endpoints/shared.ts | 32 +++++++++++++++++++ packages/types/src/eventStream.ts | 32 ++++++++++++++++++- packages/types/src/extensions/checksum.ts | 3 ++ packages/types/src/http.ts | 6 ++++ .../src/http/httpHandlerInitialization.ts | 5 +-- packages/types/src/serde.ts | 1 + .../streaming-blob-payload-input-types.ts | 2 +- packages/types/src/transfer.ts | 10 ++++-- packages/util-stream/src/headStream.ts | 2 +- packages/util-stream/src/splitStream.ts | 3 +- 63 files changed, 391 insertions(+), 42 deletions(-) create mode 100644 .changeset/proud-bats-unite.md diff --git a/.changeset/proud-bats-unite.md b/.changeset/proud-bats-unite.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/proud-bats-unite.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/packages/config-resolver/src/endpointsConfig/resolveCustomEndpointsConfig.ts b/packages/config-resolver/src/endpointsConfig/resolveCustomEndpointsConfig.ts index c261cf28bab..eb0e4ed4ebe 100644 --- a/packages/config-resolver/src/endpointsConfig/resolveCustomEndpointsConfig.ts +++ b/packages/config-resolver/src/endpointsConfig/resolveCustomEndpointsConfig.ts @@ -13,6 +13,9 @@ export interface CustomEndpointsInputConfig extends EndpointsInputConfig { endpoint: string | Endpoint | Provider; } +/** + * @internal + */ interface PreviouslyResolved { urlParser: UrlParser; } diff --git a/packages/config-resolver/src/endpointsConfig/resolveEndpointsConfig.ts b/packages/config-resolver/src/endpointsConfig/resolveEndpointsConfig.ts index 5e66f81fb76..8a8a810d2d0 100644 --- a/packages/config-resolver/src/endpointsConfig/resolveEndpointsConfig.ts +++ b/packages/config-resolver/src/endpointsConfig/resolveEndpointsConfig.ts @@ -24,6 +24,9 @@ export interface EndpointsInputConfig { useDualstackEndpoint?: boolean | Provider; } +/** + * @internal + */ interface PreviouslyResolved { regionInfoProvider: RegionInfoProvider; urlParser: UrlParser; @@ -55,7 +58,7 @@ export interface EndpointsResolvedConfig extends Required /** * @internal * - * @deprecated endpoints rulesets use @smithy/middleware-endpoint resolveEndpointConfig. + * @deprecated endpoints rulesets use \@smithy/middleware-endpoint resolveEndpointConfig. * All generated clients should migrate to Endpoints 2.0 endpointRuleSet traits. */ export const resolveEndpointsConfig = ( diff --git a/packages/eventstream-serde-config-resolver/src/EventStreamSerdeConfig.ts b/packages/eventstream-serde-config-resolver/src/EventStreamSerdeConfig.ts index be04cadbf08..9510dac9dcd 100644 --- a/packages/eventstream-serde-config-resolver/src/EventStreamSerdeConfig.ts +++ b/packages/eventstream-serde-config-resolver/src/EventStreamSerdeConfig.ts @@ -12,6 +12,9 @@ export interface EventStreamSerdeResolvedConfig { eventStreamMarshaller: EventStreamMarshaller; } +/** + * @internal + */ interface PreviouslyResolved { /** * Provide the event stream marshaller for the given runtime diff --git a/packages/fetch-http-handler/src/fetch-http-handler.ts b/packages/fetch-http-handler/src/fetch-http-handler.ts index dcd3dc05c97..5afbf44899c 100644 --- a/packages/fetch-http-handler/src/fetch-http-handler.ts +++ b/packages/fetch-http-handler/src/fetch-http-handler.ts @@ -8,10 +8,11 @@ import { requestTimeout } from "./request-timeout"; declare let AbortController: any; +/** + * @public + */ export { FetchHttpHandlerOptions }; -type FetchHttpHandlerConfig = FetchHttpHandlerOptions; - /** * @internal * Detection of keepalive support. Can be overridden for testing. @@ -35,9 +36,9 @@ export type AdditionalRequestParameters = { * * HttpHandler implementation using browsers' `fetch` global function. */ -export class FetchHttpHandler implements HttpHandler { - private config?: FetchHttpHandlerConfig; - private configProvider: Promise; +export class FetchHttpHandler implements HttpHandler { + private config?: FetchHttpHandlerOptions; + private configProvider: Promise; /** * @returns the input if it is an HttpHandler of any class, @@ -51,7 +52,7 @@ export class FetchHttpHandler implements HttpHandler { return instanceOrOptions as HttpHandler; } // input is ctor options or undefined. - return new FetchHttpHandler(instanceOrOptions as FetchHttpHandlerConfig); + return new FetchHttpHandler(instanceOrOptions as FetchHttpHandlerOptions); } constructor(options?: FetchHttpHandlerOptions | Provider) { @@ -199,7 +200,7 @@ export class FetchHttpHandler implements HttpHandler { return Promise.race(raceOfPromises).finally(removeSignalEventListener); } - updateHttpClientConfig(key: keyof FetchHttpHandlerConfig, value: FetchHttpHandlerConfig[typeof key]): void { + updateHttpClientConfig(key: keyof FetchHttpHandlerOptions, value: FetchHttpHandlerOptions[typeof key]): void { this.config = undefined; this.configProvider = this.configProvider.then((config) => { (config as Record)[key] = value; @@ -207,7 +208,7 @@ export class FetchHttpHandler implements HttpHandler { }); } - httpHandlerConfigs(): FetchHttpHandlerConfig { + httpHandlerConfigs(): FetchHttpHandlerOptions { return this.config ?? {}; } } diff --git a/packages/middleware-endpoint/src/resolveEndpointConfig.ts b/packages/middleware-endpoint/src/resolveEndpointConfig.ts index 168ed0a9a30..30c88309a94 100644 --- a/packages/middleware-endpoint/src/resolveEndpointConfig.ts +++ b/packages/middleware-endpoint/src/resolveEndpointConfig.ts @@ -51,6 +51,9 @@ export interface EndpointInputConfig { urlParser: UrlParser; region: Provider; @@ -63,7 +66,7 @@ interface PreviouslyResolved * @internal * * This supercedes the similarly named EndpointsResolvedConfig (no parametric types) - * from resolveEndpointsConfig.ts in @smithy/config-resolver. + * from resolveEndpointsConfig.ts in \@smithy/config-resolver. */ export interface EndpointResolvedConfig { /** diff --git a/packages/middleware-retry/src/AdaptiveRetryStrategy.ts b/packages/middleware-retry/src/AdaptiveRetryStrategy.ts index a893d3063dc..0c96b2f01ad 100644 --- a/packages/middleware-retry/src/AdaptiveRetryStrategy.ts +++ b/packages/middleware-retry/src/AdaptiveRetryStrategy.ts @@ -4,6 +4,7 @@ import { DefaultRateLimiter, RateLimiter, RETRY_MODES } from "@smithy/util-retry import { StandardRetryStrategy, StandardRetryStrategyOptions } from "./StandardRetryStrategy"; /** + * @public * Strategy options to be passed to AdaptiveRetryStrategy */ export interface AdaptiveRetryStrategyOptions extends StandardRetryStrategyOptions { @@ -11,6 +12,7 @@ export interface AdaptiveRetryStrategyOptions extends StandardRetryStrategyOptio } /** + * @public * @deprecated use AdaptiveRetryStrategy from @smithy/util-retry */ export class AdaptiveRetryStrategy extends StandardRetryStrategy { diff --git a/packages/middleware-retry/src/StandardRetryStrategy.ts b/packages/middleware-retry/src/StandardRetryStrategy.ts index 1dc685b0608..74d265fbe4f 100644 --- a/packages/middleware-retry/src/StandardRetryStrategy.ts +++ b/packages/middleware-retry/src/StandardRetryStrategy.ts @@ -21,6 +21,8 @@ import { asSdkError } from "./util"; /** * Strategy options to be passed to StandardRetryStrategy + * @public + * @deprecated use StandardRetryStrategy from @smithy/util-retry */ export interface StandardRetryStrategyOptions { retryDecider?: RetryDecider; @@ -29,6 +31,7 @@ export interface StandardRetryStrategyOptions { } /** + * @public * @deprecated use StandardRetryStrategy from @smithy/util-retry */ export class StandardRetryStrategy implements RetryStrategy { diff --git a/packages/middleware-retry/src/configurations.ts b/packages/middleware-retry/src/configurations.ts index 1b6fb7f01cd..f4c42e0964b 100644 --- a/packages/middleware-retry/src/configurations.ts +++ b/packages/middleware-retry/src/configurations.ts @@ -9,9 +9,18 @@ import { StandardRetryStrategy, } from "@smithy/util-retry"; +/** + * @internal + */ export const ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; +/** + * @internal + */ export const CONFIG_MAX_ATTEMPTS = "max_attempts"; +/** + * @internal + */ export const NODE_MAX_ATTEMPT_CONFIG_OPTIONS: LoadedConfigSelectors = { environmentVariableSelector: (env) => { const value = env[ENV_MAX_ATTEMPTS]; @@ -73,6 +82,9 @@ export interface RetryResolvedConfig { retryStrategy: Provider; } +/** + * @internal + */ export const resolveRetryConfig = (input: T & PreviouslyResolved & RetryInputConfig): T & RetryResolvedConfig => { const { retryStrategy } = input; const maxAttempts = normalizeProvider(input.maxAttempts ?? DEFAULT_MAX_ATTEMPTS); @@ -92,9 +104,19 @@ export const resolveRetryConfig = (input: T & PreviouslyResolved & RetryInput }; }; +/** + * @internal + */ export const ENV_RETRY_MODE = "AWS_RETRY_MODE"; + +/** + * @internal + */ export const CONFIG_RETRY_MODE = "retry_mode"; +/** + * @internal + */ export const NODE_RETRY_MODE_CONFIG_OPTIONS: LoadedConfigSelectors = { environmentVariableSelector: (env) => env[ENV_RETRY_MODE], configFileSelector: (profile) => profile[CONFIG_RETRY_MODE], diff --git a/packages/middleware-retry/src/defaultRetryQuota.ts b/packages/middleware-retry/src/defaultRetryQuota.ts index 7f5be49677b..eb5c5a4f36c 100644 --- a/packages/middleware-retry/src/defaultRetryQuota.ts +++ b/packages/middleware-retry/src/defaultRetryQuota.ts @@ -3,6 +3,9 @@ import { NO_RETRY_INCREMENT, RETRY_COST, TIMEOUT_RETRY_COST } from "@smithy/util import { RetryQuota } from "./types"; +/** + * @internal + */ export interface DefaultRetryQuotaOptions { /** * The total amount of retry token to be incremented from retry token balance @@ -22,6 +25,9 @@ export interface DefaultRetryQuotaOptions { timeoutRetryCost?: number; } +/** + * @internal + */ export const getDefaultRetryQuota = (initialRetryTokens: number, options?: DefaultRetryQuotaOptions): RetryQuota => { const MAX_CAPACITY = initialRetryTokens; const noRetryIncrement = options?.noRetryIncrement ?? NO_RETRY_INCREMENT; diff --git a/packages/middleware-retry/src/delayDecider.ts b/packages/middleware-retry/src/delayDecider.ts index f8bdb5de1ba..dfa8effb581 100644 --- a/packages/middleware-retry/src/delayDecider.ts +++ b/packages/middleware-retry/src/delayDecider.ts @@ -1,6 +1,7 @@ import { MAXIMUM_RETRY_DELAY } from "@smithy/util-retry"; /** + * @internal * Calculate a capped, fully-jittered exponential backoff time. */ export const defaultDelayDecider = (delayBase: number, attempts: number) => diff --git a/packages/middleware-retry/src/omitRetryHeadersMiddleware.ts b/packages/middleware-retry/src/omitRetryHeadersMiddleware.ts index 741f2d67fe7..174de4f8941 100644 --- a/packages/middleware-retry/src/omitRetryHeadersMiddleware.ts +++ b/packages/middleware-retry/src/omitRetryHeadersMiddleware.ts @@ -9,6 +9,9 @@ import { } from "@smithy/types"; import { INVOCATION_ID_HEADER, REQUEST_HEADER } from "@smithy/util-retry"; +/** + * @internal + */ export const omitRetryHeadersMiddleware = () => (next: FinalizeHandler): FinalizeHandler => @@ -21,6 +24,9 @@ export const omitRetryHeadersMiddleware = return next(args); }; +/** + * @internal + */ export const omitRetryHeadersMiddlewareOptions: RelativeMiddlewareOptions = { name: "omitRetryHeadersMiddleware", tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"], @@ -29,8 +35,13 @@ export const omitRetryHeadersMiddlewareOptions: RelativeMiddlewareOptions = { override: true, }; -// eslint-disable-next-line @typescript-eslint/no-unused-vars -export const getOmitRetryHeadersPlugin = (options: unknown): Pluggable => ({ +/** + * @internal + */ +export const getOmitRetryHeadersPlugin = ( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + options: unknown +): Pluggable => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions); }, diff --git a/packages/middleware-retry/src/retryDecider.ts b/packages/middleware-retry/src/retryDecider.ts index e2913d065bc..b2957a7a9c8 100644 --- a/packages/middleware-retry/src/retryDecider.ts +++ b/packages/middleware-retry/src/retryDecider.ts @@ -7,6 +7,7 @@ import { import { SdkError } from "@smithy/types"; /** + * @internal * @deprecated this is only used in the deprecated StandardRetryStrategy. Do not use in new code. */ export const defaultRetryDecider = (error: SdkError) => { diff --git a/packages/middleware-retry/src/retryMiddleware.ts b/packages/middleware-retry/src/retryMiddleware.ts index 69048d1726f..bde5cf3000c 100644 --- a/packages/middleware-retry/src/retryMiddleware.ts +++ b/packages/middleware-retry/src/retryMiddleware.ts @@ -24,6 +24,9 @@ import { RetryResolvedConfig } from "./configurations"; import { isStreamingPayload } from "./isStreamingPayload/isStreamingPayload"; import { asSdkError } from "./util"; +/** + * @internal + */ export const retryMiddleware = (options: RetryResolvedConfig) => ( @@ -116,6 +119,9 @@ const getRetryErrorType = (error: SdkError): RetryErrorType => { return "CLIENT_ERROR"; }; +/** + * @internal + */ export const retryMiddlewareOptions: FinalizeRequestHandlerOptions & AbsoluteLocation = { name: "retryMiddleware", tags: ["RETRY"], @@ -124,12 +130,18 @@ export const retryMiddlewareOptions: FinalizeRequestHandlerOptions & AbsoluteLoc override: true, }; +/** + * @internal + */ export const getRetryPlugin = (options: RetryResolvedConfig): Pluggable => ({ applyToStack: (clientStack) => { clientStack.add(retryMiddleware(options), retryMiddlewareOptions); }, }); +/** + * @internal + */ export const getRetryAfterHint = (response: unknown): Date | undefined => { if (!HttpResponse.isInstance(response)) return; diff --git a/packages/middleware-retry/src/types.ts b/packages/middleware-retry/src/types.ts index 19030f9ceb9..ef5c1b1b065 100644 --- a/packages/middleware-retry/src/types.ts +++ b/packages/middleware-retry/src/types.ts @@ -5,6 +5,9 @@ import { SdkError } from "@smithy/types"; * 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; @@ -15,6 +18,9 @@ export interface RetryDecider { * * @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; @@ -22,6 +28,8 @@ export interface DelayDecider { /** * Interface that specifies the retry quota behavior. + * @deprecated + * @internal */ export interface RetryQuota { /** @@ -41,6 +49,10 @@ export interface RetryQuota { releaseRetryTokens: (releaseCapacityAmount?: number) => void; } +/** + * @deprecated + * @internal + */ export interface RateLimiter { /** * If there is sufficient capacity (tokens) available, it immediately returns. diff --git a/packages/middleware-stack/src/MiddlewareStack.ts b/packages/middleware-stack/src/MiddlewareStack.ts index 52caaac9ad1..d80c7a6c8ce 100644 --- a/packages/middleware-stack/src/MiddlewareStack.ts +++ b/packages/middleware-stack/src/MiddlewareStack.ts @@ -32,6 +32,9 @@ const getMiddlewareNameWithAliases = (name: string | undefined, aliases: Array 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`; }; +/** + * @internal + */ export const constructStack = (): MiddlewareStack => { let absoluteEntries: AbsoluteMiddlewareEntry[] = []; let relativeEntries: RelativeMiddlewareEntry[] = []; diff --git a/packages/node-config-provider/src/configLoader.ts b/packages/node-config-provider/src/configLoader.ts index b0f86caebe4..f3ccab6eb4c 100644 --- a/packages/node-config-provider/src/configLoader.ts +++ b/packages/node-config-provider/src/configLoader.ts @@ -5,8 +5,14 @@ import { fromEnv, GetterFromEnv } from "./fromEnv"; import { fromSharedConfigFiles, GetterFromConfig, SharedConfigInit } from "./fromSharedConfigFiles"; import { fromStatic, FromStaticConfig } from "./fromStatic"; +/** + * @internal + */ export type LocalConfigOptions = SharedConfigInit; +/** + * @internal + */ export interface LoadedConfigSelectors { /** * A getter function getting the config values from all the environment @@ -24,6 +30,9 @@ export interface LoadedConfigSelectors { default: FromStaticConfig; } +/** + * @internal + */ export const loadConfig = ( { environmentVariableSelector, configFileSelector, default: defaultValue }: LoadedConfigSelectors, configuration: LocalConfigOptions = {} diff --git a/packages/node-config-provider/src/fromSharedConfigFiles.ts b/packages/node-config-provider/src/fromSharedConfigFiles.ts index 4947aaaa118..8b999dbd487 100644 --- a/packages/node-config-provider/src/fromSharedConfigFiles.ts +++ b/packages/node-config-provider/src/fromSharedConfigFiles.ts @@ -4,6 +4,9 @@ import { ParsedIniData, Profile, Provider } from "@smithy/types"; import { getSelectorName } from "./getSelectorName"; +/** + * @internal + */ export interface SharedConfigInit extends SourceProfileInit { /** * The preferred shared ini file to load the config. "config" option refers to @@ -13,10 +16,14 @@ export interface SharedConfigInit extends SourceProfileInit { preferredFile?: "config" | "credentials"; } +/** + * @internal + */ export type GetterFromConfig = (profile: Profile, configFile?: ParsedIniData) => T | undefined; /** * Get config value from the shared config files with inferred profile name. + * @internal */ export const fromSharedConfigFiles = ( diff --git a/packages/node-config-provider/src/fromStatic.ts b/packages/node-config-provider/src/fromStatic.ts index d62b0d455eb..28f4fe846c1 100644 --- a/packages/node-config-provider/src/fromStatic.ts +++ b/packages/node-config-provider/src/fromStatic.ts @@ -1,9 +1,23 @@ import { fromStatic as convertToProvider } from "@smithy/property-provider"; import { Provider } from "@smithy/types"; +/** + * @internal + */ export type FromStaticConfig = T | (() => T) | Provider; + +/** + * @internal + */ type Getter = (() => T) | Provider; + +/** + * @internal + */ const isFunction = (func: FromStaticConfig): func is Getter => typeof func === "function"; +/** + * @internal + */ export const fromStatic = (defaultValue: FromStaticConfig): Provider => isFunction(defaultValue) ? async () => await defaultValue() : convertToProvider(defaultValue); diff --git a/packages/node-http-handler/src/node-http-handler.ts b/packages/node-http-handler/src/node-http-handler.ts index 8c5f2d14339..a27a986609c 100644 --- a/packages/node-http-handler/src/node-http-handler.ts +++ b/packages/node-http-handler/src/node-http-handler.ts @@ -20,8 +20,16 @@ interface ResolvedNodeHttpHandlerConfig extends Omit { private config?: ResolvedNodeHttpHandlerConfig; private configProvider: Promise; diff --git a/packages/node-http-handler/src/node-http2-connection-manager.ts b/packages/node-http-handler/src/node-http2-connection-manager.ts index 3e3f669a49b..130e3084710 100644 --- a/packages/node-http-handler/src/node-http2-connection-manager.ts +++ b/packages/node-http-handler/src/node-http2-connection-manager.ts @@ -5,6 +5,9 @@ import http2, { ClientHttp2Session } from "http2"; import { NodeHttp2ConnectionPool } from "./node-http2-connection-pool"; +/** + * @public + */ export class NodeHttp2ConnectionManager implements ConnectionManager { constructor(config: ConnectionManagerConfiguration) { this.config = config; diff --git a/packages/node-http-handler/src/node-http2-handler.ts b/packages/node-http-handler/src/node-http2-handler.ts index a830fa04450..3dd54e27a0b 100644 --- a/packages/node-http-handler/src/node-http2-handler.ts +++ b/packages/node-http-handler/src/node-http2-handler.ts @@ -9,6 +9,7 @@ import { writeRequestBody } from "./write-request-body"; /** * Represents the http2 options that can be passed to a node http2 client. + * @public */ export interface NodeHttp2HandlerOptions { /** @@ -41,6 +42,10 @@ export interface NodeHttp2HandlerOptions { maxConcurrentStreams?: number; } +/** + * A request handler using the node:http2 package. + * @public + */ export class NodeHttp2Handler implements HttpHandler { private config?: NodeHttp2HandlerOptions; private configProvider: Promise; @@ -242,7 +247,7 @@ export class NodeHttp2Handler implements HttpHandler { /** * Destroys a session. - * @param session The session to destroy. + * @param session - the session to destroy. */ private destroySession(session: ClientHttp2Session): void { if (!session.destroyed) { diff --git a/packages/node-http-handler/src/set-socket-timeout.ts b/packages/node-http-handler/src/set-socket-timeout.ts index f1df9b01ac3..67efa5080f3 100644 --- a/packages/node-http-handler/src/set-socket-timeout.ts +++ b/packages/node-http-handler/src/set-socket-timeout.ts @@ -1,5 +1,6 @@ import { ClientRequest } from "http"; +import { DEFAULT_REQUEST_TIMEOUT } from "./node-http-handler"; import { timing } from "./timing"; const DEFER_EVENT_LISTENER_TIME = 3000; @@ -7,7 +8,7 @@ const DEFER_EVENT_LISTENER_TIME = 3000; export const setSocketTimeout = ( request: ClientRequest, reject: (err: Error) => void, - timeoutInMs = 0 + timeoutInMs = DEFAULT_REQUEST_TIMEOUT ): NodeJS.Timeout | number => { const registerTimeout = (offset: number) => { const timeout = timeoutInMs - offset; diff --git a/packages/node-http-handler/src/stream-collector/index.ts b/packages/node-http-handler/src/stream-collector/index.ts index fb8b7755a8c..152854420da 100644 --- a/packages/node-http-handler/src/stream-collector/index.ts +++ b/packages/node-http-handler/src/stream-collector/index.ts @@ -4,6 +4,10 @@ import type { ReadableStream as IReadableStream } from "stream/web"; import { Collector } from "./collector"; +/** + * @internal + * Converts a stream to a byte array. + */ export const streamCollector: StreamCollector = (stream: Readable | IReadableStream): Promise => { if (isReadableStreamInstance(stream)) { // Web stream API in Node.js diff --git a/packages/protocol-http/src/httpHandler.ts b/packages/protocol-http/src/httpHandler.ts index 906e8d8edaa..72ed9fc3f87 100644 --- a/packages/protocol-http/src/httpHandler.ts +++ b/packages/protocol-http/src/httpHandler.ts @@ -18,8 +18,6 @@ export type HttpHandler = RequestHandler< > & { /** * @internal - * @param key - * @param value */ updateHttpClientConfig(key: keyof HttpHandlerConfig, value: HttpHandlerConfig[typeof key]): void; diff --git a/packages/protocol-http/src/httpRequest.ts b/packages/protocol-http/src/httpRequest.ts index ad95c879eb6..6c44bb977c9 100644 --- a/packages/protocol-http/src/httpRequest.ts +++ b/packages/protocol-http/src/httpRequest.ts @@ -4,12 +4,14 @@ import { HeaderBag, HttpMessage, HttpRequest as IHttpRequest, QueryParameterBag, type HttpRequestOptions = Partial & Partial & { method?: string }; /** - * Use the distinct IHttpRequest interface from @smithy/types instead. + * 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 {} diff --git a/packages/protocol-http/src/httpResponse.ts b/packages/protocol-http/src/httpResponse.ts index 243b75b3463..5fe507777d3 100644 --- a/packages/protocol-http/src/httpResponse.ts +++ b/packages/protocol-http/src/httpResponse.ts @@ -6,8 +6,21 @@ type HttpResponseOptions = Partial & { 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 class HttpResponse { public statusCode: number; public reason?: string; diff --git a/packages/shared-ini-file-loader/src/getProfileName.ts b/packages/shared-ini-file-loader/src/getProfileName.ts index 0844812c77a..f837425129a 100644 --- a/packages/shared-ini-file-loader/src/getProfileName.ts +++ b/packages/shared-ini-file-loader/src/getProfileName.ts @@ -1,5 +1,16 @@ +/** + * @internal + */ export const ENV_PROFILE = "AWS_PROFILE"; + +/** + * @internal + */ export const DEFAULT_PROFILE = "default"; +/** + * Returns profile with priority order code - ENV - default. + * @internal + */ export const getProfileName = (init: { profile?: string }): string => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE; diff --git a/packages/shared-ini-file-loader/src/getSSOTokenFilepath.ts b/packages/shared-ini-file-loader/src/getSSOTokenFilepath.ts index 8b92c9e6dc8..8e0754fee36 100644 --- a/packages/shared-ini-file-loader/src/getSSOTokenFilepath.ts +++ b/packages/shared-ini-file-loader/src/getSSOTokenFilepath.ts @@ -5,6 +5,7 @@ import { getHomeDir } from "./getHomeDir"; /** * Returns the filepath of the file where SSO token is stored. + * @internal */ export const getSSOTokenFilepath = (id: string) => { const hasher = createHash("sha1"); diff --git a/packages/shared-ini-file-loader/src/getSSOTokenFromFile.ts b/packages/shared-ini-file-loader/src/getSSOTokenFromFile.ts index a7b3ba1fedb..80955c7aaf0 100644 --- a/packages/shared-ini-file-loader/src/getSSOTokenFromFile.ts +++ b/packages/shared-ini-file-loader/src/getSSOTokenFromFile.ts @@ -7,6 +7,7 @@ const { readFile } = fsPromises; /** * Cached SSO token retrieved from SSO login flow. + * @public */ export interface SSOToken { /** @@ -53,6 +54,7 @@ export interface SSOToken { } /** + * @internal * @param id - can be either a start URL or the SSO session name. * Returns the SSO token from the file system. */ diff --git a/packages/shared-ini-file-loader/src/loadSharedConfigFiles.ts b/packages/shared-ini-file-loader/src/loadSharedConfigFiles.ts index 21255090def..35f36533873 100644 --- a/packages/shared-ini-file-loader/src/loadSharedConfigFiles.ts +++ b/packages/shared-ini-file-loader/src/loadSharedConfigFiles.ts @@ -8,6 +8,9 @@ import { getHomeDir } from "./getHomeDir"; import { parseIni } from "./parseIni"; import { slurpFile } from "./slurpFile"; +/** + * @public + */ export interface SharedConfigInit { /** * The path at which to locate the ini credentials file. Defaults to the @@ -37,8 +40,15 @@ export interface SharedConfigInit { const swallowError = () => ({}); +/** + * @internal + */ export const CONFIG_PREFIX_SEPARATOR = "."; +/** + * Loads the config and credentials files. + * @internal + */ export const loadSharedConfigFiles = async (init: SharedConfigInit = {}): Promise => { const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init; const homeDir = getHomeDir(); diff --git a/packages/shared-ini-file-loader/src/loadSsoSessionData.ts b/packages/shared-ini-file-loader/src/loadSsoSessionData.ts index f93502c3c4c..7c0f9dc7d4d 100644 --- a/packages/shared-ini-file-loader/src/loadSsoSessionData.ts +++ b/packages/shared-ini-file-loader/src/loadSsoSessionData.ts @@ -5,6 +5,10 @@ import { getSsoSessionData } from "./getSsoSessionData"; import { parseIni } from "./parseIni"; import { slurpFile } from "./slurpFile"; +/** + * Subset of {@link SharedConfigInit}. + * @internal + */ export interface SsoSessionInit { /** * The path at which to locate the ini config file. Defaults to the value of @@ -16,6 +20,9 @@ export interface SsoSessionInit { const swallowError = () => ({}); +/** + * @internal + */ export const loadSsoSessionData = async (init: SsoSessionInit = {}): Promise => slurpFile(init.configFilepath ?? getConfigFilepath()) .then(parseIni) diff --git a/packages/shared-ini-file-loader/src/parseKnownFiles.ts b/packages/shared-ini-file-loader/src/parseKnownFiles.ts index a29e2bfee2c..062e27c3b8f 100644 --- a/packages/shared-ini-file-loader/src/parseKnownFiles.ts +++ b/packages/shared-ini-file-loader/src/parseKnownFiles.ts @@ -3,6 +3,9 @@ import { ParsedIniData } from "@smithy/types"; import { loadSharedConfigFiles, SharedConfigInit } from "./loadSharedConfigFiles"; import { mergeConfigFiles } from "./mergeConfigFiles"; +/** + * @public + */ export interface SourceProfileInit extends SharedConfigInit { /** * The configuration profile to use. diff --git a/packages/shared-ini-file-loader/src/types.ts b/packages/shared-ini-file-loader/src/types.ts index a102b8f23a3..aefc42d31c2 100644 --- a/packages/shared-ini-file-loader/src/types.ts +++ b/packages/shared-ini-file-loader/src/types.ts @@ -5,16 +5,19 @@ import { } from "@smithy/types"; /** - * @deprecated Use Profile from "@smithy/types" instead + * @internal + * @deprecated Use Profile from "\@smithy/types" instead */ export type Profile = __Profile; /** - * @deprecated Use ParsedIniData from "@smithy/types" instead + * @internal + * @deprecated Use ParsedIniData from "\@smithy/types" instead */ export type ParsedIniData = __ParsedIniData; /** - * @deprecated Use SharedConfigFiles from "@smithy/types" instead + * @internal + * @deprecated Use SharedConfigFiles from "\@smithy/types" instead */ export type SharedConfigFiles = __SharedConfigFiles; diff --git a/packages/signature-v4/src/SignatureV4.ts b/packages/signature-v4/src/SignatureV4.ts index fdcad4b4825..5de97ee762c 100644 --- a/packages/signature-v4/src/SignatureV4.ts +++ b/packages/signature-v4/src/SignatureV4.ts @@ -50,6 +50,9 @@ import { moveHeadersToQuery } from "./moveHeadersToQuery"; import { prepareRequest } from "./prepareRequest"; import { iso8601 } from "./utilDate"; +/** + * @public + */ export interface SignatureV4Init { /** * The service signing name. @@ -94,10 +97,16 @@ export interface SignatureV4Init { applyChecksum?: boolean; } +/** + * @public + */ export interface SignatureV4CryptoInit { sha256: ChecksumConstructor | HashConstructor; } +/** + * @public + */ export class SignatureV4 implements RequestPresigner, RequestSigner, StringSigner, EventSigner, MessageSigner { private readonly service: string; private readonly regionProvider: Provider; diff --git a/packages/signature-v4/src/credentialDerivation.ts b/packages/signature-v4/src/credentialDerivation.ts index a77ae4a6ab3..43c4df7b0bc 100644 --- a/packages/signature-v4/src/credentialDerivation.ts +++ b/packages/signature-v4/src/credentialDerivation.ts @@ -10,23 +10,27 @@ const cacheQueue: Array = []; /** * Create a string describing the scope of credentials used to sign a request. * - * @param shortDate The current calendar date in the form YYYYMMDD. - * @param region The AWS region in which the service resides. - * @param service The service to which the signed request is being sent. + * @internal + * + * @param shortDate - the current calendar date in the form YYYYMMDD. + * @param region - the AWS region in which the service resides. + * @param service - the service to which the signed request is being sent. */ export const createScope = (shortDate: string, region: string, service: string): string => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`; /** - * Derive a signing key from its composite parts + * Derive a signing key from its composite parts. + * + * @internal * - * @param sha256Constructor A constructor function that can instantiate SHA-256 + * @param sha256Constructor - a constructor function that can instantiate SHA-256 * hash objects. - * @param credentials The credentials with which the request will be + * @param credentials - the credentials with which the request will be * signed. - * @param shortDate The current calendar date in the form YYYYMMDD. - * @param region The AWS region in which the service resides. - * @param service The service to which the signed request is being + * @param shortDate - the current calendar date in the form YYYYMMDD. + * @param region - the AWS region in which the service resides. + * @param service - the service to which the signed request is being * sent. */ export const getSigningKey = async ( diff --git a/packages/signature-v4/src/getCanonicalHeaders.ts b/packages/signature-v4/src/getCanonicalHeaders.ts index 59ea8e944bb..99b4c2493be 100644 --- a/packages/signature-v4/src/getCanonicalHeaders.ts +++ b/packages/signature-v4/src/getCanonicalHeaders.ts @@ -3,7 +3,7 @@ import { HeaderBag, HttpRequest } from "@smithy/types"; import { ALWAYS_UNSIGNABLE_HEADERS, PROXY_HEADER_PATTERN, SEC_HEADER_PATTERN } from "./constants"; /** - * @private + * @internal */ export const getCanonicalHeaders = ( { headers }: HttpRequest, diff --git a/packages/signature-v4/src/getCanonicalQuery.ts b/packages/signature-v4/src/getCanonicalQuery.ts index a4f70a5cee4..93daf27f1a0 100644 --- a/packages/signature-v4/src/getCanonicalQuery.ts +++ b/packages/signature-v4/src/getCanonicalQuery.ts @@ -4,7 +4,7 @@ import { escapeUri } from "@smithy/util-uri-escape"; import { SIGNATURE_HEADER } from "./constants"; /** - * @private + * @internal */ export const getCanonicalQuery = ({ query = {} }: HttpRequest): string => { const keys: Array = []; diff --git a/packages/signature-v4/src/getPayloadHash.ts b/packages/signature-v4/src/getPayloadHash.ts index a20a33f833f..29121a59031 100644 --- a/packages/signature-v4/src/getPayloadHash.ts +++ b/packages/signature-v4/src/getPayloadHash.ts @@ -6,7 +6,7 @@ import { toUint8Array } from "@smithy/util-utf8"; import { SHA256_HEADER, UNSIGNED_PAYLOAD } from "./constants"; /** - * @private + * @internal */ export const getPayloadHash = async ( { headers, body }: HttpRequest, diff --git a/packages/signature-v4/src/moveHeadersToQuery.ts b/packages/signature-v4/src/moveHeadersToQuery.ts index 6d17556afa3..7a97e632f03 100644 --- a/packages/signature-v4/src/moveHeadersToQuery.ts +++ b/packages/signature-v4/src/moveHeadersToQuery.ts @@ -2,7 +2,7 @@ import { HttpRequest } from "@smithy/protocol-http"; import type { HttpRequest as IHttpRequest, QueryParameterBag } from "@smithy/types"; /** - * @private + * @internal */ export const moveHeadersToQuery = ( request: IHttpRequest, diff --git a/packages/signature-v4/src/prepareRequest.ts b/packages/signature-v4/src/prepareRequest.ts index 35056646a2d..55e4061ad81 100644 --- a/packages/signature-v4/src/prepareRequest.ts +++ b/packages/signature-v4/src/prepareRequest.ts @@ -4,7 +4,7 @@ import type { HttpRequest as IHttpRequest } from "@smithy/types"; import { GENERATED_HEADERS } from "./constants"; /** - * @private + * @internal */ export const prepareRequest = (request: IHttpRequest): IHttpRequest => { // Create a clone of the request object that does not clone the body diff --git a/packages/smithy-client/src/extensions/retry.ts b/packages/smithy-client/src/extensions/retry.ts index 087ba4b9609..bd19aea1d44 100644 --- a/packages/smithy-client/src/extensions/retry.ts +++ b/packages/smithy-client/src/extensions/retry.ts @@ -1,5 +1,8 @@ import { Provider, RetryStrategy, RetryStrategyConfiguration, RetryStrategyV2 } from "@smithy/types"; +/** + * @internal + */ export type PartialRetryRuntimeConfigType = Partial<{ retryStrategy: Provider }>; /** diff --git a/packages/smithy-client/src/ser-utils.ts b/packages/smithy-client/src/ser-utils.ts index 2397f7809d8..a045768d036 100644 --- a/packages/smithy-client/src/ser-utils.ts +++ b/packages/smithy-client/src/ser-utils.ts @@ -22,6 +22,7 @@ export 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. */ diff --git a/packages/types/src/blob/blob-payload-input-types.ts b/packages/types/src/blob/blob-payload-input-types.ts index 7ade227cacc..9e29c067f39 100644 --- a/packages/types/src/blob/blob-payload-input-types.ts +++ b/packages/types/src/blob/blob-payload-input-types.ts @@ -45,6 +45,7 @@ export type NodeJsRuntimeBlobTypes = Readable | Buffer; export type BrowserRuntimeBlobTypes = BlobOptionalType | ReadableStreamOptionalType; /** + * @internal * @deprecated renamed to BlobPayloadInputTypes. */ export type BlobTypes = BlobPayloadInputTypes; diff --git a/packages/types/src/client.ts b/packages/types/src/client.ts index df78b6e6a6d..9d6454bb802 100644 --- a/packages/types/src/client.ts +++ b/packages/types/src/client.ts @@ -70,6 +70,7 @@ export interface InvokeMethodOptionalArgs { readonly config: ResolvedClientConfiguration; diff --git a/packages/types/src/connection/config.ts b/packages/types/src/connection/config.ts index 65567f91401..fc558f056d4 100644 --- a/packages/types/src/connection/config.ts +++ b/packages/types/src/connection/config.ts @@ -1,3 +1,6 @@ +/** + * @public + */ export interface ConnectConfiguration { /** * The maximum time in milliseconds that the connection phase of a request diff --git a/packages/types/src/connection/manager.ts b/packages/types/src/connection/manager.ts index d45ec907634..e1f3878f6b7 100644 --- a/packages/types/src/connection/manager.ts +++ b/packages/types/src/connection/manager.ts @@ -1,6 +1,9 @@ import { RequestContext } from "../transfer"; import { ConnectConfiguration } from "./config"; +/** + * @public + */ export interface ConnectionManagerConfiguration { /** * Maximum number of allowed concurrent requests per connection. @@ -13,6 +16,9 @@ export interface ConnectionManagerConfiguration { disableConcurrency?: boolean; } +/** + * @public + */ export interface ConnectionManager { /** * Retrieves a connection from the connection pool if available, diff --git a/packages/types/src/connection/pool.ts b/packages/types/src/connection/pool.ts index 48295a91f0c..3449da88633 100644 --- a/packages/types/src/connection/pool.ts +++ b/packages/types/src/connection/pool.ts @@ -1,3 +1,6 @@ +/** + * @public + */ export interface ConnectionPool { /** * Retrieve the first connection in the pool @@ -23,6 +26,11 @@ export interface ConnectionPool { [Symbol.iterator](): Iterator; } +/** + * Unused. + * @internal + * @deprecated + */ export interface CacheKey { destination: string; } diff --git a/packages/types/src/encode.ts b/packages/types/src/encode.ts index 2f0754a1044..c6dfb8f341c 100644 --- a/packages/types/src/encode.ts +++ b/packages/types/src/encode.ts @@ -1,9 +1,15 @@ import { Message } from "./eventStream"; +/** + * @public + */ export interface MessageEncoder { encode(message: Message): Uint8Array; } +/** + * @public + */ export interface MessageDecoder { decode(message: ArrayBufferView): Message; feed(message: ArrayBufferView): void; @@ -12,12 +18,18 @@ export interface MessageDecoder { getAvailableMessages(): AvailableMessages; } +/** + * @public + */ export interface AvailableMessage { getMessage(): Message | undefined; isEndOfStream(): boolean; } +/** + * @public + */ export interface AvailableMessages { getMessages(): Message[]; isEndOfStream(): boolean; diff --git a/packages/types/src/endpoints/EndpointRuleObject.ts b/packages/types/src/endpoints/EndpointRuleObject.ts index b5f500c72fc..a7e698cd227 100644 --- a/packages/types/src/endpoints/EndpointRuleObject.ts +++ b/packages/types/src/endpoints/EndpointRuleObject.ts @@ -1,14 +1,28 @@ import { EndpointObjectProperty } from "../endpoint"; import { ConditionObject, Expression } from "./shared"; +/** + * @public + */ export type EndpointObjectProperties = Record; + +/** + * @public + */ export type EndpointObjectHeaders = Record; + +/** + * @public + */ export type EndpointObject = { url: Expression; properties?: EndpointObjectProperties; headers?: EndpointObjectHeaders; }; +/** + * @public + */ export type EndpointRuleObject = { type: "endpoint"; conditions?: ConditionObject[]; diff --git a/packages/types/src/endpoints/ErrorRuleObject.ts b/packages/types/src/endpoints/ErrorRuleObject.ts index e03239a11b9..97b1ee83490 100644 --- a/packages/types/src/endpoints/ErrorRuleObject.ts +++ b/packages/types/src/endpoints/ErrorRuleObject.ts @@ -1,5 +1,8 @@ import { ConditionObject, Expression } from "./shared"; +/** + * @public + */ export type ErrorRuleObject = { type: "error"; conditions?: ConditionObject[]; diff --git a/packages/types/src/endpoints/RuleSetObject.ts b/packages/types/src/endpoints/RuleSetObject.ts index fac027ecf73..ed7e10fc515 100644 --- a/packages/types/src/endpoints/RuleSetObject.ts +++ b/packages/types/src/endpoints/RuleSetObject.ts @@ -1,10 +1,16 @@ import { RuleSetRules } from "./TreeRuleObject"; +/** + * @public + */ export type DeprecatedObject = { message?: string; since?: string; }; +/** + * @public + */ export type ParameterObject = { type: "String" | "string" | "Boolean" | "boolean"; default?: string | boolean; @@ -14,6 +20,9 @@ export type ParameterObject = { deprecated?: DeprecatedObject; }; +/** + * @public + */ export type RuleSetObject = { version: string; serviceId?: string; diff --git a/packages/types/src/endpoints/TreeRuleObject.ts b/packages/types/src/endpoints/TreeRuleObject.ts index b1b7476561a..c4b1d7ce5dd 100644 --- a/packages/types/src/endpoints/TreeRuleObject.ts +++ b/packages/types/src/endpoints/TreeRuleObject.ts @@ -2,8 +2,14 @@ import { EndpointRuleObject } from "./EndpointRuleObject"; import { ErrorRuleObject } from "./ErrorRuleObject"; import { ConditionObject } from "./shared"; +/** + * @public + */ export type RuleSetRules = Array; +/** + * @public + */ export type TreeRuleObject = { type: "tree"; conditions?: ConditionObject[]; diff --git a/packages/types/src/endpoints/shared.ts b/packages/types/src/endpoints/shared.ts index c32b8904ccc..21229fe7aa0 100644 --- a/packages/types/src/endpoints/shared.ts +++ b/packages/types/src/endpoints/shared.ts @@ -1,22 +1,54 @@ import { Logger } from "../logger"; +/** + * @public + */ export type ReferenceObject = { ref: string }; +/** + * @public + */ export type FunctionObject = { fn: string; argv: FunctionArgv }; +/** + * @public + */ export type FunctionArgv = Array; +/** + * @public + */ export type FunctionReturn = string | boolean | number | { [key: string]: FunctionReturn }; +/** + * @public + */ export type ConditionObject = FunctionObject & { assign?: string }; +/** + * @public + */ export type Expression = string | ReferenceObject | FunctionObject; +/** + * @public + */ export type EndpointParams = Record; + +/** + * @public + */ export type EndpointResolverOptions = { endpointParams: EndpointParams; logger?: Logger; }; +/** + * @public + */ export type ReferenceRecord = Record; + +/** + * @public + */ export type EvaluateOptions = EndpointResolverOptions & { referenceRecord: ReferenceRecord; }; diff --git a/packages/types/src/eventStream.ts b/packages/types/src/eventStream.ts index ae1400e3ca1..5d6bf4526d5 100644 --- a/packages/types/src/eventStream.ts +++ b/packages/types/src/eventStream.ts @@ -23,16 +23,46 @@ export interface Message { */ export type MessageHeaders = Record; -type HeaderValue = { type: K; value: V }; +/** + * @public + */ +export type HeaderValue = { type: K; value: V }; +/** + * @public + */ export type BooleanHeaderValue = HeaderValue<"boolean", boolean>; +/** + * @public + */ export type ByteHeaderValue = HeaderValue<"byte", number>; +/** + * @public + */ export type ShortHeaderValue = HeaderValue<"short", number>; +/** + * @public + */ export type IntegerHeaderValue = HeaderValue<"integer", number>; +/** + * @public + */ export type LongHeaderValue = HeaderValue<"long", Int64>; +/** + * @public + */ export type BinaryHeaderValue = HeaderValue<"binary", Uint8Array>; +/** + * @public + */ export type StringHeaderValue = HeaderValue<"string", string>; +/** + * @public + */ export type TimestampHeaderValue = HeaderValue<"timestamp", Date>; +/** + * @public + */ export type UuidHeaderValue = HeaderValue<"uuid", string>; /** diff --git a/packages/types/src/extensions/checksum.ts b/packages/types/src/extensions/checksum.ts index 1eb488e7ff1..43f34c1a66e 100644 --- a/packages/types/src/extensions/checksum.ts +++ b/packages/types/src/extensions/checksum.ts @@ -22,6 +22,7 @@ export interface ChecksumAlgorithm { /** * @deprecated unused. + * @internal */ type ChecksumConfigurationLegacy = { /** @@ -40,6 +41,7 @@ export interface ChecksumConfiguration extends ChecksumConfigurationLegacy { /** * @deprecated will be removed for implicit type. + * @internal */ type GetChecksumConfigurationType = ( runtimeConfig: Partial<{ @@ -86,6 +88,7 @@ export const getChecksumConfiguration: GetChecksumConfigurationType = ( }; /** + * @internal * @deprecated will be removed for implicit type. */ type ResolveChecksumRuntimeConfigType = (clientConfig: ChecksumConfiguration) => any; diff --git a/packages/types/src/http.ts b/packages/types/src/http.ts index 5abeebcb5cb..df73aefa396 100644 --- a/packages/types/src/http.ts +++ b/packages/types/src/http.ts @@ -55,12 +55,18 @@ export interface HttpMessage { */ export type QueryParameterBag = Record | null>; +/** + * @public + */ export type FieldOptions = { name: string; kind?: FieldPosition; values?: string[]; }; +/** + * @public + */ export enum FieldPosition { HEADER, TRAILER, diff --git a/packages/types/src/http/httpHandlerInitialization.ts b/packages/types/src/http/httpHandlerInitialization.ts index a81aa50dd10..fb37ac0ad5c 100644 --- a/packages/types/src/http/httpHandlerInitialization.ts +++ b/packages/types/src/http/httpHandlerInitialization.ts @@ -47,10 +47,11 @@ export interface NodeHttpHandlerOptions { socketAcquisitionWarningTimeout?: number; /** - * @deprecated Use {@link requestTimeout} - * + * This field is deprecated, and requestTimeout should be used instead. * The maximum time in milliseconds that a socket may remain idle before it * is closed. + * + * @deprecated Use {@link requestTimeout} */ socketTimeout?: number; diff --git a/packages/types/src/serde.ts b/packages/types/src/serde.ts index 36f9a33fa91..5af727e6aab 100644 --- a/packages/types/src/serde.ts +++ b/packages/types/src/serde.ts @@ -81,6 +81,7 @@ export interface ResponseDeserializer Promise; diff --git a/packages/types/src/streaming-payload/streaming-blob-payload-input-types.ts b/packages/types/src/streaming-payload/streaming-blob-payload-input-types.ts index 808e53ce3a7..f52ab9a98f7 100644 --- a/packages/types/src/streaming-payload/streaming-blob-payload-input-types.ts +++ b/packages/types/src/streaming-payload/streaming-blob-payload-input-types.ts @@ -34,7 +34,7 @@ import type { BlobOptionalType, ReadableStreamOptionalType } from "../externals- * There is also the type utility "NodeJsClient", "BrowserClient" and more * exported from this package. These can be applied at the client level * to pre-narrow these streaming payload blobs. For usage see the readme.md - * in the root of the @smithy/types NPM package. + * in the root of the \@smithy/types NPM package. */ export type StreamingBlobPayloadInputTypes = | NodeJsRuntimeStreamingBlobPayloadInputTypes diff --git a/packages/types/src/transfer.ts b/packages/types/src/transfer.ts index b1eefe81b8e..06a72892ad7 100644 --- a/packages/types/src/transfer.ts +++ b/packages/types/src/transfer.ts @@ -24,14 +24,20 @@ export interface RequestHandlerMetadata { handlerProtocol: RequestHandlerProtocol | string; } -// Values from ALPN Protocol IDs -// https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids +/** + * @public + * Values from ALPN Protocol IDs. + * @see https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids + */ export enum RequestHandlerProtocol { HTTP_0_9 = "http/0.9", HTTP_1_0 = "http/1.0", TDS_8_0 = "tds/8.0", } +/** + * @public + */ export interface RequestContext { destination: URL; } diff --git a/packages/util-stream/src/headStream.ts b/packages/util-stream/src/headStream.ts index 0fe80f1e602..bdfee37d5f4 100644 --- a/packages/util-stream/src/headStream.ts +++ b/packages/util-stream/src/headStream.ts @@ -5,7 +5,7 @@ import { isReadableStream } from "./stream-type-check"; /** * @internal - * @param stream + * @param stream - to be read. * @param bytes - read head bytes from the stream and discard the rest of it. * * Caution: the input stream must be destroyed separately, this function does not do so. diff --git a/packages/util-stream/src/splitStream.ts b/packages/util-stream/src/splitStream.ts index a20ae285e20..ba3e2a3effb 100644 --- a/packages/util-stream/src/splitStream.ts +++ b/packages/util-stream/src/splitStream.ts @@ -5,7 +5,8 @@ import { splitStream as splitWebStream } from "./splitStream.browser"; import { isBlob, isReadableStream } from "./stream-type-check"; /** - * @param stream + * @internal + * @param stream - to be split. * @returns stream split into two identical streams. */ export async function splitStream(stream: Readable): Promise<[Readable, Readable]>;