Skip to content

Commit

Permalink
fix: update input and resolved naming (#444)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chase Coalwell authored and srchase committed Jun 16, 2023
1 parent e99dc90 commit fdbbc52
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions packages/config-resolver/src/EndpointsConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function normalizeEndpoint(
return endpoint!;
}

export interface EndpointsConfigInput {
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).
*/
Expand All @@ -35,13 +35,13 @@ interface PreviouslyResolved {
region: Provider<string>;
service: string;
}
export interface EndpointsConfigResolved
extends Required<EndpointsConfigInput> {
export interface EndpointsResolvedConfig
extends Required<EndpointsInputConfig> {
endpoint: Provider<Endpoint>;
}
export function resolveEndpointsConfig<T>(
input: T & EndpointsConfigInput & PreviouslyResolved
): T & EndpointsConfigResolved {
input: T & EndpointsInputConfig & PreviouslyResolved
): T & EndpointsResolvedConfig {
const tls = input.tls || true;
const defaultProvider = (tls: boolean, region: string) => ({
protocol: tls ? "https:" : "http:",
Expand Down
8 changes: 4 additions & 4 deletions packages/config-resolver/src/RegionConfig.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Provider } from "@aws-sdk/types";

export interface RegionConfigInput {
export interface RegionInputConfig {
/**
* The AWS region to which this client will send requests
*/
Expand All @@ -9,12 +9,12 @@ export interface RegionConfigInput {
interface PreviouslyResolved {
regionDefaultProvider: (input: any) => Provider<string>;
}
export interface RegionConfigResolved {
export interface RegionResolvedConfig {
region: Provider<string>;
}
export function resolveRegionConfig<T>(
input: T & RegionConfigInput & PreviouslyResolved
): T & RegionConfigResolved {
input: T & RegionInputConfig & PreviouslyResolved
): T & RegionResolvedConfig {
let region = input.region || input.regionDefaultProvider(input as any);
return {
...input,
Expand Down
8 changes: 4 additions & 4 deletions packages/middleware-retry/src/configurations.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { RetryStrategy } from "@aws-sdk/types";
import { ExponentialBackOffStrategy } from "./defaultStrategy";

export interface RetryConfigInput {
export interface RetryInputConfig {
/**
* The maximum number of times requests that encounter potentially transient failures should be retried
*/
Expand All @@ -11,13 +11,13 @@ export interface RetryConfigInput {
*/
retryStrategy?: RetryStrategy;
}
export interface RetryConfigResolved {
export interface RetryResolvedConfig {
maxRetries: number;
retryStrategy: RetryStrategy;
}
export function resolveRetryConfig<T>(
input: T & RetryConfigInput
): T & RetryConfigResolved {
input: T & RetryInputConfig
): T & RetryResolvedConfig {
const maxRetries = input.maxRetries === undefined ? 3 : input.maxRetries;
return {
...input,
Expand Down
6 changes: 3 additions & 3 deletions packages/middleware-retry/src/retryMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
FinalizeHandlerOutput,
Pluggable
} from "@aws-sdk/types";
import { RetryConfigResolved } from "./configurations";
import { RetryResolvedConfig } from "./configurations";

export function retryMiddleware(options: RetryConfigResolved) {
export function retryMiddleware(options: RetryResolvedConfig) {
return <Output extends MetadataBearer = MetadataBearer>(
next: FinalizeHandler<any, Output>
): FinalizeHandler<any, Output> => async (
Expand All @@ -18,7 +18,7 @@ export function retryMiddleware(options: RetryConfigResolved) {
}

export const getRetryPlugin = (
options: RetryConfigResolved
options: RetryResolvedConfig
): Pluggable<any, any> => ({
applyToStack: clientStack => {
if (options.maxRetries > 0) {
Expand Down

0 comments on commit fdbbc52

Please sign in to comment.