Skip to content

Commit

Permalink
Rename defaultClientConfiguration to defaultExtensionConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewFossAWS committed Aug 22, 2023
1 parent a6d8ea5 commit 48a5cd2
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 64 deletions.
6 changes: 6 additions & 0 deletions .changeset/slow-clocks-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@smithy/smithy-client": patch
"@smithy/types": patch
---

Rename defaultClientConfiguration to defaultExtensionConfiguration
36 changes: 3 additions & 33 deletions packages/smithy-client/src/extensions/checksum.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,7 @@
import type { ChecksumConstructor, HashConstructor } from "@smithy/types";
import type { ChecksumAlgorithm, ChecksumConfiguration, ChecksumConstructor, HashConstructor } from "@smithy/types";
import { AlgorithmId } from "@smithy/types";

/**
* @internal
*
* @deprecated will be imported from types.
*/
export enum AlgorithmId {
MD5 = "md5",
CRC32 = "crc32",
CRC32C = "crc32c",
SHA1 = "sha1",
SHA256 = "sha256",
}

/**
* @internal
*
* @deprecated will be imported from types.
*/
export interface ChecksumAlgorithm {
algorithmId(): AlgorithmId;
checksumConstructor(): ChecksumConstructor | HashConstructor;
}

/**
* @internal
*
* @deprecated will be imported from types.
*/
export interface ChecksumConfiguration {
addChecksumAlgorithm(algo: ChecksumAlgorithm): void;
checksumAlgorithms(): ChecksumAlgorithm[];
}
export { AlgorithmId, ChecksumAlgorithm, ChecksumConfiguration };

/**
* @internal
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import type { DefaultExtensionConfiguration } from "@smithy/types";

import { getChecksumConfiguration, resolveChecksumRuntimeConfig } from "./checksum";

/**
* @internal
*/
export type DefaultExtensionConfigType = Parameters<typeof getChecksumConfiguration>[0];

/**
* @internal
*
* Helper function to resolve default extension configuration from runtime config
*/
export const getDefaultExtensionConfiguration = (runtimeConfig: DefaultExtensionConfigType) => {
return {
...getChecksumConfiguration(runtimeConfig),
};
};

/**
* @deprecated use getDefaultExtensionConfiguration
*
* Helper function to resolve default extension configuration from runtime config
*/
export const getDefaultClientConfiguration = getDefaultExtensionConfiguration;

/**
* @internal
*
* Helper function to resolve runtime config from default extension configuration
*/
export const resolveDefaultRuntimeConfig = (config: DefaultExtensionConfiguration) => {
return {
...resolveChecksumRuntimeConfig(config),
};
};
2 changes: 1 addition & 1 deletion packages/smithy-client/src/extensions/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "./defaultClientConfiguration";
export * from "./defaultExtensionConfiguration";
1 change: 1 addition & 0 deletions packages/smithy-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export * from "./date-utils";
export * from "./default-error-handler";
export * from "./defaults-mode";
export * from "./emitWarningIfUnsupportedVersion";
export * from "./extensions";
export * from "./exceptions";
export * from "./extended-encode-uri-component";
export * from "./get-array-if-single-item";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ChecksumConfiguration, getChecksumConfiguration, resolveChecksumRuntimeConfig } from "./checksum";

/**
* @deprecated will be replaced by DefaultExtensionConfiguration.
* @internal
*
* Default client configuration consisting various configurations for modifying a service client
Expand Down
10 changes: 10 additions & 0 deletions packages/types/src/extensions/defaultExtensionConfiguration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ChecksumConfiguration } from "./checksum";

/**
* @internal
*
* Default extension configuration consisting various configurations for modifying a service client
*/
export interface DefaultExtensionConfiguration extends ChecksumConfiguration {}

type GetDefaultConfigurationType = (runtimeConfig: any) => DefaultExtensionConfiguration;
1 change: 1 addition & 0 deletions packages/types/src/extensions/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./defaultClientConfiguration";
export * from "./defaultExtensionConfiguration";
export { AlgorithmId, ChecksumAlgorithm, ChecksumConfiguration } from "./checksum";

0 comments on commit 48a5cd2

Please sign in to comment.