Skip to content

Commit

Permalink
docs: fix various tsdoc tags (#1481)
Browse files Browse the repository at this point in the history
* docs: fix various tsdoc tags

* set changeset to empty
  • Loading branch information
kuhe authored Dec 31, 2024
1 parent d8446cf commit e42eb49
Show file tree
Hide file tree
Showing 63 changed files with 391 additions and 42 deletions.
2 changes: 2 additions & 0 deletions .changeset/proud-bats-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export interface CustomEndpointsInputConfig extends EndpointsInputConfig {
endpoint: string | Endpoint | Provider<Endpoint>;
}

/**
* @internal
*/
interface PreviouslyResolved {
urlParser: UrlParser;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export interface EndpointsInputConfig {
useDualstackEndpoint?: boolean | Provider<boolean>;
}

/**
* @internal
*/
interface PreviouslyResolved {
regionInfoProvider: RegionInfoProvider;
urlParser: UrlParser;
Expand Down Expand Up @@ -55,7 +58,7 @@ export interface EndpointsResolvedConfig extends Required<EndpointsInputConfig>
/**
* @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 = <T>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export interface EventStreamSerdeResolvedConfig {
eventStreamMarshaller: EventStreamMarshaller;
}

/**
* @internal
*/
interface PreviouslyResolved {
/**
* Provide the event stream marshaller for the given runtime
Expand Down
17 changes: 9 additions & 8 deletions packages/fetch-http-handler/src/fetch-http-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -35,9 +36,9 @@ export type AdditionalRequestParameters = {
*
* HttpHandler implementation using browsers' `fetch` global function.
*/
export class FetchHttpHandler implements HttpHandler<FetchHttpHandlerConfig> {
private config?: FetchHttpHandlerConfig;
private configProvider: Promise<FetchHttpHandlerConfig>;
export class FetchHttpHandler implements HttpHandler<FetchHttpHandlerOptions> {
private config?: FetchHttpHandlerOptions;
private configProvider: Promise<FetchHttpHandlerOptions>;

/**
* @returns the input if it is an HttpHandler of any class,
Expand All @@ -51,7 +52,7 @@ export class FetchHttpHandler implements HttpHandler<FetchHttpHandlerConfig> {
return instanceOrOptions as HttpHandler<any>;
}
// input is ctor options or undefined.
return new FetchHttpHandler(instanceOrOptions as FetchHttpHandlerConfig);
return new FetchHttpHandler(instanceOrOptions as FetchHttpHandlerOptions);
}

constructor(options?: FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | void>) {
Expand Down Expand Up @@ -199,15 +200,15 @@ export class FetchHttpHandler implements HttpHandler<FetchHttpHandlerConfig> {
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<typeof key, typeof value>)[key] = value;
return config;
});
}

httpHandlerConfigs(): FetchHttpHandlerConfig {
httpHandlerConfigs(): FetchHttpHandlerOptions {
return this.config ?? {};
}
}
5 changes: 4 additions & 1 deletion packages/middleware-endpoint/src/resolveEndpointConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export interface EndpointInputConfig<T extends EndpointParameters = EndpointPara
serviceConfiguredEndpoint?: never;
}

/**
* @internal
*/
interface PreviouslyResolved<T extends EndpointParameters = EndpointParameters> {
urlParser: UrlParser;
region: Provider<string>;
Expand All @@ -63,7 +66,7 @@ interface PreviouslyResolved<T extends EndpointParameters = EndpointParameters>
* @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<T extends EndpointParameters = EndpointParameters> {
/**
Expand Down
2 changes: 2 additions & 0 deletions packages/middleware-retry/src/AdaptiveRetryStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ 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 {
rateLimiter?: RateLimiter;
}

/**
* @public
* @deprecated use AdaptiveRetryStrategy from @smithy/util-retry
*/
export class AdaptiveRetryStrategy extends StandardRetryStrategy {
Expand Down
3 changes: 3 additions & 0 deletions packages/middleware-retry/src/StandardRetryStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -29,6 +31,7 @@ export interface StandardRetryStrategyOptions {
}

/**
* @public
* @deprecated use StandardRetryStrategy from @smithy/util-retry
*/
export class StandardRetryStrategy implements RetryStrategy {
Expand Down
22 changes: 22 additions & 0 deletions packages/middleware-retry/src/configurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<number> = {
environmentVariableSelector: (env) => {
const value = env[ENV_MAX_ATTEMPTS];
Expand Down Expand Up @@ -73,6 +82,9 @@ export interface RetryResolvedConfig {
retryStrategy: Provider<RetryStrategyV2 | RetryStrategy>;
}

/**
* @internal
*/
export const resolveRetryConfig = <T>(input: T & PreviouslyResolved & RetryInputConfig): T & RetryResolvedConfig => {
const { retryStrategy } = input;
const maxAttempts = normalizeProvider(input.maxAttempts ?? DEFAULT_MAX_ATTEMPTS);
Expand All @@ -92,9 +104,19 @@ export const resolveRetryConfig = <T>(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<string> = {
environmentVariableSelector: (env) => env[ENV_RETRY_MODE],
configFileSelector: (profile) => profile[CONFIG_RETRY_MODE],
Expand Down
6 changes: 6 additions & 0 deletions packages/middleware-retry/src/defaultRetryQuota.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions packages/middleware-retry/src/delayDecider.ts
Original file line number Diff line number Diff line change
@@ -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) =>
Expand Down
15 changes: 13 additions & 2 deletions packages/middleware-retry/src/omitRetryHeadersMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import {
} from "@smithy/types";
import { INVOCATION_ID_HEADER, REQUEST_HEADER } from "@smithy/util-retry";

/**
* @internal
*/
export const omitRetryHeadersMiddleware =
() =>
<Output extends MetadataBearer = MetadataBearer>(next: FinalizeHandler<any, Output>): FinalizeHandler<any, Output> =>
Expand All @@ -21,6 +24,9 @@ export const omitRetryHeadersMiddleware =
return next(args);
};

/**
* @internal
*/
export const omitRetryHeadersMiddlewareOptions: RelativeMiddlewareOptions = {
name: "omitRetryHeadersMiddleware",
tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"],
Expand All @@ -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<any, any> => ({
/**
* @internal
*/
export const getOmitRetryHeadersPlugin = (
// eslint-disable-next-line @typescript-eslint/no-unused-vars
options: unknown
): Pluggable<any, any> => ({
applyToStack: (clientStack) => {
clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions);
},
Expand Down
1 change: 1 addition & 0 deletions packages/middleware-retry/src/retryDecider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
12 changes: 12 additions & 0 deletions packages/middleware-retry/src/retryMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import { RetryResolvedConfig } from "./configurations";
import { isStreamingPayload } from "./isStreamingPayload/isStreamingPayload";
import { asSdkError } from "./util";

/**
* @internal
*/
export const retryMiddleware =
(options: RetryResolvedConfig) =>
<Output extends MetadataBearer = MetadataBearer>(
Expand Down Expand Up @@ -116,6 +119,9 @@ const getRetryErrorType = (error: SdkError): RetryErrorType => {
return "CLIENT_ERROR";
};

/**
* @internal
*/
export const retryMiddlewareOptions: FinalizeRequestHandlerOptions & AbsoluteLocation = {
name: "retryMiddleware",
tags: ["RETRY"],
Expand All @@ -124,12 +130,18 @@ export const retryMiddlewareOptions: FinalizeRequestHandlerOptions & AbsoluteLoc
override: true,
};

/**
* @internal
*/
export const getRetryPlugin = (options: RetryResolvedConfig): Pluggable<any, any> => ({
applyToStack: (clientStack) => {
clientStack.add(retryMiddleware(options), retryMiddlewareOptions);
},
});

/**
* @internal
*/
export const getRetryAfterHint = (response: unknown): Date | undefined => {
if (!HttpResponse.isInstance(response)) return;

Expand Down
12 changes: 12 additions & 0 deletions packages/middleware-retry/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -15,13 +18,18 @@ 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;
}

/**
* Interface that specifies the retry quota behavior.
* @deprecated
* @internal
*/
export interface RetryQuota {
/**
Expand All @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions packages/middleware-stack/src/MiddlewareStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ const getMiddlewareNameWithAliases = (name: string | undefined, aliases: Array<s
return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`;
};

/**
* @internal
*/
export const constructStack = <Input extends object, Output extends object>(): MiddlewareStack<Input, Output> => {
let absoluteEntries: AbsoluteMiddlewareEntry<Input, Output>[] = [];
let relativeEntries: RelativeMiddlewareEntry<Input, Output>[] = [];
Expand Down
9 changes: 9 additions & 0 deletions packages/node-config-provider/src/configLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> {
/**
* A getter function getting the config values from all the environment
Expand All @@ -24,6 +30,9 @@ export interface LoadedConfigSelectors<T> {
default: FromStaticConfig<T>;
}

/**
* @internal
*/
export const loadConfig = <T = string>(
{ environmentVariableSelector, configFileSelector, default: defaultValue }: LoadedConfigSelectors<T>,
configuration: LocalConfigOptions = {}
Expand Down
Loading

0 comments on commit e42eb49

Please sign in to comment.