-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(clients): change runtime config from constant to functional
- Loading branch information
1 parent
39484e5
commit 46a36f3
Showing
1,370 changed files
with
21,115 additions
and
16,460 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import { Sha256 } from "@aws-crypto/sha256-js"; | ||
import { ClientDefaults } from "./AccessAnalyzerClient"; | ||
import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser"; | ||
import { nullishCoalescing as coalesce } from "@aws-sdk/smithy-client"; | ||
import { AccessAnalyzerClientConfig } from "./AccessAnalyzerClient"; | ||
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const ClientDefaultValues: Required<ClientDefaults> = { | ||
...BrowserDefaults, | ||
runtime: "react-native", | ||
sha256: Sha256, | ||
export const getRuntimeConfig = (config: AccessAnalyzerClientConfig) => { | ||
const browserDefaults = getBrowserRuntimeConfig(config); | ||
return { | ||
...browserDefaults, | ||
runtime: "react-native", | ||
sha256: coalesce(config.sha256, Sha256), | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import { defaultRegionInfoProvider } from "./endpoints"; | ||
import { nullishCoalescing as coalesce } from "@aws-sdk/smithy-client"; | ||
import { Logger as __Logger } from "@aws-sdk/types"; | ||
import { parseUrl } from "@aws-sdk/url-parser"; | ||
import { AccessAnalyzerClientConfig } from "./AccessAnalyzerClient"; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const ClientSharedValues = { | ||
export const getRuntimeConfig = (config: AccessAnalyzerClientConfig) => ({ | ||
apiVersion: "2019-11-01", | ||
disableHostPrefix: false, | ||
logger: {} as __Logger, | ||
regionInfoProvider: defaultRegionInfoProvider, | ||
serviceId: "AccessAnalyzer", | ||
urlParser: parseUrl, | ||
}; | ||
disableHostPrefix: coalesce(config.disableHostPrefix, false), | ||
logger: coalesce(config.logger, {} as __Logger), | ||
regionInfoProvider: coalesce(config.regionInfoProvider, defaultRegionInfoProvider), | ||
serviceId: coalesce(config.serviceId, "AccessAnalyzer"), | ||
urlParser: coalesce(config.urlParser, parseUrl), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import { Sha256 } from "@aws-crypto/sha256-js"; | ||
import { ClientDefaults } from "./ACMPCAClient"; | ||
import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser"; | ||
import { nullishCoalescing as coalesce } from "@aws-sdk/smithy-client"; | ||
import { ACMPCAClientConfig } from "./ACMPCAClient"; | ||
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const ClientDefaultValues: Required<ClientDefaults> = { | ||
...BrowserDefaults, | ||
runtime: "react-native", | ||
sha256: Sha256, | ||
export const getRuntimeConfig = (config: ACMPCAClientConfig) => { | ||
const browserDefaults = getBrowserRuntimeConfig(config); | ||
return { | ||
...browserDefaults, | ||
runtime: "react-native", | ||
sha256: coalesce(config.sha256, Sha256), | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import { defaultRegionInfoProvider } from "./endpoints"; | ||
import { nullishCoalescing as coalesce } from "@aws-sdk/smithy-client"; | ||
import { Logger as __Logger } from "@aws-sdk/types"; | ||
import { parseUrl } from "@aws-sdk/url-parser"; | ||
import { ACMPCAClientConfig } from "./ACMPCAClient"; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const ClientSharedValues = { | ||
export const getRuntimeConfig = (config: ACMPCAClientConfig) => ({ | ||
apiVersion: "2017-08-22", | ||
disableHostPrefix: false, | ||
logger: {} as __Logger, | ||
regionInfoProvider: defaultRegionInfoProvider, | ||
serviceId: "ACM PCA", | ||
urlParser: parseUrl, | ||
}; | ||
disableHostPrefix: coalesce(config.disableHostPrefix, false), | ||
logger: coalesce(config.logger, {} as __Logger), | ||
regionInfoProvider: coalesce(config.regionInfoProvider, defaultRegionInfoProvider), | ||
serviceId: coalesce(config.serviceId, "ACM PCA"), | ||
urlParser: coalesce(config.urlParser, parseUrl), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.