@smithy/smithy-client
Advanced tools
Comparing version 2.0.5 to 2.1.0
@@ -8,14 +8,12 @@ "use strict"; | ||
const checksumAlgorithms = []; | ||
if (runtimeConfig.sha256 !== undefined) { | ||
for (const id in types_1.AlgorithmId) { | ||
const algorithmId = types_1.AlgorithmId[id]; | ||
if (runtimeConfig[algorithmId] === undefined) { | ||
continue; | ||
} | ||
checksumAlgorithms.push({ | ||
algorithmId: () => types_1.AlgorithmId.SHA256, | ||
checksumConstructor: () => runtimeConfig.sha256, | ||
algorithmId: () => algorithmId, | ||
checksumConstructor: () => runtimeConfig[algorithmId], | ||
}); | ||
} | ||
if (runtimeConfig.md5 != undefined) { | ||
checksumAlgorithms.push({ | ||
algorithmId: () => types_1.AlgorithmId.MD5, | ||
checksumConstructor: () => runtimeConfig.md5, | ||
}); | ||
} | ||
return { | ||
@@ -22,0 +20,0 @@ _checksumAlgorithms: checksumAlgorithms, |
@@ -5,5 +5,7 @@ "use strict"; | ||
const checksum_1 = require("./checksum"); | ||
const retry_1 = require("./retry"); | ||
const getDefaultExtensionConfiguration = (runtimeConfig) => { | ||
return { | ||
...(0, checksum_1.getChecksumConfiguration)(runtimeConfig), | ||
...(0, retry_1.getRetryConfiguration)(runtimeConfig), | ||
}; | ||
@@ -16,4 +18,5 @@ }; | ||
...(0, checksum_1.resolveChecksumRuntimeConfig)(config), | ||
...(0, retry_1.resolveRetryRuntimeConfig)(config), | ||
}; | ||
}; | ||
exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig; |
@@ -5,14 +5,12 @@ import { AlgorithmId } from "@smithy/types"; | ||
const checksumAlgorithms = []; | ||
if (runtimeConfig.sha256 !== undefined) { | ||
for (const id in AlgorithmId) { | ||
const algorithmId = AlgorithmId[id]; | ||
if (runtimeConfig[algorithmId] === undefined) { | ||
continue; | ||
} | ||
checksumAlgorithms.push({ | ||
algorithmId: () => AlgorithmId.SHA256, | ||
checksumConstructor: () => runtimeConfig.sha256, | ||
algorithmId: () => algorithmId, | ||
checksumConstructor: () => runtimeConfig[algorithmId], | ||
}); | ||
} | ||
if (runtimeConfig.md5 != undefined) { | ||
checksumAlgorithms.push({ | ||
algorithmId: () => AlgorithmId.MD5, | ||
checksumConstructor: () => runtimeConfig.md5, | ||
}); | ||
} | ||
return { | ||
@@ -19,0 +17,0 @@ _checksumAlgorithms: checksumAlgorithms, |
import { getChecksumConfiguration, resolveChecksumRuntimeConfig } from "./checksum"; | ||
import { getRetryConfiguration, resolveRetryRuntimeConfig } from "./retry"; | ||
export const getDefaultExtensionConfiguration = (runtimeConfig) => { | ||
return { | ||
...getChecksumConfiguration(runtimeConfig), | ||
...getRetryConfiguration(runtimeConfig), | ||
}; | ||
@@ -11,3 +13,4 @@ }; | ||
...resolveChecksumRuntimeConfig(config), | ||
...resolveRetryRuntimeConfig(config), | ||
}; | ||
}; |
@@ -7,6 +7,13 @@ import type { ChecksumAlgorithm, ChecksumConfiguration, ChecksumConstructor, HashConstructor } from "@smithy/types"; | ||
*/ | ||
export declare const getChecksumConfiguration: (runtimeConfig: Partial<{ | ||
export type PartialChecksumRuntimeConfigType = Partial<{ | ||
sha256: ChecksumConstructor | HashConstructor; | ||
md5: ChecksumConstructor | HashConstructor; | ||
}>) => { | ||
crc32: ChecksumConstructor | HashConstructor; | ||
crc32c: ChecksumConstructor | HashConstructor; | ||
sha1: ChecksumConstructor | HashConstructor; | ||
}>; | ||
/** | ||
* @internal | ||
*/ | ||
export declare const getChecksumConfiguration: (runtimeConfig: PartialChecksumRuntimeConfigType) => { | ||
_checksumAlgorithms: ChecksumAlgorithm[]; | ||
@@ -19,2 +26,2 @@ addChecksumAlgorithm(algo: ChecksumAlgorithm): void; | ||
*/ | ||
export declare const resolveChecksumRuntimeConfig: (clientConfig: ChecksumConfiguration) => Partial<Record<AlgorithmId, HashConstructor | ChecksumConstructor>>; | ||
export declare const resolveChecksumRuntimeConfig: (clientConfig: ChecksumConfiguration) => PartialChecksumRuntimeConfigType; |
import type { DefaultExtensionConfiguration } from "@smithy/types"; | ||
import { getChecksumConfiguration } from "./checksum"; | ||
import { PartialChecksumRuntimeConfigType } from "./checksum"; | ||
import { PartialRetryRuntimeConfigType } from "./retry"; | ||
/** | ||
* @internal | ||
*/ | ||
export type DefaultExtensionConfigType = Parameters<typeof getChecksumConfiguration>[0]; | ||
export type DefaultExtensionRuntimeConfigType = PartialRetryRuntimeConfigType & PartialChecksumRuntimeConfigType; | ||
/** | ||
@@ -12,3 +13,5 @@ * @internal | ||
*/ | ||
export declare const getDefaultExtensionConfiguration: (runtimeConfig: DefaultExtensionConfigType) => { | ||
export declare const getDefaultExtensionConfiguration: (runtimeConfig: DefaultExtensionRuntimeConfigType) => { | ||
setRetryStrategy(retryStrategy: import("@smithy/types").Provider<import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2>): void; | ||
retryStrategy(): import("@smithy/types").Provider<import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2>; | ||
_checksumAlgorithms: import("@smithy/types").ChecksumAlgorithm[]; | ||
@@ -24,3 +27,5 @@ addChecksumAlgorithm(algo: import("@smithy/types").ChecksumAlgorithm): void; | ||
*/ | ||
export declare const getDefaultClientConfiguration: (runtimeConfig: DefaultExtensionConfigType) => { | ||
export declare const getDefaultClientConfiguration: (runtimeConfig: DefaultExtensionRuntimeConfigType) => { | ||
setRetryStrategy(retryStrategy: import("@smithy/types").Provider<import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2>): void; | ||
retryStrategy(): import("@smithy/types").Provider<import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2>; | ||
_checksumAlgorithms: import("@smithy/types").ChecksumAlgorithm[]; | ||
@@ -35,8 +40,2 @@ addChecksumAlgorithm(algo: import("@smithy/types").ChecksumAlgorithm): void; | ||
*/ | ||
export declare const resolveDefaultRuntimeConfig: (config: DefaultExtensionConfiguration) => { | ||
md5?: import("@smithy/types").HashConstructor | import("@smithy/types").ChecksumConstructor | undefined; | ||
crc32?: import("@smithy/types").HashConstructor | import("@smithy/types").ChecksumConstructor | undefined; | ||
crc32c?: import("@smithy/types").HashConstructor | import("@smithy/types").ChecksumConstructor | undefined; | ||
sha1?: import("@smithy/types").HashConstructor | import("@smithy/types").ChecksumConstructor | undefined; | ||
sha256?: import("@smithy/types").HashConstructor | import("@smithy/types").ChecksumConstructor | undefined; | ||
}; | ||
export declare const resolveDefaultRuntimeConfig: (config: DefaultExtensionConfiguration) => DefaultExtensionRuntimeConfigType; |
@@ -7,6 +7,13 @@ import { ChecksumAlgorithm, ChecksumConfiguration, ChecksumConstructor, HashConstructor } from "@smithy/types"; | ||
*/ | ||
export declare const getChecksumConfiguration: (runtimeConfig: Partial<{ | ||
export type PartialChecksumRuntimeConfigType = Partial<{ | ||
sha256: ChecksumConstructor | HashConstructor; | ||
md5: ChecksumConstructor | HashConstructor; | ||
}>) => { | ||
crc32: ChecksumConstructor | HashConstructor; | ||
crc32c: ChecksumConstructor | HashConstructor; | ||
sha1: ChecksumConstructor | HashConstructor; | ||
}>; | ||
/** | ||
* @internal | ||
*/ | ||
export declare const getChecksumConfiguration: (runtimeConfig: PartialChecksumRuntimeConfigType) => { | ||
_checksumAlgorithms: ChecksumAlgorithm[]; | ||
@@ -19,2 +26,2 @@ addChecksumAlgorithm(algo: ChecksumAlgorithm): void; | ||
*/ | ||
export declare const resolveChecksumRuntimeConfig: (clientConfig: ChecksumConfiguration) => Partial<Record<AlgorithmId, HashConstructor | ChecksumConstructor>>; | ||
export declare const resolveChecksumRuntimeConfig: (clientConfig: ChecksumConfiguration) => PartialChecksumRuntimeConfigType; |
import { DefaultExtensionConfiguration } from "@smithy/types"; | ||
import { getChecksumConfiguration } from "./checksum"; | ||
import { PartialChecksumRuntimeConfigType } from "./checksum"; | ||
import { PartialRetryRuntimeConfigType } from "./retry"; | ||
/** | ||
* @internal | ||
*/ | ||
export type DefaultExtensionConfigType = Parameters<typeof getChecksumConfiguration>[0]; | ||
export type DefaultExtensionRuntimeConfigType = PartialRetryRuntimeConfigType & PartialChecksumRuntimeConfigType; | ||
/** | ||
@@ -12,3 +13,5 @@ * @internal | ||
*/ | ||
export declare const getDefaultExtensionConfiguration: (runtimeConfig: DefaultExtensionConfigType) => { | ||
export declare const getDefaultExtensionConfiguration: (runtimeConfig: DefaultExtensionRuntimeConfigType) => { | ||
setRetryStrategy(retryStrategy: import("@smithy/types").Provider<import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2>): void; | ||
retryStrategy(): import("@smithy/types").Provider<import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2>; | ||
_checksumAlgorithms: import("@smithy/types").ChecksumAlgorithm[]; | ||
@@ -24,3 +27,5 @@ addChecksumAlgorithm(algo: import("@smithy/types").ChecksumAlgorithm): void; | ||
*/ | ||
export declare const getDefaultClientConfiguration: (runtimeConfig: DefaultExtensionConfigType) => { | ||
export declare const getDefaultClientConfiguration: (runtimeConfig: DefaultExtensionRuntimeConfigType) => { | ||
setRetryStrategy(retryStrategy: import("@smithy/types").Provider<import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2>): void; | ||
retryStrategy(): import("@smithy/types").Provider<import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2>; | ||
_checksumAlgorithms: import("@smithy/types").ChecksumAlgorithm[]; | ||
@@ -35,8 +40,2 @@ addChecksumAlgorithm(algo: import("@smithy/types").ChecksumAlgorithm): void; | ||
*/ | ||
export declare const resolveDefaultRuntimeConfig: (config: DefaultExtensionConfiguration) => { | ||
md5?: import("@smithy/types").HashConstructor | import("@smithy/types").ChecksumConstructor | undefined; | ||
crc32?: import("@smithy/types").HashConstructor | import("@smithy/types").ChecksumConstructor | undefined; | ||
crc32c?: import("@smithy/types").HashConstructor | import("@smithy/types").ChecksumConstructor | undefined; | ||
sha1?: import("@smithy/types").HashConstructor | import("@smithy/types").ChecksumConstructor | undefined; | ||
sha256?: import("@smithy/types").HashConstructor | import("@smithy/types").ChecksumConstructor | undefined; | ||
}; | ||
export declare const resolveDefaultRuntimeConfig: (config: DefaultExtensionConfiguration) => DefaultExtensionRuntimeConfigType; |
{ | ||
"name": "@smithy/smithy-client", | ||
"version": "2.0.5", | ||
"version": "2.1.0", | ||
"scripts": { | ||
@@ -27,4 +27,4 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'", | ||
"@smithy/middleware-stack": "^2.0.0", | ||
"@smithy/types": "^2.2.2", | ||
"@smithy/util-stream": "^2.0.5", | ||
"@smithy/types": "^2.3.0", | ||
"@smithy/util-stream": "^2.0.6", | ||
"tslib": "^2.5.0" | ||
@@ -31,0 +31,0 @@ }, |
151620
107
3583
0
Updated@smithy/types@^2.3.0
Updated@smithy/util-stream@^2.0.6