diff --git a/clients/client-accessanalyzer/AccessAnalyzerClient.ts b/clients/client-accessanalyzer/AccessAnalyzerClient.ts index f9c23f265187..5c517e0649a4 100644 --- a/clients/client-accessanalyzer/AccessAnalyzerClient.ts +++ b/clients/client-accessanalyzer/AccessAnalyzerClient.ts @@ -62,6 +62,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -72,6 +73,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -161,11 +163,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -207,6 +204,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AccessAnalyzerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -215,8 +218,8 @@ export type AccessAnalyzerClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AccessAnalyzerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -224,8 +227,8 @@ export type AccessAnalyzerClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS IAM Access Analyzer helps identify potential resource-access risks by enabling you to identify @@ -253,16 +256,16 @@ export class AccessAnalyzerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-accessanalyzer/runtimeConfig.browser.ts b/clients/client-accessanalyzer/runtimeConfig.browser.ts index aea62fb42625..aeb0a8d93038 100644 --- a/clients/client-accessanalyzer/runtimeConfig.browser.ts +++ b/clients/client-accessanalyzer/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-accessanalyzer/runtimeConfig.native.ts b/clients/client-accessanalyzer/runtimeConfig.native.ts index 977139ea8ccf..27025d278a61 100644 --- a/clients/client-accessanalyzer/runtimeConfig.native.ts +++ b/clients/client-accessanalyzer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AccessAnalyzerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-accessanalyzer/runtimeConfig.ts b/clients/client-accessanalyzer/runtimeConfig.ts index fe6bac89cd3a..11316e2e9053 100644 --- a/clients/client-accessanalyzer/runtimeConfig.ts +++ b/clients/client-accessanalyzer/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-acm-pca/ACMPCAClient.ts b/clients/client-acm-pca/ACMPCAClient.ts index 5e197d837534..978832399643 100644 --- a/clients/client-acm-pca/ACMPCAClient.ts +++ b/clients/client-acm-pca/ACMPCAClient.ts @@ -97,6 +97,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -107,6 +108,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -206,11 +208,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -252,6 +249,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ACMPCAClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -260,8 +263,8 @@ export type ACMPCAClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ACMPCAClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -269,8 +272,8 @@ export type ACMPCAClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * @@ -307,16 +310,16 @@ export class ACMPCAClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-acm-pca/runtimeConfig.browser.ts b/clients/client-acm-pca/runtimeConfig.browser.ts index 9b071e3e9dd5..a4bcf1ceb424 100644 --- a/clients/client-acm-pca/runtimeConfig.browser.ts +++ b/clients/client-acm-pca/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-acm-pca/runtimeConfig.native.ts b/clients/client-acm-pca/runtimeConfig.native.ts index d103502caad3..3bc3237efc3b 100644 --- a/clients/client-acm-pca/runtimeConfig.native.ts +++ b/clients/client-acm-pca/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ACMPCAClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-acm-pca/runtimeConfig.ts b/clients/client-acm-pca/runtimeConfig.ts index f7c71161f59e..455c8822cf33 100644 --- a/clients/client-acm-pca/runtimeConfig.ts +++ b/clients/client-acm-pca/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-acm/ACMClient.ts b/clients/client-acm/ACMClient.ts index 1ba3fef53d5a..c011c6492ab2 100644 --- a/clients/client-acm/ACMClient.ts +++ b/clients/client-acm/ACMClient.ts @@ -66,6 +66,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -76,6 +77,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -155,11 +157,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -201,6 +198,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ACMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -209,8 +212,8 @@ export type ACMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ACMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -218,8 +221,8 @@ export type ACMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Certificate Manager @@ -246,16 +249,16 @@ export class ACMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-acm/runtimeConfig.browser.ts b/clients/client-acm/runtimeConfig.browser.ts index 92c538fdd681..bcefe6b8a7f9 100644 --- a/clients/client-acm/runtimeConfig.browser.ts +++ b/clients/client-acm/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-acm/runtimeConfig.native.ts b/clients/client-acm/runtimeConfig.native.ts index df9a10ab63b6..3583aceeb6c1 100644 --- a/clients/client-acm/runtimeConfig.native.ts +++ b/clients/client-acm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ACMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-acm/runtimeConfig.ts b/clients/client-acm/runtimeConfig.ts index b40f62b46c22..16efc30de391 100644 --- a/clients/client-acm/runtimeConfig.ts +++ b/clients/client-acm/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-alexa-for-business/AlexaForBusinessClient.ts b/clients/client-alexa-for-business/AlexaForBusinessClient.ts index 038500f442bc..61f74d02194f 100644 --- a/clients/client-alexa-for-business/AlexaForBusinessClient.ts +++ b/clients/client-alexa-for-business/AlexaForBusinessClient.ts @@ -245,6 +245,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -255,6 +256,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -494,11 +496,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -540,6 +537,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AlexaForBusinessClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -548,8 +551,8 @@ export type AlexaForBusinessClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AlexaForBusinessClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -557,8 +560,8 @@ export type AlexaForBusinessClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Alexa for Business helps you use Alexa in your organization. Alexa for Business provides you with the tools @@ -587,16 +590,16 @@ export class AlexaForBusinessClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-alexa-for-business/runtimeConfig.browser.ts b/clients/client-alexa-for-business/runtimeConfig.browser.ts index 9b181024e292..a2cff05b4fa5 100644 --- a/clients/client-alexa-for-business/runtimeConfig.browser.ts +++ b/clients/client-alexa-for-business/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-alexa-for-business/runtimeConfig.native.ts b/clients/client-alexa-for-business/runtimeConfig.native.ts index 0a2c52c955f3..ad88f4b0f6fb 100644 --- a/clients/client-alexa-for-business/runtimeConfig.native.ts +++ b/clients/client-alexa-for-business/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AlexaForBusinessClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-alexa-for-business/runtimeConfig.ts b/clients/client-alexa-for-business/runtimeConfig.ts index a7671434b418..1f68c8b42ce4 100644 --- a/clients/client-alexa-for-business/runtimeConfig.ts +++ b/clients/client-alexa-for-business/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-amplify/AmplifyClient.ts b/clients/client-amplify/AmplifyClient.ts index c70758d5374b..95e83395af6d 100644 --- a/clients/client-amplify/AmplifyClient.ts +++ b/clients/client-amplify/AmplifyClient.ts @@ -102,6 +102,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -112,6 +113,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -239,11 +241,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -285,6 +282,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AmplifyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -293,8 +296,8 @@ export type AmplifyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AmplifyClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -302,8 +305,8 @@ export type AmplifyClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amplify enables developers to develop and deploy cloud-powered mobile and web apps. @@ -330,16 +333,16 @@ export class AmplifyClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-amplify/runtimeConfig.browser.ts b/clients/client-amplify/runtimeConfig.browser.ts index 94d63be37d9d..c949cd76810a 100644 --- a/clients/client-amplify/runtimeConfig.browser.ts +++ b/clients/client-amplify/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-amplify/runtimeConfig.native.ts b/clients/client-amplify/runtimeConfig.native.ts index 67186c904256..886468e2a6fe 100644 --- a/clients/client-amplify/runtimeConfig.native.ts +++ b/clients/client-amplify/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AmplifyClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-amplify/runtimeConfig.ts b/clients/client-amplify/runtimeConfig.ts index 98bbb08b8ee3..8e12c10ac52f 100644 --- a/clients/client-amplify/runtimeConfig.ts +++ b/clients/client-amplify/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-amplifybackend/AmplifyBackendClient.ts b/clients/client-amplifybackend/AmplifyBackendClient.ts index 57c1ba5c2479..27763b2c4cdd 100644 --- a/clients/client-amplifybackend/AmplifyBackendClient.ts +++ b/clients/client-amplifybackend/AmplifyBackendClient.ts @@ -74,6 +74,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -84,6 +85,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AmplifyBackendClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +242,8 @@ export type AmplifyBackendClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AmplifyBackendClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +251,8 @@ export type AmplifyBackendClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Amplify Admin API

@@ -271,16 +274,16 @@ export class AmplifyBackendClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-amplifybackend/runtimeConfig.browser.ts b/clients/client-amplifybackend/runtimeConfig.browser.ts index 1ad28c41c63a..8b63035791eb 100644 --- a/clients/client-amplifybackend/runtimeConfig.browser.ts +++ b/clients/client-amplifybackend/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-amplifybackend/runtimeConfig.native.ts b/clients/client-amplifybackend/runtimeConfig.native.ts index 56a11bbb199d..f0be385fe824 100644 --- a/clients/client-amplifybackend/runtimeConfig.native.ts +++ b/clients/client-amplifybackend/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AmplifyBackendClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-amplifybackend/runtimeConfig.ts b/clients/client-amplifybackend/runtimeConfig.ts index 8b2a934698ef..e83cbf1e5d96 100644 --- a/clients/client-amplifybackend/runtimeConfig.ts +++ b/clients/client-amplifybackend/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-api-gateway/APIGatewayClient.ts b/clients/client-api-gateway/APIGatewayClient.ts index 0ca741da0c6d..f4a40d2befed 100644 --- a/clients/client-api-gateway/APIGatewayClient.ts +++ b/clients/client-api-gateway/APIGatewayClient.ts @@ -264,6 +264,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -274,6 +275,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -567,11 +569,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -613,6 +610,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type APIGatewayClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -621,8 +624,8 @@ export type APIGatewayClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type APIGatewayClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -630,8 +633,8 @@ export type APIGatewayClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon API Gateway @@ -654,17 +657,17 @@ export class APIGatewayClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getAcceptHeaderPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-api-gateway/runtimeConfig.browser.ts b/clients/client-api-gateway/runtimeConfig.browser.ts index fd249324763e..7400734f7dd8 100644 --- a/clients/client-api-gateway/runtimeConfig.browser.ts +++ b/clients/client-api-gateway/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-api-gateway/runtimeConfig.native.ts b/clients/client-api-gateway/runtimeConfig.native.ts index 09bcef62e907..b163cffadc3b 100644 --- a/clients/client-api-gateway/runtimeConfig.native.ts +++ b/clients/client-api-gateway/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./APIGatewayClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-api-gateway/runtimeConfig.ts b/clients/client-api-gateway/runtimeConfig.ts index ab7c57f926a2..e251975dfd37 100644 --- a/clients/client-api-gateway/runtimeConfig.ts +++ b/clients/client-api-gateway/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-apigatewaymanagementapi/ApiGatewayManagementApiClient.ts b/clients/client-apigatewaymanagementapi/ApiGatewayManagementApiClient.ts index f916a2e0b43f..477b27084e8c 100644 --- a/clients/client-apigatewaymanagementapi/ApiGatewayManagementApiClient.ts +++ b/clients/client-apigatewaymanagementapi/ApiGatewayManagementApiClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = DeleteConnectionCommandInput | GetConnectionCommandInput | PostToConnectionCommandInput; @@ -104,11 +106,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -150,6 +147,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ApiGatewayManagementApiClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -158,8 +161,8 @@ export type ApiGatewayManagementApiClientConfig = Partial<__SmithyConfiguration< EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ApiGatewayManagementApiClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -167,8 +170,8 @@ export type ApiGatewayManagementApiClientResolvedConfig = __SmithyResolvedConfig EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Amazon API Gateway Management API allows you to directly manage runtime aspects of your deployed APIs. To use it, you must explicitly set the SDK's endpoint to point to the endpoint of your deployed API. The endpoint will be of the form https://{api-id}.execute-api.{region}.amazonaws.com/{stage}, or will be the endpoint corresponding to your API's custom domain and base path, if applicable.

@@ -190,16 +193,16 @@ export class ApiGatewayManagementApiClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-apigatewaymanagementapi/runtimeConfig.browser.ts b/clients/client-apigatewaymanagementapi/runtimeConfig.browser.ts index ee28d5c154cf..495e2a35002d 100644 --- a/clients/client-apigatewaymanagementapi/runtimeConfig.browser.ts +++ b/clients/client-apigatewaymanagementapi/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-apigatewaymanagementapi/runtimeConfig.native.ts b/clients/client-apigatewaymanagementapi/runtimeConfig.native.ts index 7230ad03c35b..418428ceb61e 100644 --- a/clients/client-apigatewaymanagementapi/runtimeConfig.native.ts +++ b/clients/client-apigatewaymanagementapi/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ApiGatewayManagementApiClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-apigatewaymanagementapi/runtimeConfig.ts b/clients/client-apigatewaymanagementapi/runtimeConfig.ts index feb00fe0763d..332453d5bb21 100644 --- a/clients/client-apigatewaymanagementapi/runtimeConfig.ts +++ b/clients/client-apigatewaymanagementapi/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-apigatewayv2/ApiGatewayV2Client.ts b/clients/client-apigatewayv2/ApiGatewayV2Client.ts index 1aced5bc712b..7acc1d8b04a3 100644 --- a/clients/client-apigatewayv2/ApiGatewayV2Client.ts +++ b/clients/client-apigatewayv2/ApiGatewayV2Client.ts @@ -146,6 +146,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -156,6 +157,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -353,11 +355,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -399,6 +396,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ApiGatewayV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -407,8 +410,8 @@ export type ApiGatewayV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ApiGatewayV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -416,8 +419,8 @@ export type ApiGatewayV2ClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon API Gateway V2

@@ -439,16 +442,16 @@ export class ApiGatewayV2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-apigatewayv2/runtimeConfig.browser.ts b/clients/client-apigatewayv2/runtimeConfig.browser.ts index b3ad587e97f7..252cbaed9c53 100644 --- a/clients/client-apigatewayv2/runtimeConfig.browser.ts +++ b/clients/client-apigatewayv2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-apigatewayv2/runtimeConfig.native.ts b/clients/client-apigatewayv2/runtimeConfig.native.ts index 01cb1a3346be..4f4096e65eda 100644 --- a/clients/client-apigatewayv2/runtimeConfig.native.ts +++ b/clients/client-apigatewayv2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ApiGatewayV2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-apigatewayv2/runtimeConfig.ts b/clients/client-apigatewayv2/runtimeConfig.ts index d9a914fe7a49..a598bbbb59b3 100644 --- a/clients/client-apigatewayv2/runtimeConfig.ts +++ b/clients/client-apigatewayv2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-app-mesh/AppMeshClient.ts b/clients/client-app-mesh/AppMeshClient.ts index b9fc0b6e1831..36fd67cc52ab 100644 --- a/clients/client-app-mesh/AppMeshClient.ts +++ b/clients/client-app-mesh/AppMeshClient.ts @@ -124,6 +124,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -134,6 +135,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -263,11 +265,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -309,6 +306,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AppMeshClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -317,8 +320,8 @@ export type AppMeshClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppMeshClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -326,8 +329,8 @@ export type AppMeshClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS App Mesh is a service mesh based on the Envoy proxy that makes it easy to monitor and @@ -361,16 +364,16 @@ export class AppMeshClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-app-mesh/runtimeConfig.browser.ts b/clients/client-app-mesh/runtimeConfig.browser.ts index 828cbab88391..86c3bc604ead 100644 --- a/clients/client-app-mesh/runtimeConfig.browser.ts +++ b/clients/client-app-mesh/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-app-mesh/runtimeConfig.native.ts b/clients/client-app-mesh/runtimeConfig.native.ts index 268b7f6eee3f..4b9aaa11dd34 100644 --- a/clients/client-app-mesh/runtimeConfig.native.ts +++ b/clients/client-app-mesh/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppMeshClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-app-mesh/runtimeConfig.ts b/clients/client-app-mesh/runtimeConfig.ts index 85c57aa16db8..8ee5368a017a 100644 --- a/clients/client-app-mesh/runtimeConfig.ts +++ b/clients/client-app-mesh/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-appconfig/AppConfigClient.ts b/clients/client-appconfig/AppConfigClient.ts index 8bf768cb6162..5300da19290c 100644 --- a/clients/client-appconfig/AppConfigClient.ts +++ b/clients/client-appconfig/AppConfigClient.ts @@ -116,6 +116,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -126,6 +127,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -245,11 +247,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -291,6 +288,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AppConfigClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -299,8 +302,8 @@ export type AppConfigClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppConfigClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -308,8 +311,8 @@ export type AppConfigClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS AppConfig @@ -379,16 +382,16 @@ export class AppConfigClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-appconfig/runtimeConfig.browser.ts b/clients/client-appconfig/runtimeConfig.browser.ts index 2cf27d1514fa..70c3399964a3 100644 --- a/clients/client-appconfig/runtimeConfig.browser.ts +++ b/clients/client-appconfig/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-appconfig/runtimeConfig.native.ts b/clients/client-appconfig/runtimeConfig.native.ts index af56e0576fd6..7437c5e8815b 100644 --- a/clients/client-appconfig/runtimeConfig.native.ts +++ b/clients/client-appconfig/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppConfigClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-appconfig/runtimeConfig.ts b/clients/client-appconfig/runtimeConfig.ts index 489ae088f386..0eb9c14b6180 100644 --- a/clients/client-appconfig/runtimeConfig.ts +++ b/clients/client-appconfig/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-appflow/AppflowClient.ts b/clients/client-appflow/AppflowClient.ts index eeeec77bc817..2968f827d747 100644 --- a/clients/client-appflow/AppflowClient.ts +++ b/clients/client-appflow/AppflowClient.ts @@ -77,6 +77,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -87,6 +88,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -176,11 +178,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -222,6 +219,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AppflowClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -230,8 +233,8 @@ export type AppflowClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppflowClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -239,8 +242,8 @@ export type AppflowClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the Amazon AppFlow API reference. This guide is for developers who need detailed information about the Amazon AppFlow API operations, data types, and errors.

@@ -292,16 +295,16 @@ export class AppflowClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-appflow/runtimeConfig.browser.ts b/clients/client-appflow/runtimeConfig.browser.ts index 7ea6f6d852d1..07716d2d9cf8 100644 --- a/clients/client-appflow/runtimeConfig.browser.ts +++ b/clients/client-appflow/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-appflow/runtimeConfig.native.ts b/clients/client-appflow/runtimeConfig.native.ts index 42e5f2fe5fbe..854e00b75367 100644 --- a/clients/client-appflow/runtimeConfig.native.ts +++ b/clients/client-appflow/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppflowClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-appflow/runtimeConfig.ts b/clients/client-appflow/runtimeConfig.ts index 1a315f3cf68c..af75cc10fb4f 100644 --- a/clients/client-appflow/runtimeConfig.ts +++ b/clients/client-appflow/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-appintegrations/AppIntegrationsClient.ts b/clients/client-appintegrations/AppIntegrationsClient.ts index f9aa5a5b5da0..8703731fd5e9 100644 --- a/clients/client-appintegrations/AppIntegrationsClient.ts +++ b/clients/client-appintegrations/AppIntegrationsClient.ts @@ -65,6 +65,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -75,6 +76,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -146,11 +148,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -192,6 +189,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AppIntegrationsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -200,8 +203,8 @@ export type AppIntegrationsClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppIntegrationsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -209,8 +212,8 @@ export type AppIntegrationsClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Amazon AppIntegrations APIs are in preview release and are subject to change.

@@ -235,16 +238,16 @@ export class AppIntegrationsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-appintegrations/runtimeConfig.browser.ts b/clients/client-appintegrations/runtimeConfig.browser.ts index f8911bb4e730..bf3d02b583b0 100644 --- a/clients/client-appintegrations/runtimeConfig.browser.ts +++ b/clients/client-appintegrations/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-appintegrations/runtimeConfig.native.ts b/clients/client-appintegrations/runtimeConfig.native.ts index 9dddd1281d4e..e54eac06d5bc 100644 --- a/clients/client-appintegrations/runtimeConfig.native.ts +++ b/clients/client-appintegrations/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppIntegrationsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-appintegrations/runtimeConfig.ts b/clients/client-appintegrations/runtimeConfig.ts index facdeb033815..c6154ae215b4 100644 --- a/clients/client-appintegrations/runtimeConfig.ts +++ b/clients/client-appintegrations/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-application-auto-scaling/ApplicationAutoScalingClient.ts b/clients/client-application-auto-scaling/ApplicationAutoScalingClient.ts index 5fd6341b8b82..8a35c613ee0b 100644 --- a/clients/client-application-auto-scaling/ApplicationAutoScalingClient.ts +++ b/clients/client-application-auto-scaling/ApplicationAutoScalingClient.ts @@ -69,6 +69,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -79,6 +80,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -152,11 +154,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -198,6 +195,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ApplicationAutoScalingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -206,8 +209,8 @@ export type ApplicationAutoScalingClientConfig = Partial<__SmithyConfiguration<_ EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ApplicationAutoScalingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -215,8 +218,8 @@ export type ApplicationAutoScalingClientResolvedConfig = __SmithyResolvedConfigu EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

With Application Auto Scaling, you can configure automatic scaling for the following @@ -305,16 +308,16 @@ export class ApplicationAutoScalingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-application-auto-scaling/runtimeConfig.browser.ts b/clients/client-application-auto-scaling/runtimeConfig.browser.ts index ba86a5f99019..672c67f8c32f 100644 --- a/clients/client-application-auto-scaling/runtimeConfig.browser.ts +++ b/clients/client-application-auto-scaling/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-application-auto-scaling/runtimeConfig.native.ts b/clients/client-application-auto-scaling/runtimeConfig.native.ts index 13d98e31c487..e649ea552238 100644 --- a/clients/client-application-auto-scaling/runtimeConfig.native.ts +++ b/clients/client-application-auto-scaling/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ApplicationAutoScalingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-application-auto-scaling/runtimeConfig.ts b/clients/client-application-auto-scaling/runtimeConfig.ts index 6dfa2648669f..27a1cb9b71c5 100644 --- a/clients/client-application-auto-scaling/runtimeConfig.ts +++ b/clients/client-application-auto-scaling/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-application-discovery-service/ApplicationDiscoveryServiceClient.ts b/clients/client-application-discovery-service/ApplicationDiscoveryServiceClient.ts index 39bc42bae53c..603270fbc9b6 100644 --- a/clients/client-application-discovery-service/ApplicationDiscoveryServiceClient.ts +++ b/clients/client-application-discovery-service/ApplicationDiscoveryServiceClient.ts @@ -105,6 +105,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -115,6 +116,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -218,11 +220,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -264,6 +261,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ApplicationDiscoveryServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -272,8 +275,8 @@ export type ApplicationDiscoveryServiceClientConfig = Partial<__SmithyConfigurat EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ApplicationDiscoveryServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -281,8 +284,8 @@ export type ApplicationDiscoveryServiceClientResolvedConfig = __SmithyResolvedCo EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Application Discovery Service @@ -430,16 +433,16 @@ export class ApplicationDiscoveryServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-application-discovery-service/runtimeConfig.browser.ts b/clients/client-application-discovery-service/runtimeConfig.browser.ts index ce53f6ccf93d..62063888123c 100644 --- a/clients/client-application-discovery-service/runtimeConfig.browser.ts +++ b/clients/client-application-discovery-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-application-discovery-service/runtimeConfig.native.ts b/clients/client-application-discovery-service/runtimeConfig.native.ts index 476ab3fc9198..f7f13bac556d 100644 --- a/clients/client-application-discovery-service/runtimeConfig.native.ts +++ b/clients/client-application-discovery-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ApplicationDiscoveryServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-application-discovery-service/runtimeConfig.ts b/clients/client-application-discovery-service/runtimeConfig.ts index 80c7f1f04d63..5b066dca0231 100644 --- a/clients/client-application-discovery-service/runtimeConfig.ts +++ b/clients/client-application-discovery-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-application-insights/ApplicationInsightsClient.ts b/clients/client-application-insights/ApplicationInsightsClient.ts index bfbf8a8e3260..3fa70ddcdd7c 100644 --- a/clients/client-application-insights/ApplicationInsightsClient.ts +++ b/clients/client-application-insights/ApplicationInsightsClient.ts @@ -86,6 +86,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -96,6 +97,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -203,11 +205,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -249,6 +246,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ApplicationInsightsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -257,8 +260,8 @@ export type ApplicationInsightsClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ApplicationInsightsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -266,8 +269,8 @@ export type ApplicationInsightsClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon CloudWatch Application Insights @@ -301,16 +304,16 @@ export class ApplicationInsightsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-application-insights/runtimeConfig.browser.ts b/clients/client-application-insights/runtimeConfig.browser.ts index 42308c08870d..49e66e814f90 100644 --- a/clients/client-application-insights/runtimeConfig.browser.ts +++ b/clients/client-application-insights/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-application-insights/runtimeConfig.native.ts b/clients/client-application-insights/runtimeConfig.native.ts index 6b4315ecaf55..a5e50d48a70d 100644 --- a/clients/client-application-insights/runtimeConfig.native.ts +++ b/clients/client-application-insights/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ApplicationInsightsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-application-insights/runtimeConfig.ts b/clients/client-application-insights/runtimeConfig.ts index 3e10b86e9ddf..93d515dbde58 100644 --- a/clients/client-application-insights/runtimeConfig.ts +++ b/clients/client-application-insights/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-appstream/AppStreamClient.ts b/clients/client-appstream/AppStreamClient.ts index 18da3ac1171a..ecb49a5b2d2b 100644 --- a/clients/client-appstream/AppStreamClient.ts +++ b/clients/client-appstream/AppStreamClient.ts @@ -136,6 +136,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -146,6 +147,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -293,11 +295,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -339,6 +336,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AppStreamClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -347,8 +350,8 @@ export type AppStreamClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppStreamClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -356,8 +359,8 @@ export type AppStreamClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon AppStream 2.0 @@ -399,16 +402,16 @@ export class AppStreamClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-appstream/runtimeConfig.browser.ts b/clients/client-appstream/runtimeConfig.browser.ts index 800136672f53..61eb82131b71 100644 --- a/clients/client-appstream/runtimeConfig.browser.ts +++ b/clients/client-appstream/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-appstream/runtimeConfig.native.ts b/clients/client-appstream/runtimeConfig.native.ts index c2b730acd6ce..c466709e8de1 100644 --- a/clients/client-appstream/runtimeConfig.native.ts +++ b/clients/client-appstream/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppStreamClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-appstream/runtimeConfig.ts b/clients/client-appstream/runtimeConfig.ts index b3ab095188b3..c26f1084d832 100644 --- a/clients/client-appstream/runtimeConfig.ts +++ b/clients/client-appstream/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-appsync/AppSyncClient.ts b/clients/client-appsync/AppSyncClient.ts index d649b1522cbf..c74656d06fcf 100644 --- a/clients/client-appsync/AppSyncClient.ts +++ b/clients/client-appsync/AppSyncClient.ts @@ -91,6 +91,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -101,6 +102,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -236,11 +238,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -282,6 +279,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AppSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -290,8 +293,8 @@ export type AppSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AppSyncClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -299,8 +302,8 @@ export type AppSyncClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS AppSync provides API actions for creating and interacting with data sources using @@ -323,16 +326,16 @@ export class AppSyncClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-appsync/runtimeConfig.browser.ts b/clients/client-appsync/runtimeConfig.browser.ts index 134b4d6e5251..80ceb4f5d2f4 100644 --- a/clients/client-appsync/runtimeConfig.browser.ts +++ b/clients/client-appsync/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-appsync/runtimeConfig.native.ts b/clients/client-appsync/runtimeConfig.native.ts index 8281561ead58..05128c0c244d 100644 --- a/clients/client-appsync/runtimeConfig.native.ts +++ b/clients/client-appsync/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AppSyncClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-appsync/runtimeConfig.ts b/clients/client-appsync/runtimeConfig.ts index f8163806f57d..eec7cf44534a 100644 --- a/clients/client-appsync/runtimeConfig.ts +++ b/clients/client-appsync/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-athena/AthenaClient.ts b/clients/client-athena/AthenaClient.ts index cd10b0250f8c..6dc66b209377 100644 --- a/clients/client-athena/AthenaClient.ts +++ b/clients/client-athena/AthenaClient.ts @@ -75,6 +75,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -85,6 +86,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -194,11 +196,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -240,6 +237,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AthenaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -248,8 +251,8 @@ export type AthenaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AthenaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -257,8 +260,8 @@ export type AthenaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Athena is an interactive query service that lets you use standard SQL to @@ -292,16 +295,16 @@ export class AthenaClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-athena/runtimeConfig.browser.ts b/clients/client-athena/runtimeConfig.browser.ts index 688953830511..41065604cf9a 100644 --- a/clients/client-athena/runtimeConfig.browser.ts +++ b/clients/client-athena/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-athena/runtimeConfig.native.ts b/clients/client-athena/runtimeConfig.native.ts index 57a7464b2c07..1df4f8e427f8 100644 --- a/clients/client-athena/runtimeConfig.native.ts +++ b/clients/client-athena/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AthenaClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-athena/runtimeConfig.ts b/clients/client-athena/runtimeConfig.ts index 2970ab64cd81..79f8cc940682 100644 --- a/clients/client-athena/runtimeConfig.ts +++ b/clients/client-athena/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-auditmanager/AuditManagerClient.ts b/clients/client-auditmanager/AuditManagerClient.ts index edacc451bb47..5d8d4b2ef77e 100644 --- a/clients/client-auditmanager/AuditManagerClient.ts +++ b/clients/client-auditmanager/AuditManagerClient.ts @@ -170,6 +170,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -180,6 +181,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -335,11 +337,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -381,6 +378,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AuditManagerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -389,8 +392,8 @@ export type AuditManagerClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AuditManagerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -398,8 +401,8 @@ export type AuditManagerClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the AWS Audit Manager API reference. This guide is for developers who need detailed information about the AWS Audit Manager API operations, data types, and errors.

@@ -451,16 +454,16 @@ export class AuditManagerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-auditmanager/runtimeConfig.browser.ts b/clients/client-auditmanager/runtimeConfig.browser.ts index afb410dded2d..27b62c42ae95 100644 --- a/clients/client-auditmanager/runtimeConfig.browser.ts +++ b/clients/client-auditmanager/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-auditmanager/runtimeConfig.native.ts b/clients/client-auditmanager/runtimeConfig.native.ts index 4685edfe7fe9..d227113c6e50 100644 --- a/clients/client-auditmanager/runtimeConfig.native.ts +++ b/clients/client-auditmanager/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AuditManagerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-auditmanager/runtimeConfig.ts b/clients/client-auditmanager/runtimeConfig.ts index e562162bb8bf..bbdac9e09853 100644 --- a/clients/client-auditmanager/runtimeConfig.ts +++ b/clients/client-auditmanager/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-auto-scaling-plans/AutoScalingPlansClient.ts b/clients/client-auto-scaling-plans/AutoScalingPlansClient.ts index 3c9aa934fa14..30e5c493f5cb 100644 --- a/clients/client-auto-scaling-plans/AutoScalingPlansClient.ts +++ b/clients/client-auto-scaling-plans/AutoScalingPlansClient.ts @@ -50,6 +50,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -60,6 +61,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -125,11 +127,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -171,6 +168,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AutoScalingPlansClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -179,8 +182,8 @@ export type AutoScalingPlansClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AutoScalingPlansClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -188,8 +191,8 @@ export type AutoScalingPlansClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Auto Scaling @@ -218,16 +221,16 @@ export class AutoScalingPlansClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-auto-scaling-plans/runtimeConfig.browser.ts b/clients/client-auto-scaling-plans/runtimeConfig.browser.ts index e186de94b36a..b8f212f41372 100644 --- a/clients/client-auto-scaling-plans/runtimeConfig.browser.ts +++ b/clients/client-auto-scaling-plans/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-auto-scaling-plans/runtimeConfig.native.ts b/clients/client-auto-scaling-plans/runtimeConfig.native.ts index ec8c0f0136d3..ffb1458f9d34 100644 --- a/clients/client-auto-scaling-plans/runtimeConfig.native.ts +++ b/clients/client-auto-scaling-plans/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AutoScalingPlansClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-auto-scaling-plans/runtimeConfig.ts b/clients/client-auto-scaling-plans/runtimeConfig.ts index 7d1e7564adeb..08b2bae41535 100644 --- a/clients/client-auto-scaling-plans/runtimeConfig.ts +++ b/clients/client-auto-scaling-plans/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-auto-scaling/AutoScalingClient.ts b/clients/client-auto-scaling/AutoScalingClient.ts index a91d682fb91f..3baac786b8aa 100644 --- a/clients/client-auto-scaling/AutoScalingClient.ts +++ b/clients/client-auto-scaling/AutoScalingClient.ts @@ -215,6 +215,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -225,6 +226,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -392,11 +394,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -438,6 +435,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type AutoScalingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -446,8 +449,8 @@ export type AutoScalingClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type AutoScalingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -455,8 +458,8 @@ export type AutoScalingClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon EC2 Auto Scaling @@ -484,16 +487,16 @@ export class AutoScalingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-auto-scaling/runtimeConfig.browser.ts b/clients/client-auto-scaling/runtimeConfig.browser.ts index fcfd7609814b..14b11b988408 100644 --- a/clients/client-auto-scaling/runtimeConfig.browser.ts +++ b/clients/client-auto-scaling/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-auto-scaling/runtimeConfig.native.ts b/clients/client-auto-scaling/runtimeConfig.native.ts index 0b3e0d6849ef..fd94fcca939c 100644 --- a/clients/client-auto-scaling/runtimeConfig.native.ts +++ b/clients/client-auto-scaling/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./AutoScalingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-auto-scaling/runtimeConfig.ts b/clients/client-auto-scaling/runtimeConfig.ts index 0ead5f163d7d..7ba2b348b8c7 100644 --- a/clients/client-auto-scaling/runtimeConfig.ts +++ b/clients/client-auto-scaling/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-backup/BackupClient.ts b/clients/client-backup/BackupClient.ts index 7a7fbfd06fb7..41afd4606d3b 100644 --- a/clients/client-backup/BackupClient.ts +++ b/clients/client-backup/BackupClient.ts @@ -169,6 +169,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -179,6 +180,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -332,11 +334,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -378,6 +375,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type BackupClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -386,8 +389,8 @@ export type BackupClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type BackupClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -395,8 +398,8 @@ export type BackupClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Backup @@ -421,16 +424,16 @@ export class BackupClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-backup/runtimeConfig.browser.ts b/clients/client-backup/runtimeConfig.browser.ts index 20fc2f3c0671..3c04da688cc2 100644 --- a/clients/client-backup/runtimeConfig.browser.ts +++ b/clients/client-backup/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-backup/runtimeConfig.native.ts b/clients/client-backup/runtimeConfig.native.ts index bfd353d68719..4371a7a73ebb 100644 --- a/clients/client-backup/runtimeConfig.native.ts +++ b/clients/client-backup/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./BackupClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-backup/runtimeConfig.ts b/clients/client-backup/runtimeConfig.ts index 6fcb94473f6d..1201043911d6 100644 --- a/clients/client-backup/runtimeConfig.ts +++ b/clients/client-backup/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-batch/BatchClient.ts b/clients/client-batch/BatchClient.ts index 691a2bc37497..961271802dfd 100644 --- a/clients/client-batch/BatchClient.ts +++ b/clients/client-batch/BatchClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -179,11 +181,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -225,6 +222,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type BatchClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -233,8 +236,8 @@ export type BatchClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type BatchClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -242,8 +245,8 @@ export type BatchClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Using AWS Batch, you can run batch computing workloads on the AWS Cloud. Batch computing is a common means for @@ -274,16 +277,16 @@ export class BatchClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-batch/runtimeConfig.browser.ts b/clients/client-batch/runtimeConfig.browser.ts index 8099a7dea94b..6452870bc5d0 100644 --- a/clients/client-batch/runtimeConfig.browser.ts +++ b/clients/client-batch/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-batch/runtimeConfig.native.ts b/clients/client-batch/runtimeConfig.native.ts index 2c6f27b10bf3..d53318dbf968 100644 --- a/clients/client-batch/runtimeConfig.native.ts +++ b/clients/client-batch/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./BatchClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-batch/runtimeConfig.ts b/clients/client-batch/runtimeConfig.ts index fd3d7c489a8a..923dc4cb2cb3 100644 --- a/clients/client-batch/runtimeConfig.ts +++ b/clients/client-batch/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-braket/BraketClient.ts b/clients/client-braket/BraketClient.ts index 2e7d2a5a2ad4..65de29601b45 100644 --- a/clients/client-braket/BraketClient.ts +++ b/clients/client-braket/BraketClient.ts @@ -41,6 +41,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -51,6 +52,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -116,11 +118,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -162,6 +159,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type BraketClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -170,8 +173,8 @@ export type BraketClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type BraketClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -179,8 +182,8 @@ export type BraketClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Amazon Braket API Reference provides information about the operations and structures supported in Amazon Braket.

@@ -202,16 +205,16 @@ export class BraketClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-braket/runtimeConfig.browser.ts b/clients/client-braket/runtimeConfig.browser.ts index c2dc763f049b..d484004a6a5a 100644 --- a/clients/client-braket/runtimeConfig.browser.ts +++ b/clients/client-braket/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-braket/runtimeConfig.native.ts b/clients/client-braket/runtimeConfig.native.ts index f10724dc05f0..e8d73bb9e624 100644 --- a/clients/client-braket/runtimeConfig.native.ts +++ b/clients/client-braket/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./BraketClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-braket/runtimeConfig.ts b/clients/client-braket/runtimeConfig.ts index d97bd40c278d..eb4cbe3e144b 100644 --- a/clients/client-braket/runtimeConfig.ts +++ b/clients/client-braket/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-budgets/BudgetsClient.ts b/clients/client-budgets/BudgetsClient.ts index d454cd98094b..ff6c65bdff75 100644 --- a/clients/client-budgets/BudgetsClient.ts +++ b/clients/client-budgets/BudgetsClient.ts @@ -81,6 +81,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -91,6 +92,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -188,11 +190,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -234,6 +231,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type BudgetsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -242,8 +245,8 @@ export type BudgetsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type BudgetsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -251,8 +254,8 @@ export type BudgetsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS Budgets API enables you to use AWS Budgets to plan your service usage, service costs, and instance reservations. The API reference provides descriptions, syntax, and usage examples for each of the actions and data types for AWS Budgets.

@@ -316,16 +319,16 @@ export class BudgetsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-budgets/runtimeConfig.browser.ts b/clients/client-budgets/runtimeConfig.browser.ts index 28528ee7c7b2..62aeae2b5d24 100644 --- a/clients/client-budgets/runtimeConfig.browser.ts +++ b/clients/client-budgets/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-budgets/runtimeConfig.native.ts b/clients/client-budgets/runtimeConfig.native.ts index 8f5eeae7675c..3278370473d9 100644 --- a/clients/client-budgets/runtimeConfig.native.ts +++ b/clients/client-budgets/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./BudgetsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-budgets/runtimeConfig.ts b/clients/client-budgets/runtimeConfig.ts index 14782fb1ba9a..569fa37dce2e 100644 --- a/clients/client-budgets/runtimeConfig.ts +++ b/clients/client-budgets/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-chime/ChimeClient.ts b/clients/client-chime/ChimeClient.ts index 2f185513876b..52afda6689ad 100644 --- a/clients/client-chime/ChimeClient.ts +++ b/clients/client-chime/ChimeClient.ts @@ -531,6 +531,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -541,6 +542,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -956,11 +958,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -1002,6 +999,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ChimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -1010,8 +1013,8 @@ export type ChimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ChimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -1019,8 +1022,8 @@ export type ChimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Amazon Chime API (application programming interface) is designed for developers to @@ -1080,16 +1083,16 @@ export class ChimeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-chime/runtimeConfig.browser.ts b/clients/client-chime/runtimeConfig.browser.ts index 63562750f1b9..ad19e700cd2d 100644 --- a/clients/client-chime/runtimeConfig.browser.ts +++ b/clients/client-chime/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-chime/runtimeConfig.native.ts b/clients/client-chime/runtimeConfig.native.ts index f4841fdb69c7..f0316d22048a 100644 --- a/clients/client-chime/runtimeConfig.native.ts +++ b/clients/client-chime/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ChimeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-chime/runtimeConfig.ts b/clients/client-chime/runtimeConfig.ts index fadd77f299b3..81cdfc0c8bae 100644 --- a/clients/client-chime/runtimeConfig.ts +++ b/clients/client-chime/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloud9/Cloud9Client.ts b/clients/client-cloud9/Cloud9Client.ts index 7ec692732ccf..722393cf52a6 100644 --- a/clients/client-cloud9/Cloud9Client.ts +++ b/clients/client-cloud9/Cloud9Client.ts @@ -72,6 +72,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -82,6 +83,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -161,11 +163,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -207,6 +204,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type Cloud9ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -215,8 +218,8 @@ export type Cloud9ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type Cloud9ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -224,8 +227,8 @@ export type Cloud9ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Cloud9 @@ -304,16 +307,16 @@ export class Cloud9Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloud9/runtimeConfig.browser.ts b/clients/client-cloud9/runtimeConfig.browser.ts index 6bd17f48efdc..ccce50f41d0a 100644 --- a/clients/client-cloud9/runtimeConfig.browser.ts +++ b/clients/client-cloud9/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloud9/runtimeConfig.native.ts b/clients/client-cloud9/runtimeConfig.native.ts index 0991da279ce7..ef11a033b506 100644 --- a/clients/client-cloud9/runtimeConfig.native.ts +++ b/clients/client-cloud9/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./Cloud9Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloud9/runtimeConfig.ts b/clients/client-cloud9/runtimeConfig.ts index 2287cb2d4e26..0ffa3ba946f1 100644 --- a/clients/client-cloud9/runtimeConfig.ts +++ b/clients/client-cloud9/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-clouddirectory/CloudDirectoryClient.ts b/clients/client-clouddirectory/CloudDirectoryClient.ts index 9eac936b7b7d..033bce269a8b 100644 --- a/clients/client-clouddirectory/CloudDirectoryClient.ts +++ b/clients/client-clouddirectory/CloudDirectoryClient.ts @@ -179,6 +179,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -189,6 +190,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -374,11 +376,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -420,6 +417,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudDirectoryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -428,8 +431,8 @@ export type CloudDirectoryClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudDirectoryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -437,8 +440,8 @@ export type CloudDirectoryClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Cloud Directory @@ -465,16 +468,16 @@ export class CloudDirectoryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-clouddirectory/runtimeConfig.browser.ts b/clients/client-clouddirectory/runtimeConfig.browser.ts index 784991fb10fd..f1329da68e89 100644 --- a/clients/client-clouddirectory/runtimeConfig.browser.ts +++ b/clients/client-clouddirectory/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-clouddirectory/runtimeConfig.native.ts b/clients/client-clouddirectory/runtimeConfig.native.ts index d581d4dbda97..df92245a8187 100644 --- a/clients/client-clouddirectory/runtimeConfig.native.ts +++ b/clients/client-clouddirectory/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudDirectoryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-clouddirectory/runtimeConfig.ts b/clients/client-clouddirectory/runtimeConfig.ts index 165c823c950f..32a7732687bb 100644 --- a/clients/client-clouddirectory/runtimeConfig.ts +++ b/clients/client-clouddirectory/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudformation/CloudFormationClient.ts b/clients/client-cloudformation/CloudFormationClient.ts index 29d94f6946c3..013038aaca88 100644 --- a/clients/client-cloudformation/CloudFormationClient.ts +++ b/clients/client-cloudformation/CloudFormationClient.ts @@ -159,6 +159,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -169,6 +170,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -332,11 +334,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -378,6 +375,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudFormationClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -386,8 +389,8 @@ export type CloudFormationClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudFormationClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -395,8 +398,8 @@ export type CloudFormationClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CloudFormation @@ -432,16 +435,16 @@ export class CloudFormationClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudformation/runtimeConfig.browser.ts b/clients/client-cloudformation/runtimeConfig.browser.ts index 2608f64837d9..49bb84829d39 100644 --- a/clients/client-cloudformation/runtimeConfig.browser.ts +++ b/clients/client-cloudformation/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudformation/runtimeConfig.native.ts b/clients/client-cloudformation/runtimeConfig.native.ts index 061a5f34e346..813fdb72926b 100644 --- a/clients/client-cloudformation/runtimeConfig.native.ts +++ b/clients/client-cloudformation/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudFormationClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudformation/runtimeConfig.ts b/clients/client-cloudformation/runtimeConfig.ts index 6a76dc14bd67..328cda274e52 100644 --- a/clients/client-cloudformation/runtimeConfig.ts +++ b/clients/client-cloudformation/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudfront/CloudFrontClient.ts b/clients/client-cloudfront/CloudFrontClient.ts index c4439a9ee3e1..cda5c5f13b1d 100644 --- a/clients/client-cloudfront/CloudFrontClient.ts +++ b/clients/client-cloudfront/CloudFrontClient.ts @@ -254,6 +254,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -264,6 +265,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -467,11 +469,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -513,6 +510,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudFrontClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -521,8 +524,8 @@ export type CloudFrontClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudFrontClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -530,8 +533,8 @@ export type CloudFrontClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon CloudFront @@ -555,16 +558,16 @@ export class CloudFrontClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudfront/runtimeConfig.browser.ts b/clients/client-cloudfront/runtimeConfig.browser.ts index 9229b4403ae7..d55467186b68 100644 --- a/clients/client-cloudfront/runtimeConfig.browser.ts +++ b/clients/client-cloudfront/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudfront/runtimeConfig.native.ts b/clients/client-cloudfront/runtimeConfig.native.ts index 9bc6666c384a..efa94494b6f4 100644 --- a/clients/client-cloudfront/runtimeConfig.native.ts +++ b/clients/client-cloudfront/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudFrontClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudfront/runtimeConfig.ts b/clients/client-cloudfront/runtimeConfig.ts index 576ce1f413ba..a7f3f1aee5d3 100644 --- a/clients/client-cloudfront/runtimeConfig.ts +++ b/clients/client-cloudfront/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudhsm-v2/CloudHSMV2Client.ts b/clients/client-cloudhsm-v2/CloudHSMV2Client.ts index 08678390b7c6..f48b07f666cf 100644 --- a/clients/client-cloudhsm-v2/CloudHSMV2Client.ts +++ b/clients/client-cloudhsm-v2/CloudHSMV2Client.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -146,11 +148,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -192,6 +189,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudHSMV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -200,8 +203,8 @@ export type CloudHSMV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudHSMV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -209,8 +212,8 @@ export type CloudHSMV2ClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

For more information about AWS CloudHSM, see AWS CloudHSM and the AWS @@ -233,16 +236,16 @@ export class CloudHSMV2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudhsm-v2/runtimeConfig.browser.ts b/clients/client-cloudhsm-v2/runtimeConfig.browser.ts index c1d051d6d1f8..144968a4090c 100644 --- a/clients/client-cloudhsm-v2/runtimeConfig.browser.ts +++ b/clients/client-cloudhsm-v2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudhsm-v2/runtimeConfig.native.ts b/clients/client-cloudhsm-v2/runtimeConfig.native.ts index de306dbe8336..cb4541187049 100644 --- a/clients/client-cloudhsm-v2/runtimeConfig.native.ts +++ b/clients/client-cloudhsm-v2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudHSMV2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudhsm-v2/runtimeConfig.ts b/clients/client-cloudhsm-v2/runtimeConfig.ts index 58ad9e65a94e..944c365a6e50 100644 --- a/clients/client-cloudhsm-v2/runtimeConfig.ts +++ b/clients/client-cloudhsm-v2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudhsm/CloudHSMClient.ts b/clients/client-cloudhsm/CloudHSMClient.ts index dfdd061ee05f..ffabd4be6ba4 100644 --- a/clients/client-cloudhsm/CloudHSMClient.ts +++ b/clients/client-cloudhsm/CloudHSMClient.ts @@ -61,6 +61,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -71,6 +72,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -164,11 +166,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -210,6 +207,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudHSMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -218,8 +221,8 @@ export type CloudHSMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudHSMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -227,8 +230,8 @@ export type CloudHSMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CloudHSM Service @@ -260,16 +263,16 @@ export class CloudHSMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudhsm/runtimeConfig.browser.ts b/clients/client-cloudhsm/runtimeConfig.browser.ts index d55671208cc6..3bb7bda68b8b 100644 --- a/clients/client-cloudhsm/runtimeConfig.browser.ts +++ b/clients/client-cloudhsm/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudhsm/runtimeConfig.native.ts b/clients/client-cloudhsm/runtimeConfig.native.ts index 6f9ef25a258f..522df7557937 100644 --- a/clients/client-cloudhsm/runtimeConfig.native.ts +++ b/clients/client-cloudhsm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudHSMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudhsm/runtimeConfig.ts b/clients/client-cloudhsm/runtimeConfig.ts index 2d4541c9b76a..caba4ae7bdb7 100644 --- a/clients/client-cloudhsm/runtimeConfig.ts +++ b/clients/client-cloudhsm/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudsearch-domain/CloudSearchDomainClient.ts b/clients/client-cloudsearch-domain/CloudSearchDomainClient.ts index 9e9d7c088a94..d2020900ead8 100644 --- a/clients/client-cloudsearch-domain/CloudSearchDomainClient.ts +++ b/clients/client-cloudsearch-domain/CloudSearchDomainClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = SearchCommandInput | SuggestCommandInput | UploadDocumentsCommandInput; @@ -101,11 +103,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -147,6 +144,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudSearchDomainClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -155,8 +158,8 @@ export type CloudSearchDomainClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudSearchDomainClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -164,8 +167,8 @@ export type CloudSearchDomainClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

You use the AmazonCloudSearch2013 API to upload documents to a search domain and search those documents.

@@ -190,16 +193,16 @@ export class CloudSearchDomainClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudsearch-domain/runtimeConfig.browser.ts b/clients/client-cloudsearch-domain/runtimeConfig.browser.ts index b3e8f0ee4337..2694787f9e6b 100644 --- a/clients/client-cloudsearch-domain/runtimeConfig.browser.ts +++ b/clients/client-cloudsearch-domain/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudsearch-domain/runtimeConfig.native.ts b/clients/client-cloudsearch-domain/runtimeConfig.native.ts index 8494fa28e035..c6bbd7f137e3 100644 --- a/clients/client-cloudsearch-domain/runtimeConfig.native.ts +++ b/clients/client-cloudsearch-domain/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudSearchDomainClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudsearch-domain/runtimeConfig.ts b/clients/client-cloudsearch-domain/runtimeConfig.ts index 7ccb0e83414d..5bcf87522cb0 100644 --- a/clients/client-cloudsearch-domain/runtimeConfig.ts +++ b/clients/client-cloudsearch-domain/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudsearch/CloudSearchClient.ts b/clients/client-cloudsearch/CloudSearchClient.ts index 88c84a97c80c..4b1782992ac8 100644 --- a/clients/client-cloudsearch/CloudSearchClient.ts +++ b/clients/client-cloudsearch/CloudSearchClient.ts @@ -100,6 +100,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -110,6 +111,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -215,11 +217,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -261,6 +258,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudSearchClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -269,8 +272,8 @@ export type CloudSearchClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudSearchClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -278,8 +281,8 @@ export type CloudSearchClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon CloudSearch Configuration Service @@ -307,16 +310,16 @@ export class CloudSearchClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudsearch/runtimeConfig.browser.ts b/clients/client-cloudsearch/runtimeConfig.browser.ts index 3f83cfbfa428..f2889ae25731 100644 --- a/clients/client-cloudsearch/runtimeConfig.browser.ts +++ b/clients/client-cloudsearch/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudsearch/runtimeConfig.native.ts b/clients/client-cloudsearch/runtimeConfig.native.ts index 0e1972d5cffd..f6d8caa780a2 100644 --- a/clients/client-cloudsearch/runtimeConfig.native.ts +++ b/clients/client-cloudsearch/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudSearchClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudsearch/runtimeConfig.ts b/clients/client-cloudsearch/runtimeConfig.ts index 5a461c56038a..542ffe9d685a 100644 --- a/clients/client-cloudsearch/runtimeConfig.ts +++ b/clients/client-cloudsearch/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudtrail/CloudTrailClient.ts b/clients/client-cloudtrail/CloudTrailClient.ts index 74471dbb097d..71ba8546ca12 100644 --- a/clients/client-cloudtrail/CloudTrailClient.ts +++ b/clients/client-cloudtrail/CloudTrailClient.ts @@ -59,6 +59,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -69,6 +70,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -158,11 +160,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -204,6 +201,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudTrailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -212,8 +215,8 @@ export type CloudTrailClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudTrailClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -221,8 +224,8 @@ export type CloudTrailClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CloudTrail @@ -258,16 +261,16 @@ export class CloudTrailClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudtrail/runtimeConfig.browser.ts b/clients/client-cloudtrail/runtimeConfig.browser.ts index ea7b936f2eb7..2c16e643a330 100644 --- a/clients/client-cloudtrail/runtimeConfig.browser.ts +++ b/clients/client-cloudtrail/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudtrail/runtimeConfig.native.ts b/clients/client-cloudtrail/runtimeConfig.native.ts index b16ddb69ae2a..d1c8d93bc36b 100644 --- a/clients/client-cloudtrail/runtimeConfig.native.ts +++ b/clients/client-cloudtrail/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudTrailClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudtrail/runtimeConfig.ts b/clients/client-cloudtrail/runtimeConfig.ts index 8164591d0316..4d9070eba55e 100644 --- a/clients/client-cloudtrail/runtimeConfig.ts +++ b/clients/client-cloudtrail/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudwatch-events/CloudWatchEventsClient.ts b/clients/client-cloudwatch-events/CloudWatchEventsClient.ts index aa8d15f8bd01..671413d2de51 100644 --- a/clients/client-cloudwatch-events/CloudWatchEventsClient.ts +++ b/clients/client-cloudwatch-events/CloudWatchEventsClient.ts @@ -105,6 +105,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -115,6 +116,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -248,11 +250,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -294,6 +291,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudWatchEventsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -302,8 +305,8 @@ export type CloudWatchEventsClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudWatchEventsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -311,8 +314,8 @@ export type CloudWatchEventsClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon EventBridge helps you to respond to state changes in your AWS resources. @@ -355,16 +358,16 @@ export class CloudWatchEventsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudwatch-events/runtimeConfig.browser.ts b/clients/client-cloudwatch-events/runtimeConfig.browser.ts index 396c11b77425..5332bdc0a9f4 100644 --- a/clients/client-cloudwatch-events/runtimeConfig.browser.ts +++ b/clients/client-cloudwatch-events/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudwatch-events/runtimeConfig.native.ts b/clients/client-cloudwatch-events/runtimeConfig.native.ts index e042819f1324..e67184f83892 100644 --- a/clients/client-cloudwatch-events/runtimeConfig.native.ts +++ b/clients/client-cloudwatch-events/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudWatchEventsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudwatch-events/runtimeConfig.ts b/clients/client-cloudwatch-events/runtimeConfig.ts index 13dbab5b5226..e7561fd407f6 100644 --- a/clients/client-cloudwatch-events/runtimeConfig.ts +++ b/clients/client-cloudwatch-events/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudwatch-logs/CloudWatchLogsClient.ts b/clients/client-cloudwatch-logs/CloudWatchLogsClient.ts index 8cb692001c79..5267d3be3ef4 100644 --- a/clients/client-cloudwatch-logs/CloudWatchLogsClient.ts +++ b/clients/client-cloudwatch-logs/CloudWatchLogsClient.ts @@ -113,6 +113,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -123,6 +124,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -260,11 +262,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -306,6 +303,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudWatchLogsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -314,8 +317,8 @@ export type CloudWatchLogsClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudWatchLogsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -323,8 +326,8 @@ export type CloudWatchLogsClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

You can use Amazon CloudWatch Logs to monitor, store, and access your log files from @@ -379,16 +382,16 @@ export class CloudWatchLogsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudwatch-logs/runtimeConfig.browser.ts b/clients/client-cloudwatch-logs/runtimeConfig.browser.ts index 654fea3e6e31..6ae79aae4f41 100644 --- a/clients/client-cloudwatch-logs/runtimeConfig.browser.ts +++ b/clients/client-cloudwatch-logs/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudwatch-logs/runtimeConfig.native.ts b/clients/client-cloudwatch-logs/runtimeConfig.native.ts index 1bb795a06c16..51c69acdb689 100644 --- a/clients/client-cloudwatch-logs/runtimeConfig.native.ts +++ b/clients/client-cloudwatch-logs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudWatchLogsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudwatch-logs/runtimeConfig.ts b/clients/client-cloudwatch-logs/runtimeConfig.ts index 6780fe5741d6..8775531f639a 100644 --- a/clients/client-cloudwatch-logs/runtimeConfig.ts +++ b/clients/client-cloudwatch-logs/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cloudwatch/CloudWatchClient.ts b/clients/client-cloudwatch/CloudWatchClient.ts index 9efb0d5cdb4e..8e6cbde9a469 100644 --- a/clients/client-cloudwatch/CloudWatchClient.ts +++ b/clients/client-cloudwatch/CloudWatchClient.ts @@ -98,6 +98,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -108,6 +109,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -221,11 +223,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -267,6 +264,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CloudWatchClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -275,8 +278,8 @@ export type CloudWatchClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CloudWatchClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -284,8 +287,8 @@ export type CloudWatchClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the @@ -321,16 +324,16 @@ export class CloudWatchClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cloudwatch/runtimeConfig.browser.ts b/clients/client-cloudwatch/runtimeConfig.browser.ts index 930f159ba383..7b5639bad5d6 100644 --- a/clients/client-cloudwatch/runtimeConfig.browser.ts +++ b/clients/client-cloudwatch/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cloudwatch/runtimeConfig.native.ts b/clients/client-cloudwatch/runtimeConfig.native.ts index 3b3da3e46f94..062d28f7b388 100644 --- a/clients/client-cloudwatch/runtimeConfig.native.ts +++ b/clients/client-cloudwatch/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CloudWatchClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cloudwatch/runtimeConfig.ts b/clients/client-cloudwatch/runtimeConfig.ts index 9309e714846b..13c847ef37b5 100644 --- a/clients/client-cloudwatch/runtimeConfig.ts +++ b/clients/client-cloudwatch/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codeartifact/CodeartifactClient.ts b/clients/client-codeartifact/CodeartifactClient.ts index 89d31446c637..1905e79c8d9e 100644 --- a/clients/client-codeartifact/CodeartifactClient.ts +++ b/clients/client-codeartifact/CodeartifactClient.ts @@ -135,6 +135,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -145,6 +146,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -266,11 +268,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -312,6 +309,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodeartifactClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -320,8 +323,8 @@ export type CodeartifactClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeartifactClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -329,8 +332,8 @@ export type CodeartifactClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS CodeArtifact is a fully managed artifact repository compatible with language-native @@ -627,16 +630,16 @@ export class CodeartifactClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codeartifact/runtimeConfig.browser.ts b/clients/client-codeartifact/runtimeConfig.browser.ts index db03607571dc..8b2a1a02f2b6 100644 --- a/clients/client-codeartifact/runtimeConfig.browser.ts +++ b/clients/client-codeartifact/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codeartifact/runtimeConfig.native.ts b/clients/client-codeartifact/runtimeConfig.native.ts index 3898b2fe3800..0b860f18c482 100644 --- a/clients/client-codeartifact/runtimeConfig.native.ts +++ b/clients/client-codeartifact/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeartifactClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codeartifact/runtimeConfig.ts b/clients/client-codeartifact/runtimeConfig.ts index a75635fb4066..f51a753ea3b0 100644 --- a/clients/client-codeartifact/runtimeConfig.ts +++ b/clients/client-codeartifact/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codebuild/CodeBuildClient.ts b/clients/client-codebuild/CodeBuildClient.ts index 302c54f9eaf9..59ccb8b22c33 100644 --- a/clients/client-codebuild/CodeBuildClient.ts +++ b/clients/client-codebuild/CodeBuildClient.ts @@ -121,6 +121,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -131,6 +132,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -272,11 +274,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -318,6 +315,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodeBuildClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -326,8 +329,8 @@ export type CodeBuildClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeBuildClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -335,8 +338,8 @@ export type CodeBuildClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodeBuild @@ -542,16 +545,16 @@ export class CodeBuildClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codebuild/runtimeConfig.browser.ts b/clients/client-codebuild/runtimeConfig.browser.ts index f98a337451d0..633b77f1b86e 100644 --- a/clients/client-codebuild/runtimeConfig.browser.ts +++ b/clients/client-codebuild/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codebuild/runtimeConfig.native.ts b/clients/client-codebuild/runtimeConfig.native.ts index ebf6dcb961b8..7535c90ed473 100644 --- a/clients/client-codebuild/runtimeConfig.native.ts +++ b/clients/client-codebuild/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeBuildClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codebuild/runtimeConfig.ts b/clients/client-codebuild/runtimeConfig.ts index 241b28f1a9a4..dc6c23eb61e2 100644 --- a/clients/client-codebuild/runtimeConfig.ts +++ b/clients/client-codebuild/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codecommit/CodeCommitClient.ts b/clients/client-codecommit/CodeCommitClient.ts index 61a7e9b7cc8b..445f0e72909d 100644 --- a/clients/client-codecommit/CodeCommitClient.ts +++ b/clients/client-codecommit/CodeCommitClient.ts @@ -256,6 +256,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -266,6 +267,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -473,11 +475,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -519,6 +516,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodeCommitClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -527,8 +530,8 @@ export type CodeCommitClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeCommitClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -536,8 +539,8 @@ export type CodeCommitClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodeCommit @@ -955,16 +958,16 @@ export class CodeCommitClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codecommit/runtimeConfig.browser.ts b/clients/client-codecommit/runtimeConfig.browser.ts index b0fe76fabdda..03571d079145 100644 --- a/clients/client-codecommit/runtimeConfig.browser.ts +++ b/clients/client-codecommit/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codecommit/runtimeConfig.native.ts b/clients/client-codecommit/runtimeConfig.native.ts index 22af34073883..aa2ef6de1866 100644 --- a/clients/client-codecommit/runtimeConfig.native.ts +++ b/clients/client-codecommit/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeCommitClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codecommit/runtimeConfig.ts b/clients/client-codecommit/runtimeConfig.ts index 67f897187efd..d22eba618351 100644 --- a/clients/client-codecommit/runtimeConfig.ts +++ b/clients/client-codecommit/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codedeploy/CodeDeployClient.ts b/clients/client-codedeploy/CodeDeployClient.ts index f5545b49a38a..660341dbcc92 100644 --- a/clients/client-codedeploy/CodeDeployClient.ts +++ b/clients/client-codedeploy/CodeDeployClient.ts @@ -184,6 +184,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -194,6 +195,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -341,11 +343,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -387,6 +384,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodeDeployClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -395,8 +398,8 @@ export type CodeDeployClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeDeployClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -404,8 +407,8 @@ export type CodeDeployClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodeDeploy @@ -526,16 +529,16 @@ export class CodeDeployClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codedeploy/runtimeConfig.browser.ts b/clients/client-codedeploy/runtimeConfig.browser.ts index 79dc845fadbe..a6341af9c966 100644 --- a/clients/client-codedeploy/runtimeConfig.browser.ts +++ b/clients/client-codedeploy/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codedeploy/runtimeConfig.native.ts b/clients/client-codedeploy/runtimeConfig.native.ts index dab024883e22..e2b10ba33076 100644 --- a/clients/client-codedeploy/runtimeConfig.native.ts +++ b/clients/client-codedeploy/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeDeployClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codedeploy/runtimeConfig.ts b/clients/client-codedeploy/runtimeConfig.ts index 768be9eff802..6a914eed6926 100644 --- a/clients/client-codedeploy/runtimeConfig.ts +++ b/clients/client-codedeploy/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codeguru-reviewer/CodeGuruReviewerClient.ts b/clients/client-codeguru-reviewer/CodeGuruReviewerClient.ts index 8366c6377a22..1ede809c1075 100644 --- a/clients/client-codeguru-reviewer/CodeGuruReviewerClient.ts +++ b/clients/client-codeguru-reviewer/CodeGuruReviewerClient.ts @@ -76,6 +76,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -86,6 +87,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -213,6 +210,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodeGuruReviewerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -221,8 +224,8 @@ export type CodeGuruReviewerClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeGuruReviewerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -230,8 +233,8 @@ export type CodeGuruReviewerClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This section provides documentation for the Amazon CodeGuru Reviewer API operations. CodeGuru Reviewer is a service @@ -268,16 +271,16 @@ export class CodeGuruReviewerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codeguru-reviewer/runtimeConfig.browser.ts b/clients/client-codeguru-reviewer/runtimeConfig.browser.ts index 4cdd6b918c6f..1d0495c14761 100644 --- a/clients/client-codeguru-reviewer/runtimeConfig.browser.ts +++ b/clients/client-codeguru-reviewer/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codeguru-reviewer/runtimeConfig.native.ts b/clients/client-codeguru-reviewer/runtimeConfig.native.ts index bf811af49660..8300083647b6 100644 --- a/clients/client-codeguru-reviewer/runtimeConfig.native.ts +++ b/clients/client-codeguru-reviewer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeGuruReviewerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codeguru-reviewer/runtimeConfig.ts b/clients/client-codeguru-reviewer/runtimeConfig.ts index 8660ac01b7d1..f82371128ad1 100644 --- a/clients/client-codeguru-reviewer/runtimeConfig.ts +++ b/clients/client-codeguru-reviewer/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codeguruprofiler/CodeGuruProfilerClient.ts b/clients/client-codeguruprofiler/CodeGuruProfilerClient.ts index 351ab3250787..f3d07529dea6 100644 --- a/clients/client-codeguruprofiler/CodeGuruProfilerClient.ts +++ b/clients/client-codeguruprofiler/CodeGuruProfilerClient.ts @@ -63,6 +63,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -73,6 +74,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -152,11 +154,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -198,6 +195,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodeGuruProfilerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -206,8 +209,8 @@ export type CodeGuruProfilerClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeGuruProfilerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -215,8 +218,8 @@ export type CodeGuruProfilerClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This section provides documentation for the Amazon CodeGuru Profiler API operations.

@@ -238,16 +241,16 @@ export class CodeGuruProfilerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codeguruprofiler/runtimeConfig.browser.ts b/clients/client-codeguruprofiler/runtimeConfig.browser.ts index de0d8fe56f0c..0f5f6aac7096 100644 --- a/clients/client-codeguruprofiler/runtimeConfig.browser.ts +++ b/clients/client-codeguruprofiler/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codeguruprofiler/runtimeConfig.native.ts b/clients/client-codeguruprofiler/runtimeConfig.native.ts index bb7df9fefa17..f2cc2ba24dc0 100644 --- a/clients/client-codeguruprofiler/runtimeConfig.native.ts +++ b/clients/client-codeguruprofiler/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeGuruProfilerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codeguruprofiler/runtimeConfig.ts b/clients/client-codeguruprofiler/runtimeConfig.ts index 71bb1c05f730..b969a33804f8 100644 --- a/clients/client-codeguruprofiler/runtimeConfig.ts +++ b/clients/client-codeguruprofiler/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codepipeline/CodePipelineClient.ts b/clients/client-codepipeline/CodePipelineClient.ts index 0cf50dd2a33b..f19f147b1190 100644 --- a/clients/client-codepipeline/CodePipelineClient.ts +++ b/clients/client-codepipeline/CodePipelineClient.ts @@ -132,6 +132,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -142,6 +143,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -269,11 +271,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -315,6 +312,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodePipelineClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -323,8 +326,8 @@ export type CodePipelineClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodePipelineClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -332,8 +335,8 @@ export type CodePipelineClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodePipeline @@ -549,16 +552,16 @@ export class CodePipelineClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codepipeline/runtimeConfig.browser.ts b/clients/client-codepipeline/runtimeConfig.browser.ts index d5fd093ac1d1..d2ff3b3be587 100644 --- a/clients/client-codepipeline/runtimeConfig.browser.ts +++ b/clients/client-codepipeline/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codepipeline/runtimeConfig.native.ts b/clients/client-codepipeline/runtimeConfig.native.ts index e95574d1e7b8..9c0999d852c5 100644 --- a/clients/client-codepipeline/runtimeConfig.native.ts +++ b/clients/client-codepipeline/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodePipelineClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codepipeline/runtimeConfig.ts b/clients/client-codepipeline/runtimeConfig.ts index 03013d23ed5b..f5fab8e53529 100644 --- a/clients/client-codepipeline/runtimeConfig.ts +++ b/clients/client-codepipeline/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codestar-connections/CodeStarConnectionsClient.ts b/clients/client-codestar-connections/CodeStarConnectionsClient.ts index e360103dcdec..8aff36f7e89f 100644 --- a/clients/client-codestar-connections/CodeStarConnectionsClient.ts +++ b/clients/client-codestar-connections/CodeStarConnectionsClient.ts @@ -50,6 +50,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -60,6 +61,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -137,11 +139,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -183,6 +180,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodeStarConnectionsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -191,8 +194,8 @@ export type CodeStarConnectionsClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeStarConnectionsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -200,8 +203,8 @@ export type CodeStarConnectionsClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodeStar Connections @@ -302,16 +305,16 @@ export class CodeStarConnectionsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codestar-connections/runtimeConfig.browser.ts b/clients/client-codestar-connections/runtimeConfig.browser.ts index 94bd12cc1a79..bc9a8f2984a5 100644 --- a/clients/client-codestar-connections/runtimeConfig.browser.ts +++ b/clients/client-codestar-connections/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codestar-connections/runtimeConfig.native.ts b/clients/client-codestar-connections/runtimeConfig.native.ts index d39d0e088c44..17f7b3d69250 100644 --- a/clients/client-codestar-connections/runtimeConfig.native.ts +++ b/clients/client-codestar-connections/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeStarConnectionsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codestar-connections/runtimeConfig.ts b/clients/client-codestar-connections/runtimeConfig.ts index 0c91e40220db..aa64791b9023 100644 --- a/clients/client-codestar-connections/runtimeConfig.ts +++ b/clients/client-codestar-connections/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codestar-notifications/CodestarNotificationsClient.ts b/clients/client-codestar-notifications/CodestarNotificationsClient.ts index ba87ec77f112..daeccf18cf15 100644 --- a/clients/client-codestar-notifications/CodestarNotificationsClient.ts +++ b/clients/client-codestar-notifications/CodestarNotificationsClient.ts @@ -66,6 +66,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -76,6 +77,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -155,11 +157,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -201,6 +198,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodestarNotificationsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -209,8 +212,8 @@ export type CodestarNotificationsClientConfig = Partial<__SmithyConfiguration<__ EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodestarNotificationsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -218,8 +221,8 @@ export type CodestarNotificationsClientResolvedConfig = __SmithyResolvedConfigur EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This AWS CodeStar Notifications API Reference provides descriptions and usage examples of the @@ -324,16 +327,16 @@ export class CodestarNotificationsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codestar-notifications/runtimeConfig.browser.ts b/clients/client-codestar-notifications/runtimeConfig.browser.ts index 56d9f07993db..268551b9023d 100644 --- a/clients/client-codestar-notifications/runtimeConfig.browser.ts +++ b/clients/client-codestar-notifications/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codestar-notifications/runtimeConfig.native.ts b/clients/client-codestar-notifications/runtimeConfig.native.ts index 688f359752ee..9cdb5511d924 100644 --- a/clients/client-codestar-notifications/runtimeConfig.native.ts +++ b/clients/client-codestar-notifications/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodestarNotificationsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codestar-notifications/runtimeConfig.ts b/clients/client-codestar-notifications/runtimeConfig.ts index d8690cf416d9..7e1cf8d6a796 100644 --- a/clients/client-codestar-notifications/runtimeConfig.ts +++ b/clients/client-codestar-notifications/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-codestar/CodeStarClient.ts b/clients/client-codestar/CodeStarClient.ts index 5d8aa9246b25..0d6cf06da79f 100644 --- a/clients/client-codestar/CodeStarClient.ts +++ b/clients/client-codestar/CodeStarClient.ts @@ -62,6 +62,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -72,6 +73,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -161,11 +163,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -207,6 +204,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CodeStarClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -215,8 +218,8 @@ export type CodeStarClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CodeStarClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -224,8 +227,8 @@ export type CodeStarClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS CodeStar @@ -336,16 +339,16 @@ export class CodeStarClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-codestar/runtimeConfig.browser.ts b/clients/client-codestar/runtimeConfig.browser.ts index 3f58b65fdce3..4c05dd5b66b1 100644 --- a/clients/client-codestar/runtimeConfig.browser.ts +++ b/clients/client-codestar/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-codestar/runtimeConfig.native.ts b/clients/client-codestar/runtimeConfig.native.ts index 4d380d997771..40c5bb753bf5 100644 --- a/clients/client-codestar/runtimeConfig.native.ts +++ b/clients/client-codestar/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CodeStarClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-codestar/runtimeConfig.ts b/clients/client-codestar/runtimeConfig.ts index 86d3b1a82bb5..e31bd24475b2 100644 --- a/clients/client-codestar/runtimeConfig.ts +++ b/clients/client-codestar/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cognito-identity-provider/CognitoIdentityProviderClient.ts b/clients/client-cognito-identity-provider/CognitoIdentityProviderClient.ts index efd4ac3c9df7..078332960b56 100644 --- a/clients/client-cognito-identity-provider/CognitoIdentityProviderClient.ts +++ b/clients/client-cognito-identity-provider/CognitoIdentityProviderClient.ts @@ -298,6 +298,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -308,6 +309,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -561,11 +563,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -607,6 +604,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CognitoIdentityProviderClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -615,8 +618,8 @@ export type CognitoIdentityProviderClientConfig = Partial<__SmithyConfiguration< EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CognitoIdentityProviderClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -624,8 +627,8 @@ export type CognitoIdentityProviderClientResolvedConfig = __SmithyResolvedConfig EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Using the Amazon Cognito User Pools API, you can create a user pool to manage @@ -652,15 +655,15 @@ export class CognitoIdentityProviderClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cognito-identity-provider/runtimeConfig.browser.ts b/clients/client-cognito-identity-provider/runtimeConfig.browser.ts index 7621eec4c827..472a323f1a67 100644 --- a/clients/client-cognito-identity-provider/runtimeConfig.browser.ts +++ b/clients/client-cognito-identity-provider/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cognito-identity-provider/runtimeConfig.native.ts b/clients/client-cognito-identity-provider/runtimeConfig.native.ts index 402aecead453..3026a60425b3 100644 --- a/clients/client-cognito-identity-provider/runtimeConfig.native.ts +++ b/clients/client-cognito-identity-provider/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CognitoIdentityProviderClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cognito-identity-provider/runtimeConfig.ts b/clients/client-cognito-identity-provider/runtimeConfig.ts index e001c79a04e9..3242e7a8e33e 100644 --- a/clients/client-cognito-identity-provider/runtimeConfig.ts +++ b/clients/client-cognito-identity-provider/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cognito-identity/CognitoIdentityClient.ts b/clients/client-cognito-identity/CognitoIdentityClient.ts index 7d35ee6a04ce..3836a427c800 100644 --- a/clients/client-cognito-identity/CognitoIdentityClient.ts +++ b/clients/client-cognito-identity/CognitoIdentityClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -183,11 +185,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -229,6 +226,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CognitoIdentityClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -237,8 +240,8 @@ export type CognitoIdentityClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CognitoIdentityClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -246,8 +249,8 @@ export type CognitoIdentityClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Cognito Federated Identities @@ -282,15 +285,15 @@ export class CognitoIdentityClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cognito-identity/runtimeConfig.browser.ts b/clients/client-cognito-identity/runtimeConfig.browser.ts index 69f1637cb22c..e3f589a52f54 100644 --- a/clients/client-cognito-identity/runtimeConfig.browser.ts +++ b/clients/client-cognito-identity/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cognito-identity/runtimeConfig.native.ts b/clients/client-cognito-identity/runtimeConfig.native.ts index 870131af0bef..f33e0dec2ccf 100644 --- a/clients/client-cognito-identity/runtimeConfig.native.ts +++ b/clients/client-cognito-identity/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CognitoIdentityClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cognito-identity/runtimeConfig.ts b/clients/client-cognito-identity/runtimeConfig.ts index d236052526af..5fedb2fe7564 100644 --- a/clients/client-cognito-identity/runtimeConfig.ts +++ b/clients/client-cognito-identity/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cognito-sync/CognitoSyncClient.ts b/clients/client-cognito-sync/CognitoSyncClient.ts index 8e6817f04555..6680c926cb10 100644 --- a/clients/client-cognito-sync/CognitoSyncClient.ts +++ b/clients/client-cognito-sync/CognitoSyncClient.ts @@ -73,6 +73,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -83,6 +84,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CognitoSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +227,8 @@ export type CognitoSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CognitoSyncClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +236,8 @@ export type CognitoSyncClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Cognito Sync @@ -262,16 +265,16 @@ export class CognitoSyncClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cognito-sync/runtimeConfig.browser.ts b/clients/client-cognito-sync/runtimeConfig.browser.ts index 87d48c6c1cfa..004eb46a6b63 100644 --- a/clients/client-cognito-sync/runtimeConfig.browser.ts +++ b/clients/client-cognito-sync/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cognito-sync/runtimeConfig.native.ts b/clients/client-cognito-sync/runtimeConfig.native.ts index f7a473853ce8..d6bc203a42bb 100644 --- a/clients/client-cognito-sync/runtimeConfig.native.ts +++ b/clients/client-cognito-sync/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CognitoSyncClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cognito-sync/runtimeConfig.ts b/clients/client-cognito-sync/runtimeConfig.ts index b0c6f72106f3..5535603f0a32 100644 --- a/clients/client-cognito-sync/runtimeConfig.ts +++ b/clients/client-cognito-sync/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-comprehend/ComprehendClient.ts b/clients/client-comprehend/ComprehendClient.ts index 908fb280a975..54e66e41c59d 100644 --- a/clients/client-comprehend/ComprehendClient.ts +++ b/clients/client-comprehend/ComprehendClient.ts @@ -233,6 +233,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -243,6 +244,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -416,11 +418,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -462,6 +459,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ComprehendClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -470,8 +473,8 @@ export type ComprehendClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ComprehendClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -479,8 +482,8 @@ export type ComprehendClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Comprehend is an AWS service for gaining insight into the content of documents. @@ -505,16 +508,16 @@ export class ComprehendClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-comprehend/runtimeConfig.browser.ts b/clients/client-comprehend/runtimeConfig.browser.ts index 616dd876ba9b..af1800d92e0a 100644 --- a/clients/client-comprehend/runtimeConfig.browser.ts +++ b/clients/client-comprehend/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-comprehend/runtimeConfig.native.ts b/clients/client-comprehend/runtimeConfig.native.ts index d7dc348aebc5..521b67e7a535 100644 --- a/clients/client-comprehend/runtimeConfig.native.ts +++ b/clients/client-comprehend/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ComprehendClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-comprehend/runtimeConfig.ts b/clients/client-comprehend/runtimeConfig.ts index 919aefc24d03..a79969b1f8f4 100644 --- a/clients/client-comprehend/runtimeConfig.ts +++ b/clients/client-comprehend/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-comprehendmedical/ComprehendMedicalClient.ts b/clients/client-comprehendmedical/ComprehendMedicalClient.ts index 26901c7756e3..18395a0ca849 100644 --- a/clients/client-comprehendmedical/ComprehendMedicalClient.ts +++ b/clients/client-comprehendmedical/ComprehendMedicalClient.ts @@ -104,6 +104,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -114,6 +115,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ComprehendMedicalClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +266,8 @@ export type ComprehendMedicalClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ComprehendMedicalClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +275,8 @@ export type ComprehendMedicalClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Comprehend Medical extracts structured information from unstructured clinical text. Use these actions @@ -296,16 +299,16 @@ export class ComprehendMedicalClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-comprehendmedical/runtimeConfig.browser.ts b/clients/client-comprehendmedical/runtimeConfig.browser.ts index 611752e1ac17..4c343f29435a 100644 --- a/clients/client-comprehendmedical/runtimeConfig.browser.ts +++ b/clients/client-comprehendmedical/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-comprehendmedical/runtimeConfig.native.ts b/clients/client-comprehendmedical/runtimeConfig.native.ts index c2386c7cccdf..8e1a180c85c8 100644 --- a/clients/client-comprehendmedical/runtimeConfig.native.ts +++ b/clients/client-comprehendmedical/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ComprehendMedicalClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-comprehendmedical/runtimeConfig.ts b/clients/client-comprehendmedical/runtimeConfig.ts index 1437a913e54a..6d477a0c2978 100644 --- a/clients/client-comprehendmedical/runtimeConfig.ts +++ b/clients/client-comprehendmedical/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-compute-optimizer/ComputeOptimizerClient.ts b/clients/client-compute-optimizer/ComputeOptimizerClient.ts index cb5135c63890..9e20adb58a39 100644 --- a/clients/client-compute-optimizer/ComputeOptimizerClient.ts +++ b/clients/client-compute-optimizer/ComputeOptimizerClient.ts @@ -75,6 +75,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -85,6 +86,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -158,11 +160,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -204,6 +201,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ComputeOptimizerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -212,8 +215,8 @@ export type ComputeOptimizerClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ComputeOptimizerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -221,8 +224,8 @@ export type ComputeOptimizerClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Compute Optimizer is a service that analyzes the configuration and utilization metrics of your @@ -253,16 +256,16 @@ export class ComputeOptimizerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-compute-optimizer/runtimeConfig.browser.ts b/clients/client-compute-optimizer/runtimeConfig.browser.ts index de4cb581cee7..fde4656cc147 100644 --- a/clients/client-compute-optimizer/runtimeConfig.browser.ts +++ b/clients/client-compute-optimizer/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-compute-optimizer/runtimeConfig.native.ts b/clients/client-compute-optimizer/runtimeConfig.native.ts index e9fd73c91ecd..0bf60a2374bf 100644 --- a/clients/client-compute-optimizer/runtimeConfig.native.ts +++ b/clients/client-compute-optimizer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ComputeOptimizerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-compute-optimizer/runtimeConfig.ts b/clients/client-compute-optimizer/runtimeConfig.ts index 9cdedb63ec69..05ac7e8560ad 100644 --- a/clients/client-compute-optimizer/runtimeConfig.ts +++ b/clients/client-compute-optimizer/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-config-service/ConfigServiceClient.ts b/clients/client-config-service/ConfigServiceClient.ts index 67d1dc807665..1dfa822bdee7 100644 --- a/clients/client-config-service/ConfigServiceClient.ts +++ b/clients/client-config-service/ConfigServiceClient.ts @@ -327,6 +327,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -337,6 +338,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -548,11 +550,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -594,6 +591,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ConfigServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -602,8 +605,8 @@ export type ConfigServiceClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ConfigServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -611,8 +614,8 @@ export type ConfigServiceClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Config @@ -657,16 +660,16 @@ export class ConfigServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-config-service/runtimeConfig.browser.ts b/clients/client-config-service/runtimeConfig.browser.ts index 5d1b9935f122..f0b1afa77a08 100644 --- a/clients/client-config-service/runtimeConfig.browser.ts +++ b/clients/client-config-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-config-service/runtimeConfig.native.ts b/clients/client-config-service/runtimeConfig.native.ts index 865c56277d19..57b1619e574c 100644 --- a/clients/client-config-service/runtimeConfig.native.ts +++ b/clients/client-config-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ConfigServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-config-service/runtimeConfig.ts b/clients/client-config-service/runtimeConfig.ts index fc47ea0d7f86..76197a615544 100644 --- a/clients/client-config-service/runtimeConfig.ts +++ b/clients/client-config-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-connect-contact-lens/ConnectContactLensClient.ts b/clients/client-connect-contact-lens/ConnectContactLensClient.ts index d76e7ffca973..edac9c7a0c5b 100644 --- a/clients/client-connect-contact-lens/ConnectContactLensClient.ts +++ b/clients/client-connect-contact-lens/ConnectContactLensClient.ts @@ -39,6 +39,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -49,6 +50,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = ListRealtimeContactAnalysisSegmentsCommandInput; @@ -102,11 +104,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -148,6 +145,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ConnectContactLensClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -156,8 +159,8 @@ export type ConnectContactLensClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ConnectContactLensClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -165,8 +168,8 @@ export type ConnectContactLensClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Contact Lens for Amazon Connect enables you to analyze conversations between customer and agents, @@ -194,16 +197,16 @@ export class ConnectContactLensClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-connect-contact-lens/runtimeConfig.browser.ts b/clients/client-connect-contact-lens/runtimeConfig.browser.ts index 55336fef5a8e..0a1a469fd0c6 100644 --- a/clients/client-connect-contact-lens/runtimeConfig.browser.ts +++ b/clients/client-connect-contact-lens/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-connect-contact-lens/runtimeConfig.native.ts b/clients/client-connect-contact-lens/runtimeConfig.native.ts index 0bfb0e7b05cd..6b182dd756fd 100644 --- a/clients/client-connect-contact-lens/runtimeConfig.native.ts +++ b/clients/client-connect-contact-lens/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ConnectContactLensClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-connect-contact-lens/runtimeConfig.ts b/clients/client-connect-contact-lens/runtimeConfig.ts index 7e47a19f4ce0..03e36838adf8 100644 --- a/clients/client-connect-contact-lens/runtimeConfig.ts +++ b/clients/client-connect-contact-lens/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-connect/ConnectClient.ts b/clients/client-connect/ConnectClient.ts index f70ea34c4e41..ed257d599a05 100644 --- a/clients/client-connect/ConnectClient.ts +++ b/clients/client-connect/ConnectClient.ts @@ -282,6 +282,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -292,6 +293,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -509,11 +511,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -555,6 +552,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -563,8 +566,8 @@ export type ConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ConnectClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -572,8 +575,8 @@ export type ConnectClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Connect is a cloud-based contact center solution that makes it easy to set up and manage a @@ -608,16 +611,16 @@ export class ConnectClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-connect/runtimeConfig.browser.ts b/clients/client-connect/runtimeConfig.browser.ts index 4e2c2e16f6a0..7c410928f7cc 100644 --- a/clients/client-connect/runtimeConfig.browser.ts +++ b/clients/client-connect/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-connect/runtimeConfig.native.ts b/clients/client-connect/runtimeConfig.native.ts index b3dab48b2ae7..f07ce4c7c8ff 100644 --- a/clients/client-connect/runtimeConfig.native.ts +++ b/clients/client-connect/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ConnectClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-connect/runtimeConfig.ts b/clients/client-connect/runtimeConfig.ts index 49f908e3a276..206482c2f626 100644 --- a/clients/client-connect/runtimeConfig.ts +++ b/clients/client-connect/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-connectparticipant/ConnectParticipantClient.ts b/clients/client-connectparticipant/ConnectParticipantClient.ts index ebc7f2c06489..898d4a5be8c8 100644 --- a/clients/client-connectparticipant/ConnectParticipantClient.ts +++ b/clients/client-connectparticipant/ConnectParticipantClient.ts @@ -46,6 +46,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -56,6 +57,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -119,11 +121,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -165,6 +162,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ConnectParticipantClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -173,8 +176,8 @@ export type ConnectParticipantClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ConnectParticipantClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -182,8 +185,8 @@ export type ConnectParticipantClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Connect is a cloud-based contact center solution that makes it easy to set up and manage @@ -210,16 +213,16 @@ export class ConnectParticipantClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-connectparticipant/runtimeConfig.browser.ts b/clients/client-connectparticipant/runtimeConfig.browser.ts index 0ce59f46c95e..70752ee89876 100644 --- a/clients/client-connectparticipant/runtimeConfig.browser.ts +++ b/clients/client-connectparticipant/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-connectparticipant/runtimeConfig.native.ts b/clients/client-connectparticipant/runtimeConfig.native.ts index 8db6b6e6a5af..8ee1e2943c1b 100644 --- a/clients/client-connectparticipant/runtimeConfig.native.ts +++ b/clients/client-connectparticipant/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ConnectParticipantClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-connectparticipant/runtimeConfig.ts b/clients/client-connectparticipant/runtimeConfig.ts index 3369c8941a80..68e335ffd5f4 100644 --- a/clients/client-connectparticipant/runtimeConfig.ts +++ b/clients/client-connectparticipant/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cost-and-usage-report-service/CostAndUsageReportServiceClient.ts b/clients/client-cost-and-usage-report-service/CostAndUsageReportServiceClient.ts index 21eff09eba3c..eafbaa6c65a1 100644 --- a/clients/client-cost-and-usage-report-service/CostAndUsageReportServiceClient.ts +++ b/clients/client-cost-and-usage-report-service/CostAndUsageReportServiceClient.ts @@ -51,6 +51,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -61,6 +62,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -122,11 +124,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -168,6 +165,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CostAndUsageReportServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -176,8 +179,8 @@ export type CostAndUsageReportServiceClientConfig = Partial<__SmithyConfiguratio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CostAndUsageReportServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -185,8 +188,8 @@ export type CostAndUsageReportServiceClientResolvedConfig = __SmithyResolvedConf EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS Cost and Usage Report API enables you to programmatically create, query, and delete @@ -226,16 +229,16 @@ export class CostAndUsageReportServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cost-and-usage-report-service/runtimeConfig.browser.ts b/clients/client-cost-and-usage-report-service/runtimeConfig.browser.ts index e7c31d6031ba..21c8ead8353e 100644 --- a/clients/client-cost-and-usage-report-service/runtimeConfig.browser.ts +++ b/clients/client-cost-and-usage-report-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cost-and-usage-report-service/runtimeConfig.native.ts b/clients/client-cost-and-usage-report-service/runtimeConfig.native.ts index d92776d084ff..020e837c44f4 100644 --- a/clients/client-cost-and-usage-report-service/runtimeConfig.native.ts +++ b/clients/client-cost-and-usage-report-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CostAndUsageReportServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cost-and-usage-report-service/runtimeConfig.ts b/clients/client-cost-and-usage-report-service/runtimeConfig.ts index d96a57092627..299ed76687b0 100644 --- a/clients/client-cost-and-usage-report-service/runtimeConfig.ts +++ b/clients/client-cost-and-usage-report-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-cost-explorer/CostExplorerClient.ts b/clients/client-cost-explorer/CostExplorerClient.ts index 1c931237d28a..663841e09d37 100644 --- a/clients/client-cost-explorer/CostExplorerClient.ts +++ b/clients/client-cost-explorer/CostExplorerClient.ts @@ -130,6 +130,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -140,6 +141,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -251,11 +253,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -297,6 +294,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CostExplorerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -305,8 +308,8 @@ export type CostExplorerClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CostExplorerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -314,8 +317,8 @@ export type CostExplorerClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Cost Explorer API enables you to programmatically query your cost and usage data. You can query for aggregated data @@ -350,16 +353,16 @@ export class CostExplorerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-cost-explorer/runtimeConfig.browser.ts b/clients/client-cost-explorer/runtimeConfig.browser.ts index 8f3344350f8f..c71ce08faa8c 100644 --- a/clients/client-cost-explorer/runtimeConfig.browser.ts +++ b/clients/client-cost-explorer/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-cost-explorer/runtimeConfig.native.ts b/clients/client-cost-explorer/runtimeConfig.native.ts index 76c2d7c94281..10aadf852c4f 100644 --- a/clients/client-cost-explorer/runtimeConfig.native.ts +++ b/clients/client-cost-explorer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CostExplorerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-cost-explorer/runtimeConfig.ts b/clients/client-cost-explorer/runtimeConfig.ts index 56a478efe786..e19ccfd9c368 100644 --- a/clients/client-cost-explorer/runtimeConfig.ts +++ b/clients/client-cost-explorer/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-customer-profiles/CustomerProfilesClient.ts b/clients/client-customer-profiles/CustomerProfilesClient.ts index e1b5ac4573c5..9046542c4cbf 100644 --- a/clients/client-customer-profiles/CustomerProfilesClient.ts +++ b/clients/client-customer-profiles/CustomerProfilesClient.ts @@ -90,6 +90,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -100,6 +101,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type CustomerProfilesClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +266,8 @@ export type CustomerProfilesClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type CustomerProfilesClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +275,8 @@ export type CustomerProfilesClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Connect Customer Profiles @@ -304,16 +307,16 @@ export class CustomerProfilesClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-customer-profiles/runtimeConfig.browser.ts b/clients/client-customer-profiles/runtimeConfig.browser.ts index 316fd9972446..a2df749fde28 100644 --- a/clients/client-customer-profiles/runtimeConfig.browser.ts +++ b/clients/client-customer-profiles/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-customer-profiles/runtimeConfig.native.ts b/clients/client-customer-profiles/runtimeConfig.native.ts index 0be66651c368..e502d4e012b5 100644 --- a/clients/client-customer-profiles/runtimeConfig.native.ts +++ b/clients/client-customer-profiles/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./CustomerProfilesClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-customer-profiles/runtimeConfig.ts b/clients/client-customer-profiles/runtimeConfig.ts index 5b2c73cdbf08..9efc526fae9e 100644 --- a/clients/client-customer-profiles/runtimeConfig.ts +++ b/clients/client-customer-profiles/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-data-pipeline/DataPipelineClient.ts b/clients/client-data-pipeline/DataPipelineClient.ts index bfebb99163f9..9fd6baa34803 100644 --- a/clients/client-data-pipeline/DataPipelineClient.ts +++ b/clients/client-data-pipeline/DataPipelineClient.ts @@ -66,6 +66,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -76,6 +77,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -213,6 +210,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DataPipelineClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -221,8 +224,8 @@ export type DataPipelineClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DataPipelineClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -230,8 +233,8 @@ export type DataPipelineClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Data Pipeline configures and manages a data-driven workflow called a pipeline. AWS Data Pipeline handles the details of scheduling and ensuring that data dependencies are met so that your application can focus on processing the data.

@@ -257,16 +260,16 @@ export class DataPipelineClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-data-pipeline/runtimeConfig.browser.ts b/clients/client-data-pipeline/runtimeConfig.browser.ts index 613353f22c2b..1e77ced30265 100644 --- a/clients/client-data-pipeline/runtimeConfig.browser.ts +++ b/clients/client-data-pipeline/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-data-pipeline/runtimeConfig.native.ts b/clients/client-data-pipeline/runtimeConfig.native.ts index d29208f6198c..53680a029942 100644 --- a/clients/client-data-pipeline/runtimeConfig.native.ts +++ b/clients/client-data-pipeline/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DataPipelineClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-data-pipeline/runtimeConfig.ts b/clients/client-data-pipeline/runtimeConfig.ts index b3bde8d16c6c..d059d8a30cc1 100644 --- a/clients/client-data-pipeline/runtimeConfig.ts +++ b/clients/client-data-pipeline/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-database-migration-service/DatabaseMigrationServiceClient.ts b/clients/client-database-migration-service/DatabaseMigrationServiceClient.ts index a4453abdbd7f..93931266ad59 100644 --- a/clients/client-database-migration-service/DatabaseMigrationServiceClient.ts +++ b/clients/client-database-migration-service/DatabaseMigrationServiceClient.ts @@ -212,6 +212,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -222,6 +223,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -383,11 +385,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -429,6 +426,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DatabaseMigrationServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -437,8 +440,8 @@ export type DatabaseMigrationServiceClientConfig = Partial<__SmithyConfiguration EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DatabaseMigrationServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -446,8 +449,8 @@ export type DatabaseMigrationServiceClientResolvedConfig = __SmithyResolvedConfi EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Database Migration Service @@ -478,16 +481,16 @@ export class DatabaseMigrationServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-database-migration-service/runtimeConfig.browser.ts b/clients/client-database-migration-service/runtimeConfig.browser.ts index ea13446b6c9a..58c4380c89dd 100644 --- a/clients/client-database-migration-service/runtimeConfig.browser.ts +++ b/clients/client-database-migration-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-database-migration-service/runtimeConfig.native.ts b/clients/client-database-migration-service/runtimeConfig.native.ts index 9cad9050d511..ae7ea57e683e 100644 --- a/clients/client-database-migration-service/runtimeConfig.native.ts +++ b/clients/client-database-migration-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DatabaseMigrationServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-database-migration-service/runtimeConfig.ts b/clients/client-database-migration-service/runtimeConfig.ts index 385a6d603237..53648735faee 100644 --- a/clients/client-database-migration-service/runtimeConfig.ts +++ b/clients/client-database-migration-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-databrew/DataBrewClient.ts b/clients/client-databrew/DataBrewClient.ts index 3e76f942ef8d..6dc2e7e7aa8c 100644 --- a/clients/client-databrew/DataBrewClient.ts +++ b/clients/client-databrew/DataBrewClient.ts @@ -88,6 +88,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -98,6 +99,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -227,11 +229,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -273,6 +270,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DataBrewClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -281,8 +284,8 @@ export type DataBrewClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DataBrewClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -290,8 +293,8 @@ export type DataBrewClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Glue DataBrew is a visual, cloud-scale data-preparation service. DataBrew @@ -316,16 +319,16 @@ export class DataBrewClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-databrew/runtimeConfig.browser.ts b/clients/client-databrew/runtimeConfig.browser.ts index 2844b55136af..cc1f7256fa5a 100644 --- a/clients/client-databrew/runtimeConfig.browser.ts +++ b/clients/client-databrew/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-databrew/runtimeConfig.native.ts b/clients/client-databrew/runtimeConfig.native.ts index fa48ccf8dc74..ed1e7c8d6f8c 100644 --- a/clients/client-databrew/runtimeConfig.native.ts +++ b/clients/client-databrew/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DataBrewClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-databrew/runtimeConfig.ts b/clients/client-databrew/runtimeConfig.ts index f349e2a52150..e2818435e983 100644 --- a/clients/client-databrew/runtimeConfig.ts +++ b/clients/client-databrew/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-dataexchange/DataExchangeClient.ts b/clients/client-dataexchange/DataExchangeClient.ts index fc3025afd62d..63162018a31c 100644 --- a/clients/client-dataexchange/DataExchangeClient.ts +++ b/clients/client-dataexchange/DataExchangeClient.ts @@ -63,6 +63,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -73,6 +74,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DataExchangeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +227,8 @@ export type DataExchangeClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DataExchangeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +236,8 @@ export type DataExchangeClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Data Exchange is a service that makes it easy for AWS customers to exchange data in the cloud. You can use the AWS Data Exchange APIs to create, update, manage, and access file-based data set in the AWS Cloud.

As a subscriber, you can view and access the data sets that you have an entitlement to through a subscription. You can use the APIS to download or copy your entitled data sets to Amazon S3 for use across a variety of AWS analytics and machine learning services.

As a provider, you can create and manage your data sets that you would like to publish to a product. Being able to package and provide your data sets into products requires a few steps to determine eligibility. For more information, visit the AWS Data Exchange User Guide.

A data set is a collection of data that can be changed or updated over time. Data sets can be updated using revisions, which represent a new version or incremental change to a data set. A revision contains one or more assets. An asset in AWS Data Exchange is a piece of data that can be stored as an Amazon S3 object. The asset can be a structured data file, an image file, or some other data file. Jobs are asynchronous import or export operations used to create or copy assets.

@@ -256,16 +259,16 @@ export class DataExchangeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-dataexchange/runtimeConfig.browser.ts b/clients/client-dataexchange/runtimeConfig.browser.ts index dadda53b3ccd..b752ebb2cab0 100644 --- a/clients/client-dataexchange/runtimeConfig.browser.ts +++ b/clients/client-dataexchange/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-dataexchange/runtimeConfig.native.ts b/clients/client-dataexchange/runtimeConfig.native.ts index e255fb75e86b..303b37f5f971 100644 --- a/clients/client-dataexchange/runtimeConfig.native.ts +++ b/clients/client-dataexchange/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DataExchangeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-dataexchange/runtimeConfig.ts b/clients/client-dataexchange/runtimeConfig.ts index 68d2306ee16f..38dd1986de22 100644 --- a/clients/client-dataexchange/runtimeConfig.ts +++ b/clients/client-dataexchange/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-datasync/DataSyncClient.ts b/clients/client-datasync/DataSyncClient.ts index a530ee21ed51..604a85f065c4 100644 --- a/clients/client-datasync/DataSyncClient.ts +++ b/clients/client-datasync/DataSyncClient.ts @@ -100,6 +100,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -110,6 +111,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -227,11 +229,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -273,6 +270,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DataSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -281,8 +284,8 @@ export type DataSyncClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DataSyncClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -290,8 +293,8 @@ export type DataSyncClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS DataSync @@ -319,16 +322,16 @@ export class DataSyncClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-datasync/runtimeConfig.browser.ts b/clients/client-datasync/runtimeConfig.browser.ts index 5c295b330156..86312c79d6bd 100644 --- a/clients/client-datasync/runtimeConfig.browser.ts +++ b/clients/client-datasync/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-datasync/runtimeConfig.native.ts b/clients/client-datasync/runtimeConfig.native.ts index 54339bc051d3..e9d9c4fe1fd9 100644 --- a/clients/client-datasync/runtimeConfig.native.ts +++ b/clients/client-datasync/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DataSyncClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-datasync/runtimeConfig.ts b/clients/client-datasync/runtimeConfig.ts index 99558ff59855..e37d79c79758 100644 --- a/clients/client-datasync/runtimeConfig.ts +++ b/clients/client-datasync/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-dax/DAXClient.ts b/clients/client-dax/DAXClient.ts index 8e504006f327..473c74cbe14b 100644 --- a/clients/client-dax/DAXClient.ts +++ b/clients/client-dax/DAXClient.ts @@ -80,6 +80,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -90,6 +91,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DAXClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +242,8 @@ export type DAXClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DAXClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +251,8 @@ export type DAXClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

DAX is a managed caching service engineered for Amazon DynamoDB. DAX @@ -276,16 +279,16 @@ export class DAXClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-dax/runtimeConfig.browser.ts b/clients/client-dax/runtimeConfig.browser.ts index 2ff9968497fc..479881e0d24b 100644 --- a/clients/client-dax/runtimeConfig.browser.ts +++ b/clients/client-dax/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-dax/runtimeConfig.native.ts b/clients/client-dax/runtimeConfig.native.ts index 6fb187d53024..15a4a4be0299 100644 --- a/clients/client-dax/runtimeConfig.native.ts +++ b/clients/client-dax/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DAXClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-dax/runtimeConfig.ts b/clients/client-dax/runtimeConfig.ts index e69ce75ab04f..62c1c192d7e9 100644 --- a/clients/client-dax/runtimeConfig.ts +++ b/clients/client-dax/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-detective/DetectiveClient.ts b/clients/client-detective/DetectiveClient.ts index 910ce0013b54..c45936bbf233 100644 --- a/clients/client-detective/DetectiveClient.ts +++ b/clients/client-detective/DetectiveClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -140,11 +142,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -186,6 +183,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DetectiveClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -194,8 +197,8 @@ export type DetectiveClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DetectiveClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -203,8 +206,8 @@ export type DetectiveClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Detective uses machine learning and purpose-built visualizations to help you analyze and @@ -266,16 +269,16 @@ export class DetectiveClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-detective/runtimeConfig.browser.ts b/clients/client-detective/runtimeConfig.browser.ts index 0239a097a0dc..219b9dd6966b 100644 --- a/clients/client-detective/runtimeConfig.browser.ts +++ b/clients/client-detective/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-detective/runtimeConfig.native.ts b/clients/client-detective/runtimeConfig.native.ts index b16fad6b8cde..ba265876a016 100644 --- a/clients/client-detective/runtimeConfig.native.ts +++ b/clients/client-detective/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DetectiveClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-detective/runtimeConfig.ts b/clients/client-detective/runtimeConfig.ts index a46f863e1eda..b222ffeeb941 100644 --- a/clients/client-detective/runtimeConfig.ts +++ b/clients/client-detective/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-device-farm/DeviceFarmClient.ts b/clients/client-device-farm/DeviceFarmClient.ts index 9a545020b5de..4b9c37654cf5 100644 --- a/clients/client-device-farm/DeviceFarmClient.ts +++ b/clients/client-device-farm/DeviceFarmClient.ts @@ -208,6 +208,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -218,6 +219,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -425,11 +427,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -471,6 +468,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DeviceFarmClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -479,8 +482,8 @@ export type DeviceFarmClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DeviceFarmClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -488,8 +491,8 @@ export type DeviceFarmClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the AWS Device Farm API documentation, which contains APIs for:

@@ -525,16 +528,16 @@ export class DeviceFarmClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-device-farm/runtimeConfig.browser.ts b/clients/client-device-farm/runtimeConfig.browser.ts index 8b7baa2d90dd..f414ba7f6c0d 100644 --- a/clients/client-device-farm/runtimeConfig.browser.ts +++ b/clients/client-device-farm/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-device-farm/runtimeConfig.native.ts b/clients/client-device-farm/runtimeConfig.native.ts index 50894c54866f..855933af044d 100644 --- a/clients/client-device-farm/runtimeConfig.native.ts +++ b/clients/client-device-farm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DeviceFarmClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-device-farm/runtimeConfig.ts b/clients/client-device-farm/runtimeConfig.ts index 1d2df95bf053..4fa27268382a 100644 --- a/clients/client-device-farm/runtimeConfig.ts +++ b/clients/client-device-farm/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-devops-guru/DevOpsGuruClient.ts b/clients/client-devops-guru/DevOpsGuruClient.ts index 358483568cca..82f024b3d3d8 100644 --- a/clients/client-devops-guru/DevOpsGuruClient.ts +++ b/clients/client-devops-guru/DevOpsGuruClient.ts @@ -89,6 +89,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -99,6 +100,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -188,11 +190,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -234,6 +231,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DevOpsGuruClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -242,8 +245,8 @@ export type DevOpsGuruClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DevOpsGuruClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -251,8 +254,8 @@ export type DevOpsGuruClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; export class DevOpsGuruClient extends __Client< __HttpHandlerOptions, @@ -271,16 +274,16 @@ export class DevOpsGuruClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-devops-guru/runtimeConfig.browser.ts b/clients/client-devops-guru/runtimeConfig.browser.ts index 3d624b5e89fe..00afcbb7c11b 100644 --- a/clients/client-devops-guru/runtimeConfig.browser.ts +++ b/clients/client-devops-guru/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-devops-guru/runtimeConfig.native.ts b/clients/client-devops-guru/runtimeConfig.native.ts index 00208d07f98a..19a82d284c7b 100644 --- a/clients/client-devops-guru/runtimeConfig.native.ts +++ b/clients/client-devops-guru/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DevOpsGuruClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-devops-guru/runtimeConfig.ts b/clients/client-devops-guru/runtimeConfig.ts index 6b10468c3264..276af2af826a 100644 --- a/clients/client-devops-guru/runtimeConfig.ts +++ b/clients/client-devops-guru/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-direct-connect/DirectConnectClient.ts b/clients/client-direct-connect/DirectConnectClient.ts index 0bcf7630eb01..59552c3efc88 100644 --- a/clients/client-direct-connect/DirectConnectClient.ts +++ b/clients/client-direct-connect/DirectConnectClient.ts @@ -211,6 +211,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -221,6 +222,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -386,11 +388,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -432,6 +429,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DirectConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -440,8 +443,8 @@ export type DirectConnectClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DirectConnectClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -449,8 +452,8 @@ export type DirectConnectClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Direct Connect links your internal network to an AWS Direct Connect location over a standard Ethernet fiber-optic cable. @@ -477,16 +480,16 @@ export class DirectConnectClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-direct-connect/runtimeConfig.browser.ts b/clients/client-direct-connect/runtimeConfig.browser.ts index 1a709d07189c..eed44cacf695 100644 --- a/clients/client-direct-connect/runtimeConfig.browser.ts +++ b/clients/client-direct-connect/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-direct-connect/runtimeConfig.native.ts b/clients/client-direct-connect/runtimeConfig.native.ts index f3790d49a3e8..1a4b98cb32c8 100644 --- a/clients/client-direct-connect/runtimeConfig.native.ts +++ b/clients/client-direct-connect/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DirectConnectClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-direct-connect/runtimeConfig.ts b/clients/client-direct-connect/runtimeConfig.ts index de45384040d4..2217c1c6a46c 100644 --- a/clients/client-direct-connect/runtimeConfig.ts +++ b/clients/client-direct-connect/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-directory-service/DirectoryServiceClient.ts b/clients/client-directory-service/DirectoryServiceClient.ts index c887f97f6176..06f77d7652f5 100644 --- a/clients/client-directory-service/DirectoryServiceClient.ts +++ b/clients/client-directory-service/DirectoryServiceClient.ts @@ -178,6 +178,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -188,6 +189,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -365,11 +367,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -411,6 +408,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DirectoryServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -419,8 +422,8 @@ export type DirectoryServiceClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DirectoryServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -428,8 +431,8 @@ export type DirectoryServiceClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Directory Service @@ -456,16 +459,16 @@ export class DirectoryServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-directory-service/runtimeConfig.browser.ts b/clients/client-directory-service/runtimeConfig.browser.ts index 2c144ceb1746..6e00eb5f0de8 100644 --- a/clients/client-directory-service/runtimeConfig.browser.ts +++ b/clients/client-directory-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-directory-service/runtimeConfig.native.ts b/clients/client-directory-service/runtimeConfig.native.ts index 1feba5c63d24..e82655bb667f 100644 --- a/clients/client-directory-service/runtimeConfig.native.ts +++ b/clients/client-directory-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DirectoryServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-directory-service/runtimeConfig.ts b/clients/client-directory-service/runtimeConfig.ts index c14456b94afc..b1e8271a5cc1 100644 --- a/clients/client-directory-service/runtimeConfig.ts +++ b/clients/client-directory-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-dlm/DLMClient.ts b/clients/client-dlm/DLMClient.ts index 862608dea808..351a8328203e 100644 --- a/clients/client-dlm/DLMClient.ts +++ b/clients/client-dlm/DLMClient.ts @@ -58,6 +58,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -68,6 +69,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -137,11 +139,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -183,6 +180,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DLMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -191,8 +194,8 @@ export type DLMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DLMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -200,8 +203,8 @@ export type DLMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Data Lifecycle Manager

With Amazon Data Lifecycle Manager, you can manage the lifecycle of your AWS resources. You create lifecycle policies, which are used to automate operations on the specified resources.

Amazon DLM supports Amazon EBS volumes and snapshots. For information about using Amazon DLM with Amazon EBS, see Automating the Amazon EBS Snapshot Lifecycle in the Amazon EC2 User Guide.

@@ -223,16 +226,16 @@ export class DLMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-dlm/runtimeConfig.browser.ts b/clients/client-dlm/runtimeConfig.browser.ts index 734d036d4750..c7d18b08674f 100644 --- a/clients/client-dlm/runtimeConfig.browser.ts +++ b/clients/client-dlm/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-dlm/runtimeConfig.native.ts b/clients/client-dlm/runtimeConfig.native.ts index 3eb41cac64d8..2bef215b6595 100644 --- a/clients/client-dlm/runtimeConfig.native.ts +++ b/clients/client-dlm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DLMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-dlm/runtimeConfig.ts b/clients/client-dlm/runtimeConfig.ts index 88be42bbdb0e..74995b2aea80 100644 --- a/clients/client-dlm/runtimeConfig.ts +++ b/clients/client-dlm/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-docdb/DocDBClient.ts b/clients/client-docdb/DocDBClient.ts index 29f6d4515723..9fb98b3f8f4b 100644 --- a/clients/client-docdb/DocDBClient.ts +++ b/clients/client-docdb/DocDBClient.ts @@ -164,6 +164,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -174,6 +175,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -311,11 +313,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -357,6 +354,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DocDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -365,8 +368,8 @@ export type DocDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DocDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -374,8 +377,8 @@ export type DocDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon DocumentDB API documentation

@@ -397,16 +400,16 @@ export class DocDBClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-docdb/runtimeConfig.browser.ts b/clients/client-docdb/runtimeConfig.browser.ts index c6ce37fec65f..b798cd4d9032 100644 --- a/clients/client-docdb/runtimeConfig.browser.ts +++ b/clients/client-docdb/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-docdb/runtimeConfig.native.ts b/clients/client-docdb/runtimeConfig.native.ts index 3ad2a39f5541..bf5339ed2558 100644 --- a/clients/client-docdb/runtimeConfig.native.ts +++ b/clients/client-docdb/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DocDBClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-docdb/runtimeConfig.ts b/clients/client-docdb/runtimeConfig.ts index 5e82f963d1fe..e045fafaeb63 100644 --- a/clients/client-docdb/runtimeConfig.ts +++ b/clients/client-docdb/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-dynamodb-streams/DynamoDBStreamsClient.ts b/clients/client-dynamodb-streams/DynamoDBStreamsClient.ts index 2763f483a0f1..53b59d9d5a56 100644 --- a/clients/client-dynamodb-streams/DynamoDBStreamsClient.ts +++ b/clients/client-dynamodb-streams/DynamoDBStreamsClient.ts @@ -39,6 +39,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -49,6 +50,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -110,11 +112,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -156,6 +153,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DynamoDBStreamsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -164,8 +167,8 @@ export type DynamoDBStreamsClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DynamoDBStreamsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -173,8 +176,8 @@ export type DynamoDBStreamsClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon DynamoDB @@ -201,16 +204,16 @@ export class DynamoDBStreamsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-dynamodb-streams/runtimeConfig.browser.ts b/clients/client-dynamodb-streams/runtimeConfig.browser.ts index a669444fa921..5fda2a9dc204 100644 --- a/clients/client-dynamodb-streams/runtimeConfig.browser.ts +++ b/clients/client-dynamodb-streams/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-dynamodb-streams/runtimeConfig.native.ts b/clients/client-dynamodb-streams/runtimeConfig.native.ts index 1acb3d688fba..9e84dfbab8f5 100644 --- a/clients/client-dynamodb-streams/runtimeConfig.native.ts +++ b/clients/client-dynamodb-streams/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DynamoDBStreamsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-dynamodb-streams/runtimeConfig.ts b/clients/client-dynamodb-streams/runtimeConfig.ts index 3338b79dcebd..69a230c523b7 100644 --- a/clients/client-dynamodb-streams/runtimeConfig.ts +++ b/clients/client-dynamodb-streams/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-dynamodb/DynamoDBClient.ts b/clients/client-dynamodb/DynamoDBClient.ts index 9aa68921402f..58a3aefeafa3 100644 --- a/clients/client-dynamodb/DynamoDBClient.ts +++ b/clients/client-dynamodb/DynamoDBClient.ts @@ -136,6 +136,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -146,6 +147,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -299,11 +301,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -345,6 +342,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type DynamoDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -353,8 +356,8 @@ export type DynamoDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type DynamoDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -362,8 +365,8 @@ export type DynamoDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon DynamoDB @@ -403,16 +406,16 @@ export class DynamoDBClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-dynamodb/runtimeConfig.browser.ts b/clients/client-dynamodb/runtimeConfig.browser.ts index 8e1469899793..093f0fc12ba8 100644 --- a/clients/client-dynamodb/runtimeConfig.browser.ts +++ b/clients/client-dynamodb/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-dynamodb/runtimeConfig.native.ts b/clients/client-dynamodb/runtimeConfig.native.ts index f015139582b9..4435dd96ded2 100644 --- a/clients/client-dynamodb/runtimeConfig.native.ts +++ b/clients/client-dynamodb/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./DynamoDBClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-dynamodb/runtimeConfig.ts b/clients/client-dynamodb/runtimeConfig.ts index 80e1f5a13439..14681c204b66 100644 --- a/clients/client-dynamodb/runtimeConfig.ts +++ b/clients/client-dynamodb/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ebs/EBSClient.ts b/clients/client-ebs/EBSClient.ts index e76e91cb964c..5f300b2a60ec 100644 --- a/clients/client-ebs/EBSClient.ts +++ b/clients/client-ebs/EBSClient.ts @@ -41,6 +41,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -51,6 +52,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -116,11 +118,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -162,6 +159,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EBSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -170,8 +173,8 @@ export type EBSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EBSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -179,8 +182,8 @@ export type EBSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

You can use the Amazon Elastic Block Store (Amazon EBS) direct APIs to create EBS snapshots, write data directly to @@ -221,16 +224,16 @@ export class EBSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ebs/runtimeConfig.browser.ts b/clients/client-ebs/runtimeConfig.browser.ts index 56236077f9b9..b70adb2b1f95 100644 --- a/clients/client-ebs/runtimeConfig.browser.ts +++ b/clients/client-ebs/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ebs/runtimeConfig.native.ts b/clients/client-ebs/runtimeConfig.native.ts index 45a219b271f6..d33457a7b13c 100644 --- a/clients/client-ebs/runtimeConfig.native.ts +++ b/clients/client-ebs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EBSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ebs/runtimeConfig.ts b/clients/client-ebs/runtimeConfig.ts index 4c73edb206ea..09ab2fbae7d4 100644 --- a/clients/client-ebs/runtimeConfig.ts +++ b/clients/client-ebs/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ec2-instance-connect/EC2InstanceConnectClient.ts b/clients/client-ec2-instance-connect/EC2InstanceConnectClient.ts index 6d2832b833a1..05560eb7612b 100644 --- a/clients/client-ec2-instance-connect/EC2InstanceConnectClient.ts +++ b/clients/client-ec2-instance-connect/EC2InstanceConnectClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = SendSSHPublicKeyCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EC2InstanceConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +156,8 @@ export type EC2InstanceConnectClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EC2InstanceConnectClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +165,8 @@ export type EC2InstanceConnectClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS EC2 Connect Service is a service that enables system administrators to publish @@ -187,16 +190,16 @@ export class EC2InstanceConnectClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ec2-instance-connect/runtimeConfig.browser.ts b/clients/client-ec2-instance-connect/runtimeConfig.browser.ts index 27ffa0dacd2f..f7cc2a8563e5 100644 --- a/clients/client-ec2-instance-connect/runtimeConfig.browser.ts +++ b/clients/client-ec2-instance-connect/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ec2-instance-connect/runtimeConfig.native.ts b/clients/client-ec2-instance-connect/runtimeConfig.native.ts index a8c90fe15456..ac0aa39a7d0a 100644 --- a/clients/client-ec2-instance-connect/runtimeConfig.native.ts +++ b/clients/client-ec2-instance-connect/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EC2InstanceConnectClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ec2-instance-connect/runtimeConfig.ts b/clients/client-ec2-instance-connect/runtimeConfig.ts index dc88e54cfc03..d4b27beeb062 100644 --- a/clients/client-ec2-instance-connect/runtimeConfig.ts +++ b/clients/client-ec2-instance-connect/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ec2/EC2Client.ts b/clients/client-ec2/EC2Client.ts index 9e487fd8986a..87d9becfd068 100644 --- a/clients/client-ec2/EC2Client.ts +++ b/clients/client-ec2/EC2Client.ts @@ -1492,6 +1492,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -1502,6 +1503,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -2435,11 +2437,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -2481,6 +2478,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EC2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -2489,8 +2492,8 @@ export type EC2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EC2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -2498,8 +2501,8 @@ export type EC2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elastic Compute Cloud @@ -2543,16 +2546,16 @@ export class EC2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ec2/runtimeConfig.browser.ts b/clients/client-ec2/runtimeConfig.browser.ts index f25edc10f29b..3dc145d0bb6d 100644 --- a/clients/client-ec2/runtimeConfig.browser.ts +++ b/clients/client-ec2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ec2/runtimeConfig.native.ts b/clients/client-ec2/runtimeConfig.native.ts index 8f7b7fcc1d8f..8f7c4b5e6994 100644 --- a/clients/client-ec2/runtimeConfig.native.ts +++ b/clients/client-ec2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EC2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ec2/runtimeConfig.ts b/clients/client-ec2/runtimeConfig.ts index e087b571b303..684c522fe20c 100644 --- a/clients/client-ec2/runtimeConfig.ts +++ b/clients/client-ec2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ecr-public/ECRPUBLICClient.ts b/clients/client-ecr-public/ECRPUBLICClient.ts index 48aa5564403f..838a36bef700 100644 --- a/clients/client-ecr-public/ECRPUBLICClient.ts +++ b/clients/client-ecr-public/ECRPUBLICClient.ts @@ -91,6 +91,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -101,6 +102,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -194,11 +196,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -240,6 +237,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ECRPUBLICClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -248,8 +251,8 @@ export type ECRPUBLICClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ECRPUBLICClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -257,8 +260,8 @@ export type ECRPUBLICClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elastic Container Registry Public @@ -286,16 +289,16 @@ export class ECRPUBLICClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ecr-public/runtimeConfig.browser.ts b/clients/client-ecr-public/runtimeConfig.browser.ts index 5e3675eab6a1..29935a75d326 100644 --- a/clients/client-ecr-public/runtimeConfig.browser.ts +++ b/clients/client-ecr-public/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ecr-public/runtimeConfig.native.ts b/clients/client-ecr-public/runtimeConfig.native.ts index 97909e5f0316..a772a48bb7d3 100644 --- a/clients/client-ecr-public/runtimeConfig.native.ts +++ b/clients/client-ecr-public/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ECRPUBLICClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ecr-public/runtimeConfig.ts b/clients/client-ecr-public/runtimeConfig.ts index f8589fd728f5..e6f9ec166110 100644 --- a/clients/client-ecr-public/runtimeConfig.ts +++ b/clients/client-ecr-public/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ecr/ECRClient.ts b/clients/client-ecr/ECRClient.ts index 600e6eefadf6..325b7cad6e64 100644 --- a/clients/client-ecr/ECRClient.ts +++ b/clients/client-ecr/ECRClient.ts @@ -123,6 +123,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -133,6 +134,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -254,11 +256,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -300,6 +297,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ECRClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -308,8 +311,8 @@ export type ECRClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ECRClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -317,8 +320,8 @@ export type ECRClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elastic Container Registry @@ -346,16 +349,16 @@ export class ECRClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ecr/runtimeConfig.browser.ts b/clients/client-ecr/runtimeConfig.browser.ts index c200a5e3fd9d..e395d392ca81 100644 --- a/clients/client-ecr/runtimeConfig.browser.ts +++ b/clients/client-ecr/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ecr/runtimeConfig.native.ts b/clients/client-ecr/runtimeConfig.native.ts index eef2372a336c..a4e6e46a060f 100644 --- a/clients/client-ecr/runtimeConfig.native.ts +++ b/clients/client-ecr/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ECRClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ecr/runtimeConfig.ts b/clients/client-ecr/runtimeConfig.ts index 2bad181d3b20..43f649852ff0 100644 --- a/clients/client-ecr/runtimeConfig.ts +++ b/clients/client-ecr/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ecs/ECSClient.ts b/clients/client-ecs/ECSClient.ts index 400c917f0fb4..8a76fc3a75a6 100644 --- a/clients/client-ecs/ECSClient.ts +++ b/clients/client-ecs/ECSClient.ts @@ -163,6 +163,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -173,6 +174,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -326,11 +328,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -372,6 +369,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ECSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -380,8 +383,8 @@ export type ECSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ECSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -389,8 +392,8 @@ export type ECSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elastic Container Service @@ -426,16 +429,16 @@ export class ECSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ecs/runtimeConfig.browser.ts b/clients/client-ecs/runtimeConfig.browser.ts index 308e028f2e72..f21c330e793a 100644 --- a/clients/client-ecs/runtimeConfig.browser.ts +++ b/clients/client-ecs/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ecs/runtimeConfig.native.ts b/clients/client-ecs/runtimeConfig.native.ts index 0339c7eae4a8..f7fadafb3219 100644 --- a/clients/client-ecs/runtimeConfig.native.ts +++ b/clients/client-ecs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ECSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ecs/runtimeConfig.ts b/clients/client-ecs/runtimeConfig.ts index d519403c91b5..6ca77ee96dbb 100644 --- a/clients/client-ecs/runtimeConfig.ts +++ b/clients/client-ecs/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-efs/EFSClient.ts b/clients/client-efs/EFSClient.ts index 0559eeac3e12..0f7e7a343aa3 100644 --- a/clients/client-efs/EFSClient.ts +++ b/clients/client-efs/EFSClient.ts @@ -96,6 +96,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -106,6 +107,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EFSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +266,8 @@ export type EFSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EFSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +275,8 @@ export type EFSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elastic File System @@ -299,16 +302,16 @@ export class EFSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-efs/runtimeConfig.browser.ts b/clients/client-efs/runtimeConfig.browser.ts index 3b747ea08dd7..a0f96ef370d3 100644 --- a/clients/client-efs/runtimeConfig.browser.ts +++ b/clients/client-efs/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-efs/runtimeConfig.native.ts b/clients/client-efs/runtimeConfig.native.ts index ad1cccea4b59..bdaa689854fe 100644 --- a/clients/client-efs/runtimeConfig.native.ts +++ b/clients/client-efs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EFSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-efs/runtimeConfig.ts b/clients/client-efs/runtimeConfig.ts index e47ff76c0d55..a5776084f7c8 100644 --- a/clients/client-efs/runtimeConfig.ts +++ b/clients/client-efs/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-eks/EKSClient.ts b/clients/client-eks/EKSClient.ts index 22b8b403ddfa..0ff62f5dabe8 100644 --- a/clients/client-eks/EKSClient.ts +++ b/clients/client-eks/EKSClient.ts @@ -92,6 +92,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -102,6 +103,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EKSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +266,8 @@ export type EKSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EKSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +275,8 @@ export type EKSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Elastic Kubernetes Service (Amazon EKS) is a managed service that makes it easy for you to run Kubernetes on @@ -304,16 +307,16 @@ export class EKSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-eks/runtimeConfig.browser.ts b/clients/client-eks/runtimeConfig.browser.ts index 075359b1e4ac..18bdde866615 100644 --- a/clients/client-eks/runtimeConfig.browser.ts +++ b/clients/client-eks/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-eks/runtimeConfig.native.ts b/clients/client-eks/runtimeConfig.native.ts index c24b5017a282..25e1dd390425 100644 --- a/clients/client-eks/runtimeConfig.native.ts +++ b/clients/client-eks/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EKSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-eks/runtimeConfig.ts b/clients/client-eks/runtimeConfig.ts index 679ea0f0c875..0eb66798a845 100644 --- a/clients/client-eks/runtimeConfig.ts +++ b/clients/client-eks/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elastic-beanstalk/ElasticBeanstalkClient.ts b/clients/client-elastic-beanstalk/ElasticBeanstalkClient.ts index 5693c39f3bd6..834bb4397ecc 100644 --- a/clients/client-elastic-beanstalk/ElasticBeanstalkClient.ts +++ b/clients/client-elastic-beanstalk/ElasticBeanstalkClient.ts @@ -199,6 +199,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -209,6 +210,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -356,11 +358,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -402,6 +399,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ElasticBeanstalkClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -410,8 +413,8 @@ export type ElasticBeanstalkClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticBeanstalkClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -419,8 +422,8 @@ export type ElasticBeanstalkClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Elastic Beanstalk @@ -456,16 +459,16 @@ export class ElasticBeanstalkClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elastic-beanstalk/runtimeConfig.browser.ts b/clients/client-elastic-beanstalk/runtimeConfig.browser.ts index c3d616c549fe..64f164662460 100644 --- a/clients/client-elastic-beanstalk/runtimeConfig.browser.ts +++ b/clients/client-elastic-beanstalk/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elastic-beanstalk/runtimeConfig.native.ts b/clients/client-elastic-beanstalk/runtimeConfig.native.ts index 848ae9a1aa50..b51ffcdb93fe 100644 --- a/clients/client-elastic-beanstalk/runtimeConfig.native.ts +++ b/clients/client-elastic-beanstalk/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticBeanstalkClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elastic-beanstalk/runtimeConfig.ts b/clients/client-elastic-beanstalk/runtimeConfig.ts index a22e1a8cb295..1ef80ff67bec 100644 --- a/clients/client-elastic-beanstalk/runtimeConfig.ts +++ b/clients/client-elastic-beanstalk/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elastic-inference/ElasticInferenceClient.ts b/clients/client-elastic-inference/ElasticInferenceClient.ts index 81cd7e208243..9ab50794b955 100644 --- a/clients/client-elastic-inference/ElasticInferenceClient.ts +++ b/clients/client-elastic-inference/ElasticInferenceClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -128,11 +130,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -174,6 +171,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ElasticInferenceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -182,8 +185,8 @@ export type ElasticInferenceClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticInferenceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -191,8 +194,8 @@ export type ElasticInferenceClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -216,16 +219,16 @@ export class ElasticInferenceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elastic-inference/runtimeConfig.browser.ts b/clients/client-elastic-inference/runtimeConfig.browser.ts index b87fe5e3bc67..e3ecfb81266a 100644 --- a/clients/client-elastic-inference/runtimeConfig.browser.ts +++ b/clients/client-elastic-inference/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elastic-inference/runtimeConfig.native.ts b/clients/client-elastic-inference/runtimeConfig.native.ts index f11ac3fdcf14..ffa246b21f4d 100644 --- a/clients/client-elastic-inference/runtimeConfig.native.ts +++ b/clients/client-elastic-inference/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticInferenceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elastic-inference/runtimeConfig.ts b/clients/client-elastic-inference/runtimeConfig.ts index a5ed0615a729..bb011ced5b63 100644 --- a/clients/client-elastic-inference/runtimeConfig.ts +++ b/clients/client-elastic-inference/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elastic-load-balancing-v2/ElasticLoadBalancingV2Client.ts b/clients/client-elastic-load-balancing-v2/ElasticLoadBalancingV2Client.ts index 3df53c955dab..5fecbd8e3c93 100644 --- a/clients/client-elastic-load-balancing-v2/ElasticLoadBalancingV2Client.ts +++ b/clients/client-elastic-load-balancing-v2/ElasticLoadBalancingV2Client.ts @@ -105,6 +105,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -115,6 +116,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -236,11 +238,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -282,6 +279,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ElasticLoadBalancingV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -290,8 +293,8 @@ export type ElasticLoadBalancingV2ClientConfig = Partial<__SmithyConfiguration<_ EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticLoadBalancingV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -299,8 +302,8 @@ export type ElasticLoadBalancingV2ClientResolvedConfig = __SmithyResolvedConfigu EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Elastic Load Balancing @@ -357,16 +360,16 @@ export class ElasticLoadBalancingV2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elastic-load-balancing-v2/runtimeConfig.browser.ts b/clients/client-elastic-load-balancing-v2/runtimeConfig.browser.ts index 58ba193eaf5a..5df884437663 100644 --- a/clients/client-elastic-load-balancing-v2/runtimeConfig.browser.ts +++ b/clients/client-elastic-load-balancing-v2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elastic-load-balancing-v2/runtimeConfig.native.ts b/clients/client-elastic-load-balancing-v2/runtimeConfig.native.ts index d52871de013a..2597bd5ec848 100644 --- a/clients/client-elastic-load-balancing-v2/runtimeConfig.native.ts +++ b/clients/client-elastic-load-balancing-v2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticLoadBalancingV2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elastic-load-balancing-v2/runtimeConfig.ts b/clients/client-elastic-load-balancing-v2/runtimeConfig.ts index c3a2a71bef9a..05db6ebf3a75 100644 --- a/clients/client-elastic-load-balancing-v2/runtimeConfig.ts +++ b/clients/client-elastic-load-balancing-v2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elastic-load-balancing/ElasticLoadBalancingClient.ts b/clients/client-elastic-load-balancing/ElasticLoadBalancingClient.ts index b6be7c06db5e..7f5cf74a6b8b 100644 --- a/clients/client-elastic-load-balancing/ElasticLoadBalancingClient.ts +++ b/clients/client-elastic-load-balancing/ElasticLoadBalancingClient.ts @@ -136,6 +136,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -146,6 +147,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -257,11 +259,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -303,6 +300,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ElasticLoadBalancingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -311,8 +314,8 @@ export type ElasticLoadBalancingClientConfig = Partial<__SmithyConfiguration<__H EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticLoadBalancingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -320,8 +323,8 @@ export type ElasticLoadBalancingClientResolvedConfig = __SmithyResolvedConfigura EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Elastic Load Balancing @@ -363,16 +366,16 @@ export class ElasticLoadBalancingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elastic-load-balancing/runtimeConfig.browser.ts b/clients/client-elastic-load-balancing/runtimeConfig.browser.ts index da5081073853..38a78b1d37fa 100644 --- a/clients/client-elastic-load-balancing/runtimeConfig.browser.ts +++ b/clients/client-elastic-load-balancing/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elastic-load-balancing/runtimeConfig.native.ts b/clients/client-elastic-load-balancing/runtimeConfig.native.ts index e19210d6be4b..059b51de5f3b 100644 --- a/clients/client-elastic-load-balancing/runtimeConfig.native.ts +++ b/clients/client-elastic-load-balancing/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticLoadBalancingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elastic-load-balancing/runtimeConfig.ts b/clients/client-elastic-load-balancing/runtimeConfig.ts index 7df45914a3cb..491bd5a3d3b2 100644 --- a/clients/client-elastic-load-balancing/runtimeConfig.ts +++ b/clients/client-elastic-load-balancing/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elastic-transcoder/ElasticTranscoderClient.ts b/clients/client-elastic-transcoder/ElasticTranscoderClient.ts index f8066930c345..ce21d89b5016 100644 --- a/clients/client-elastic-transcoder/ElasticTranscoderClient.ts +++ b/clients/client-elastic-transcoder/ElasticTranscoderClient.ts @@ -58,6 +58,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -68,6 +69,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -155,11 +157,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -201,6 +198,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ElasticTranscoderClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -209,8 +212,8 @@ export type ElasticTranscoderClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticTranscoderClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -218,8 +221,8 @@ export type ElasticTranscoderClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Elastic Transcoder Service @@ -242,16 +245,16 @@ export class ElasticTranscoderClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elastic-transcoder/runtimeConfig.browser.ts b/clients/client-elastic-transcoder/runtimeConfig.browser.ts index a4f866dab231..f042639ee7cb 100644 --- a/clients/client-elastic-transcoder/runtimeConfig.browser.ts +++ b/clients/client-elastic-transcoder/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elastic-transcoder/runtimeConfig.native.ts b/clients/client-elastic-transcoder/runtimeConfig.native.ts index 5420df3ac78b..7508161f4411 100644 --- a/clients/client-elastic-transcoder/runtimeConfig.native.ts +++ b/clients/client-elastic-transcoder/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticTranscoderClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elastic-transcoder/runtimeConfig.ts b/clients/client-elastic-transcoder/runtimeConfig.ts index a401f1692959..beb232943384 100644 --- a/clients/client-elastic-transcoder/runtimeConfig.ts +++ b/clients/client-elastic-transcoder/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elasticache/ElastiCacheClient.ts b/clients/client-elasticache/ElastiCacheClient.ts index 43530a2d25e3..487710dc9a6b 100644 --- a/clients/client-elasticache/ElastiCacheClient.ts +++ b/clients/client-elasticache/ElastiCacheClient.ts @@ -232,6 +232,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -242,6 +243,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -425,11 +427,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -471,6 +468,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ElastiCacheClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -479,8 +482,8 @@ export type ElastiCacheClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElastiCacheClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -488,8 +491,8 @@ export type ElastiCacheClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon ElastiCache @@ -520,16 +523,16 @@ export class ElastiCacheClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elasticache/runtimeConfig.browser.ts b/clients/client-elasticache/runtimeConfig.browser.ts index f4b6fcd4a184..53ab8ea46797 100644 --- a/clients/client-elasticache/runtimeConfig.browser.ts +++ b/clients/client-elasticache/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elasticache/runtimeConfig.native.ts b/clients/client-elasticache/runtimeConfig.native.ts index 8e7ad69a6ef2..5a2513da9eb9 100644 --- a/clients/client-elasticache/runtimeConfig.native.ts +++ b/clients/client-elasticache/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElastiCacheClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elasticache/runtimeConfig.ts b/clients/client-elasticache/runtimeConfig.ts index a16e31a99c42..ae388c85f809 100644 --- a/clients/client-elasticache/runtimeConfig.ts +++ b/clients/client-elasticache/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-elasticsearch-service/ElasticsearchServiceClient.ts b/clients/client-elasticsearch-service/ElasticsearchServiceClient.ts index baadc5e34cde..aba7112e2244 100644 --- a/clients/client-elasticsearch-service/ElasticsearchServiceClient.ts +++ b/clients/client-elasticsearch-service/ElasticsearchServiceClient.ts @@ -155,6 +155,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -165,6 +166,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -296,11 +298,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -342,6 +339,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ElasticsearchServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -350,8 +353,8 @@ export type ElasticsearchServiceClientConfig = Partial<__SmithyConfiguration<__H EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ElasticsearchServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -359,8 +362,8 @@ export type ElasticsearchServiceClientResolvedConfig = __SmithyResolvedConfigura EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Elasticsearch Configuration Service @@ -388,16 +391,16 @@ export class ElasticsearchServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-elasticsearch-service/runtimeConfig.browser.ts b/clients/client-elasticsearch-service/runtimeConfig.browser.ts index 5d127229beea..370d87d91737 100644 --- a/clients/client-elasticsearch-service/runtimeConfig.browser.ts +++ b/clients/client-elasticsearch-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-elasticsearch-service/runtimeConfig.native.ts b/clients/client-elasticsearch-service/runtimeConfig.native.ts index 263f5a6fc63c..a3c881d65a17 100644 --- a/clients/client-elasticsearch-service/runtimeConfig.native.ts +++ b/clients/client-elasticsearch-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ElasticsearchServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-elasticsearch-service/runtimeConfig.ts b/clients/client-elasticsearch-service/runtimeConfig.ts index eae4a9f996ed..e13164eaf863 100644 --- a/clients/client-elasticsearch-service/runtimeConfig.ts +++ b/clients/client-elasticsearch-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-emr-containers/EMRContainersClient.ts b/clients/client-emr-containers/EMRContainersClient.ts index ddbead9ea10d..2d688e4f9b24 100644 --- a/clients/client-emr-containers/EMRContainersClient.ts +++ b/clients/client-emr-containers/EMRContainersClient.ts @@ -77,6 +77,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -87,6 +88,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EMRContainersClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +227,8 @@ export type EMRContainersClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EMRContainersClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +236,8 @@ export type EMRContainersClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon EMR on EKS provides a deployment option for Amazon EMR that allows you to run @@ -277,16 +280,16 @@ export class EMRContainersClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-emr-containers/runtimeConfig.browser.ts b/clients/client-emr-containers/runtimeConfig.browser.ts index 8260c2acd918..3f4b5cb15c73 100644 --- a/clients/client-emr-containers/runtimeConfig.browser.ts +++ b/clients/client-emr-containers/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-emr-containers/runtimeConfig.native.ts b/clients/client-emr-containers/runtimeConfig.native.ts index a106dbb795dc..622b9b9b986c 100644 --- a/clients/client-emr-containers/runtimeConfig.native.ts +++ b/clients/client-emr-containers/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EMRContainersClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-emr-containers/runtimeConfig.ts b/clients/client-emr-containers/runtimeConfig.ts index 1cc9bddbe4fe..da96716ffe2d 100644 --- a/clients/client-emr-containers/runtimeConfig.ts +++ b/clients/client-emr-containers/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-emr/EMRClient.ts b/clients/client-emr/EMRClient.ts index 2e43d3ff4e38..fa4ba173112e 100644 --- a/clients/client-emr/EMRClient.ts +++ b/clients/client-emr/EMRClient.ts @@ -156,6 +156,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -166,6 +167,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -311,11 +313,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -357,6 +354,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EMRClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -365,8 +368,8 @@ export type EMRClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EMRClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -374,8 +377,8 @@ export type EMRClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon EMR is a web service that makes it easier to process large amounts of data @@ -400,16 +403,16 @@ export class EMRClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-emr/runtimeConfig.browser.ts b/clients/client-emr/runtimeConfig.browser.ts index 394b91541f3b..7c3cad005a10 100644 --- a/clients/client-emr/runtimeConfig.browser.ts +++ b/clients/client-emr/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-emr/runtimeConfig.native.ts b/clients/client-emr/runtimeConfig.native.ts index baf9056f41d2..5c15ca853b4a 100644 --- a/clients/client-emr/runtimeConfig.native.ts +++ b/clients/client-emr/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EMRClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-emr/runtimeConfig.ts b/clients/client-emr/runtimeConfig.ts index 29b1438f6c25..3c11e1b39eee 100644 --- a/clients/client-emr/runtimeConfig.ts +++ b/clients/client-emr/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-eventbridge/EventBridgeClient.ts b/clients/client-eventbridge/EventBridgeClient.ts index 699424f30b10..7cdd24db70ad 100644 --- a/clients/client-eventbridge/EventBridgeClient.ts +++ b/clients/client-eventbridge/EventBridgeClient.ts @@ -105,6 +105,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -115,6 +116,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -248,11 +250,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -294,6 +291,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EventBridgeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -302,8 +305,8 @@ export type EventBridgeClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EventBridgeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -311,8 +314,8 @@ export type EventBridgeClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon EventBridge helps you to respond to state changes in your AWS resources. @@ -355,16 +358,16 @@ export class EventBridgeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-eventbridge/runtimeConfig.browser.ts b/clients/client-eventbridge/runtimeConfig.browser.ts index 52c92b281eeb..1cc11b027edb 100644 --- a/clients/client-eventbridge/runtimeConfig.browser.ts +++ b/clients/client-eventbridge/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-eventbridge/runtimeConfig.native.ts b/clients/client-eventbridge/runtimeConfig.native.ts index 0e5f70f3a148..11ea8c309629 100644 --- a/clients/client-eventbridge/runtimeConfig.native.ts +++ b/clients/client-eventbridge/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EventBridgeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-eventbridge/runtimeConfig.ts b/clients/client-eventbridge/runtimeConfig.ts index 49ab30278bb4..020563b9044b 100644 --- a/clients/client-eventbridge/runtimeConfig.ts +++ b/clients/client-eventbridge/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-firehose/FirehoseClient.ts b/clients/client-firehose/FirehoseClient.ts index 6cbe7c6f6d1a..df04fb67ab08 100644 --- a/clients/client-firehose/FirehoseClient.ts +++ b/clients/client-firehose/FirehoseClient.ts @@ -71,6 +71,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -81,6 +82,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -158,11 +160,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -204,6 +201,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type FirehoseClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -212,8 +215,8 @@ export type FirehoseClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type FirehoseClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -221,8 +224,8 @@ export type FirehoseClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Kinesis Data Firehose API Reference @@ -247,16 +250,16 @@ export class FirehoseClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-firehose/runtimeConfig.browser.ts b/clients/client-firehose/runtimeConfig.browser.ts index 14b92e169ad6..4055fed137ae 100644 --- a/clients/client-firehose/runtimeConfig.browser.ts +++ b/clients/client-firehose/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-firehose/runtimeConfig.native.ts b/clients/client-firehose/runtimeConfig.native.ts index 56e99155daab..85ff7de04da0 100644 --- a/clients/client-firehose/runtimeConfig.native.ts +++ b/clients/client-firehose/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./FirehoseClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-firehose/runtimeConfig.ts b/clients/client-firehose/runtimeConfig.ts index 53ec05d589db..69e3291faf57 100644 --- a/clients/client-firehose/runtimeConfig.ts +++ b/clients/client-firehose/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-fms/FMSClient.ts b/clients/client-fms/FMSClient.ts index 83254b13b24a..2a4d8270d117 100644 --- a/clients/client-fms/FMSClient.ts +++ b/clients/client-fms/FMSClient.ts @@ -94,6 +94,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -104,6 +105,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type FMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +266,8 @@ export type FMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type FMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +275,8 @@ export type FMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Firewall Manager @@ -302,16 +305,16 @@ export class FMSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-fms/runtimeConfig.browser.ts b/clients/client-fms/runtimeConfig.browser.ts index 86365b3512e9..d37950073f38 100644 --- a/clients/client-fms/runtimeConfig.browser.ts +++ b/clients/client-fms/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-fms/runtimeConfig.native.ts b/clients/client-fms/runtimeConfig.native.ts index 2881bc1eeb16..06fae71ba3bf 100644 --- a/clients/client-fms/runtimeConfig.native.ts +++ b/clients/client-fms/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./FMSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-fms/runtimeConfig.ts b/clients/client-fms/runtimeConfig.ts index 73908a670ecf..274b16144f9d 100644 --- a/clients/client-fms/runtimeConfig.ts +++ b/clients/client-fms/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-forecast/ForecastClient.ts b/clients/client-forecast/ForecastClient.ts index 421dda3d183d..f22437f7aa1b 100644 --- a/clients/client-forecast/ForecastClient.ts +++ b/clients/client-forecast/ForecastClient.ts @@ -110,6 +110,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -120,6 +121,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -239,11 +241,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -285,6 +282,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ForecastClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -293,8 +296,8 @@ export type ForecastClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ForecastClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -302,8 +305,8 @@ export type ForecastClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Provides APIs for creating and managing Amazon Forecast resources.

@@ -325,16 +328,16 @@ export class ForecastClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-forecast/runtimeConfig.browser.ts b/clients/client-forecast/runtimeConfig.browser.ts index 761e43765520..eadbbca2134c 100644 --- a/clients/client-forecast/runtimeConfig.browser.ts +++ b/clients/client-forecast/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-forecast/runtimeConfig.native.ts b/clients/client-forecast/runtimeConfig.native.ts index 152d020ae81c..8fc2abba31ea 100644 --- a/clients/client-forecast/runtimeConfig.native.ts +++ b/clients/client-forecast/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ForecastClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-forecast/runtimeConfig.ts b/clients/client-forecast/runtimeConfig.ts index 21856457fadc..7b5ea3dfdd9f 100644 --- a/clients/client-forecast/runtimeConfig.ts +++ b/clients/client-forecast/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-forecastquery/ForecastqueryClient.ts b/clients/client-forecastquery/ForecastqueryClient.ts index 38503bdb5c2a..015f3d7578eb 100644 --- a/clients/client-forecastquery/ForecastqueryClient.ts +++ b/clients/client-forecastquery/ForecastqueryClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = QueryForecastCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ForecastqueryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +156,8 @@ export type ForecastqueryClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ForecastqueryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +165,8 @@ export type ForecastqueryClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Provides APIs for creating and managing Amazon Forecast resources.

@@ -185,16 +188,16 @@ export class ForecastqueryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-forecastquery/runtimeConfig.browser.ts b/clients/client-forecastquery/runtimeConfig.browser.ts index 8156913b6fdf..68db5d5a774d 100644 --- a/clients/client-forecastquery/runtimeConfig.browser.ts +++ b/clients/client-forecastquery/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-forecastquery/runtimeConfig.native.ts b/clients/client-forecastquery/runtimeConfig.native.ts index 98bec5c1d37f..5a99514c36bf 100644 --- a/clients/client-forecastquery/runtimeConfig.native.ts +++ b/clients/client-forecastquery/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ForecastqueryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-forecastquery/runtimeConfig.ts b/clients/client-forecastquery/runtimeConfig.ts index 1de92622a3d4..d72cd6e6dedf 100644 --- a/clients/client-forecastquery/runtimeConfig.ts +++ b/clients/client-forecastquery/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-frauddetector/FraudDetectorClient.ts b/clients/client-frauddetector/FraudDetectorClient.ts index 4e3749f0e5bc..35deff79a605 100644 --- a/clients/client-frauddetector/FraudDetectorClient.ts +++ b/clients/client-frauddetector/FraudDetectorClient.ts @@ -124,6 +124,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -134,6 +135,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -293,11 +295,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -339,6 +336,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type FraudDetectorClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -347,8 +350,8 @@ export type FraudDetectorClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type FraudDetectorClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -356,8 +359,8 @@ export type FraudDetectorClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This is the Amazon Fraud Detector API Reference. This guide is for developers who need @@ -381,16 +384,16 @@ export class FraudDetectorClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-frauddetector/runtimeConfig.browser.ts b/clients/client-frauddetector/runtimeConfig.browser.ts index 142e9e3b8098..1909b62ecccf 100644 --- a/clients/client-frauddetector/runtimeConfig.browser.ts +++ b/clients/client-frauddetector/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-frauddetector/runtimeConfig.native.ts b/clients/client-frauddetector/runtimeConfig.native.ts index ed6f21b6f56a..ffeddbcfa558 100644 --- a/clients/client-frauddetector/runtimeConfig.native.ts +++ b/clients/client-frauddetector/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./FraudDetectorClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-frauddetector/runtimeConfig.ts b/clients/client-frauddetector/runtimeConfig.ts index 8c169c22c463..f81aeea6b0cd 100644 --- a/clients/client-frauddetector/runtimeConfig.ts +++ b/clients/client-frauddetector/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-fsx/FSxClient.ts b/clients/client-fsx/FSxClient.ts index e499b7221bc7..093996384cfd 100644 --- a/clients/client-fsx/FSxClient.ts +++ b/clients/client-fsx/FSxClient.ts @@ -79,6 +79,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -89,6 +90,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -176,11 +178,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -222,6 +219,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type FSxClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -230,8 +233,8 @@ export type FSxClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type FSxClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -239,8 +242,8 @@ export type FSxClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon FSx is a fully managed service that makes it easy for storage and @@ -263,16 +266,16 @@ export class FSxClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-fsx/runtimeConfig.browser.ts b/clients/client-fsx/runtimeConfig.browser.ts index 7f485db76e08..656d5f2ecfad 100644 --- a/clients/client-fsx/runtimeConfig.browser.ts +++ b/clients/client-fsx/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-fsx/runtimeConfig.native.ts b/clients/client-fsx/runtimeConfig.native.ts index e48c057da241..667d2d75c583 100644 --- a/clients/client-fsx/runtimeConfig.native.ts +++ b/clients/client-fsx/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./FSxClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-fsx/runtimeConfig.ts b/clients/client-fsx/runtimeConfig.ts index 94f668bfffc1..295dbf41cce2 100644 --- a/clients/client-fsx/runtimeConfig.ts +++ b/clients/client-fsx/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-gamelift/GameLiftClient.ts b/clients/client-gamelift/GameLiftClient.ts index dcc0f31d56f8..5edc463cc9d6 100644 --- a/clients/client-gamelift/GameLiftClient.ts +++ b/clients/client-gamelift/GameLiftClient.ts @@ -281,6 +281,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -291,6 +292,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -524,11 +526,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -570,6 +567,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type GameLiftClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -578,8 +581,8 @@ export type GameLiftClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GameLiftClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -587,8 +590,8 @@ export type GameLiftClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon GameLift Service @@ -660,16 +663,16 @@ export class GameLiftClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-gamelift/runtimeConfig.browser.ts b/clients/client-gamelift/runtimeConfig.browser.ts index f478c90dc94c..2db1887920f7 100644 --- a/clients/client-gamelift/runtimeConfig.browser.ts +++ b/clients/client-gamelift/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-gamelift/runtimeConfig.native.ts b/clients/client-gamelift/runtimeConfig.native.ts index 2180707fe055..d7c948f5a470 100644 --- a/clients/client-gamelift/runtimeConfig.native.ts +++ b/clients/client-gamelift/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GameLiftClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-gamelift/runtimeConfig.ts b/clients/client-gamelift/runtimeConfig.ts index 30d676673008..3df467d66969 100644 --- a/clients/client-gamelift/runtimeConfig.ts +++ b/clients/client-gamelift/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-glacier/GlacierClient.ts b/clients/client-glacier/GlacierClient.ts index fadbc8211ed0..8a687b7cee92 100644 --- a/clients/client-glacier/GlacierClient.ts +++ b/clients/client-glacier/GlacierClient.ts @@ -117,6 +117,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -128,6 +129,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -247,11 +249,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -301,6 +298,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ request: __HttpRequest, options: { sha256: __HashConstructor; utf8Decoder: __Decoder } ) => Promise<[string, string]>; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type GlacierClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -309,8 +312,8 @@ export type GlacierClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GlacierClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -318,8 +321,8 @@ export type GlacierClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon S3 Glacier (Glacier) is a storage solution for "cold data."

@@ -378,17 +381,17 @@ export class GlacierClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getGlacierPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-glacier/runtimeConfig.browser.ts b/clients/client-glacier/runtimeConfig.browser.ts index b3f2a0e9414f..7cea1de95be0 100644 --- a/clients/client-glacier/runtimeConfig.browser.ts +++ b/clients/client-glacier/runtimeConfig.browser.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { bodyChecksumGenerator, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-glacier/runtimeConfig.native.ts b/clients/client-glacier/runtimeConfig.native.ts index 4ec7e88ba231..d9be63dceac0 100644 --- a/clients/client-glacier/runtimeConfig.native.ts +++ b/clients/client-glacier/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GlacierClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-glacier/runtimeConfig.ts b/clients/client-glacier/runtimeConfig.ts index 86a45687b07a..05e3d9bd597c 100644 --- a/clients/client-glacier/runtimeConfig.ts +++ b/clients/client-glacier/runtimeConfig.ts @@ -26,7 +26,10 @@ export const ClientDefaultValues: Required = { bodyChecksumGenerator, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-global-accelerator/GlobalAcceleratorClient.ts b/clients/client-global-accelerator/GlobalAcceleratorClient.ts index 8e82f5563942..9f1a581bc6bd 100644 --- a/clients/client-global-accelerator/GlobalAcceleratorClient.ts +++ b/clients/client-global-accelerator/GlobalAcceleratorClient.ts @@ -175,6 +175,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -185,6 +186,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -332,11 +334,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -378,6 +375,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type GlobalAcceleratorClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -386,8 +389,8 @@ export type GlobalAcceleratorClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GlobalAcceleratorClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -395,8 +398,8 @@ export type GlobalAcceleratorClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Global Accelerator @@ -565,16 +568,16 @@ export class GlobalAcceleratorClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-global-accelerator/runtimeConfig.browser.ts b/clients/client-global-accelerator/runtimeConfig.browser.ts index 5a1f4789e0df..2819fe76bc95 100644 --- a/clients/client-global-accelerator/runtimeConfig.browser.ts +++ b/clients/client-global-accelerator/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-global-accelerator/runtimeConfig.native.ts b/clients/client-global-accelerator/runtimeConfig.native.ts index 5255941fe136..e88df1cf0063 100644 --- a/clients/client-global-accelerator/runtimeConfig.native.ts +++ b/clients/client-global-accelerator/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GlobalAcceleratorClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-global-accelerator/runtimeConfig.ts b/clients/client-global-accelerator/runtimeConfig.ts index e8e36b46ebd2..5929fb47bb14 100644 --- a/clients/client-global-accelerator/runtimeConfig.ts +++ b/clients/client-global-accelerator/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-glue/GlueClient.ts b/clients/client-glue/GlueClient.ts index aa999df65432..7f3acb7add8b 100644 --- a/clients/client-glue/GlueClient.ts +++ b/clients/client-glue/GlueClient.ts @@ -333,6 +333,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -343,6 +344,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -710,11 +712,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -756,6 +753,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type GlueClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -764,8 +767,8 @@ export type GlueClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOption EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GlueClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -773,8 +776,8 @@ export type GlueClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandl EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Glue @@ -797,16 +800,16 @@ export class GlueClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-glue/runtimeConfig.browser.ts b/clients/client-glue/runtimeConfig.browser.ts index 6de537f2e151..8d710ddd4466 100644 --- a/clients/client-glue/runtimeConfig.browser.ts +++ b/clients/client-glue/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-glue/runtimeConfig.native.ts b/clients/client-glue/runtimeConfig.native.ts index cfaeac2fcf54..02a575596094 100644 --- a/clients/client-glue/runtimeConfig.native.ts +++ b/clients/client-glue/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GlueClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-glue/runtimeConfig.ts b/clients/client-glue/runtimeConfig.ts index 57795af494f8..510af72737e1 100644 --- a/clients/client-glue/runtimeConfig.ts +++ b/clients/client-glue/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-greengrass/GreengrassClient.ts b/clients/client-greengrass/GreengrassClient.ts index 01e9243cd2a8..70f7c64b7a04 100644 --- a/clients/client-greengrass/GreengrassClient.ts +++ b/clients/client-greengrass/GreengrassClient.ts @@ -355,6 +355,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -365,6 +366,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -602,11 +604,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -648,6 +645,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type GreengrassClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -656,8 +659,8 @@ export type GreengrassClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GreengrassClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -665,8 +668,8 @@ export type GreengrassClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS IoT Greengrass seamlessly extends AWS onto physical devices so they can act locally on the data they generate, while still using the cloud for management, analytics, and durable storage. AWS IoT Greengrass ensures your devices can respond quickly to local events and operate with intermittent connectivity. AWS IoT Greengrass minimizes the cost of transmitting data to the cloud by allowing you to author AWS Lambda functions that execute locally. @@ -688,16 +691,16 @@ export class GreengrassClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-greengrass/runtimeConfig.browser.ts b/clients/client-greengrass/runtimeConfig.browser.ts index 7863e3490661..db04ddb05b6a 100644 --- a/clients/client-greengrass/runtimeConfig.browser.ts +++ b/clients/client-greengrass/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-greengrass/runtimeConfig.native.ts b/clients/client-greengrass/runtimeConfig.native.ts index 37cafa18bc80..a87dc5ee17b0 100644 --- a/clients/client-greengrass/runtimeConfig.native.ts +++ b/clients/client-greengrass/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GreengrassClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-greengrass/runtimeConfig.ts b/clients/client-greengrass/runtimeConfig.ts index 3dee4468021e..4207efcc191d 100644 --- a/clients/client-greengrass/runtimeConfig.ts +++ b/clients/client-greengrass/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-groundstation/GroundStationClient.ts b/clients/client-groundstation/GroundStationClient.ts index aa23e6be190b..8ab7a6a28d16 100644 --- a/clients/client-groundstation/GroundStationClient.ts +++ b/clients/client-groundstation/GroundStationClient.ts @@ -87,6 +87,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -97,6 +98,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -200,11 +202,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -246,6 +243,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type GroundStationClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -254,8 +257,8 @@ export type GroundStationClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GroundStationClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -263,8 +266,8 @@ export type GroundStationClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the AWS Ground Station API Reference. AWS Ground Station is a fully managed service that @@ -289,16 +292,16 @@ export class GroundStationClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-groundstation/runtimeConfig.browser.ts b/clients/client-groundstation/runtimeConfig.browser.ts index 47cb7d5f0ce7..63ce249eec93 100644 --- a/clients/client-groundstation/runtimeConfig.browser.ts +++ b/clients/client-groundstation/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-groundstation/runtimeConfig.native.ts b/clients/client-groundstation/runtimeConfig.native.ts index 347590950516..52aa8d6e8455 100644 --- a/clients/client-groundstation/runtimeConfig.native.ts +++ b/clients/client-groundstation/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GroundStationClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-groundstation/runtimeConfig.ts b/clients/client-groundstation/runtimeConfig.ts index 132b23b9b6e6..d0973ebe24e4 100644 --- a/clients/client-groundstation/runtimeConfig.ts +++ b/clients/client-groundstation/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-guardduty/GuardDutyClient.ts b/clients/client-guardduty/GuardDutyClient.ts index 9ebea17d47ef..1c1f69599cfc 100644 --- a/clients/client-guardduty/GuardDutyClient.ts +++ b/clients/client-guardduty/GuardDutyClient.ts @@ -165,6 +165,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -175,6 +176,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -344,11 +346,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -390,6 +387,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type GuardDutyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -398,8 +401,8 @@ export type GuardDutyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type GuardDutyClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -407,8 +410,8 @@ export type GuardDutyClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon GuardDuty is a continuous security monitoring service that analyzes and processes @@ -446,16 +449,16 @@ export class GuardDutyClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-guardduty/runtimeConfig.browser.ts b/clients/client-guardduty/runtimeConfig.browser.ts index 222af394850f..42daae6239f5 100644 --- a/clients/client-guardduty/runtimeConfig.browser.ts +++ b/clients/client-guardduty/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-guardduty/runtimeConfig.native.ts b/clients/client-guardduty/runtimeConfig.native.ts index e17adf04da27..9267548ef263 100644 --- a/clients/client-guardduty/runtimeConfig.native.ts +++ b/clients/client-guardduty/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./GuardDutyClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-guardduty/runtimeConfig.ts b/clients/client-guardduty/runtimeConfig.ts index fd1af1067c3e..0384f0376b40 100644 --- a/clients/client-guardduty/runtimeConfig.ts +++ b/clients/client-guardduty/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-health/HealthClient.ts b/clients/client-health/HealthClient.ts index cf6ca6604c76..321ee6c83dd2 100644 --- a/clients/client-health/HealthClient.ts +++ b/clients/client-health/HealthClient.ts @@ -81,6 +81,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -91,6 +92,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type HealthClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +227,8 @@ export type HealthClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type HealthClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +236,8 @@ export type HealthClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Health @@ -293,16 +296,16 @@ export class HealthClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-health/runtimeConfig.browser.ts b/clients/client-health/runtimeConfig.browser.ts index 0b3ebc6dd73a..f240e86f78ad 100644 --- a/clients/client-health/runtimeConfig.browser.ts +++ b/clients/client-health/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-health/runtimeConfig.native.ts b/clients/client-health/runtimeConfig.native.ts index 6abcd5288a07..1134bd9e518d 100644 --- a/clients/client-health/runtimeConfig.native.ts +++ b/clients/client-health/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./HealthClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-health/runtimeConfig.ts b/clients/client-health/runtimeConfig.ts index 4674df434707..6b44381d4914 100644 --- a/clients/client-health/runtimeConfig.ts +++ b/clients/client-health/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-healthlake/HealthLakeClient.ts b/clients/client-healthlake/HealthLakeClient.ts index 36e8c7f57e9e..2061c0a6acd5 100644 --- a/clients/client-healthlake/HealthLakeClient.ts +++ b/clients/client-healthlake/HealthLakeClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -128,11 +130,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -174,6 +171,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type HealthLakeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -182,8 +185,8 @@ export type HealthLakeClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type HealthLakeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -191,8 +194,8 @@ export type HealthLakeClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon HealthLake is a HIPAA eligibile service that allows customers to store, @@ -215,16 +218,16 @@ export class HealthLakeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-healthlake/runtimeConfig.browser.ts b/clients/client-healthlake/runtimeConfig.browser.ts index f13a36c320bc..c4159dbce380 100644 --- a/clients/client-healthlake/runtimeConfig.browser.ts +++ b/clients/client-healthlake/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-healthlake/runtimeConfig.native.ts b/clients/client-healthlake/runtimeConfig.native.ts index f1bf34725bff..4ae36a662ffc 100644 --- a/clients/client-healthlake/runtimeConfig.native.ts +++ b/clients/client-healthlake/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./HealthLakeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-healthlake/runtimeConfig.ts b/clients/client-healthlake/runtimeConfig.ts index f746e7bdbaba..6d913c7aca0f 100644 --- a/clients/client-healthlake/runtimeConfig.ts +++ b/clients/client-healthlake/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-honeycode/HoneycodeClient.ts b/clients/client-honeycode/HoneycodeClient.ts index 00ae63a57c3b..9049a13b396d 100644 --- a/clients/client-honeycode/HoneycodeClient.ts +++ b/clients/client-honeycode/HoneycodeClient.ts @@ -68,6 +68,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -78,6 +79,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -155,11 +157,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -201,6 +198,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type HoneycodeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -209,8 +212,8 @@ export type HoneycodeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type HoneycodeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -218,8 +221,8 @@ export type HoneycodeClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -245,16 +248,16 @@ export class HoneycodeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-honeycode/runtimeConfig.browser.ts b/clients/client-honeycode/runtimeConfig.browser.ts index 2e4c76f32992..637b3d4e203a 100644 --- a/clients/client-honeycode/runtimeConfig.browser.ts +++ b/clients/client-honeycode/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-honeycode/runtimeConfig.native.ts b/clients/client-honeycode/runtimeConfig.native.ts index 44dbb946ab27..58470e9f41cd 100644 --- a/clients/client-honeycode/runtimeConfig.native.ts +++ b/clients/client-honeycode/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./HoneycodeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-honeycode/runtimeConfig.ts b/clients/client-honeycode/runtimeConfig.ts index 7bb6c92a8d22..4360401c5559 100644 --- a/clients/client-honeycode/runtimeConfig.ts +++ b/clients/client-honeycode/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iam/IAMClient.ts b/clients/client-iam/IAMClient.ts index 1f4a9f712288..a47bbca1b95e 100644 --- a/clients/client-iam/IAMClient.ts +++ b/clients/client-iam/IAMClient.ts @@ -373,6 +373,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -383,6 +384,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -716,11 +718,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -762,6 +759,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IAMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -770,8 +773,8 @@ export type IAMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IAMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -779,8 +782,8 @@ export type IAMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Identity and Access Management @@ -806,16 +809,16 @@ export class IAMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iam/runtimeConfig.browser.ts b/clients/client-iam/runtimeConfig.browser.ts index 8101d3b6dd29..50a2cf2e3bf2 100644 --- a/clients/client-iam/runtimeConfig.browser.ts +++ b/clients/client-iam/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iam/runtimeConfig.native.ts b/clients/client-iam/runtimeConfig.native.ts index 106f9305b834..f15d8cf5ef8d 100644 --- a/clients/client-iam/runtimeConfig.native.ts +++ b/clients/client-iam/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IAMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iam/runtimeConfig.ts b/clients/client-iam/runtimeConfig.ts index c89b77e118c7..35d5c8c0e38a 100644 --- a/clients/client-iam/runtimeConfig.ts +++ b/clients/client-iam/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-identitystore/IdentitystoreClient.ts b/clients/client-identitystore/IdentitystoreClient.ts index 665627767456..5f0f6c09b328 100644 --- a/clients/client-identitystore/IdentitystoreClient.ts +++ b/clients/client-identitystore/IdentitystoreClient.ts @@ -39,6 +39,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -49,6 +50,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -110,11 +112,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -156,6 +153,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IdentitystoreClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -164,8 +167,8 @@ export type IdentitystoreClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IdentitystoreClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -173,8 +176,8 @@ export type IdentitystoreClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; export class IdentitystoreClient extends __Client< __HttpHandlerOptions, @@ -193,16 +196,16 @@ export class IdentitystoreClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-identitystore/runtimeConfig.browser.ts b/clients/client-identitystore/runtimeConfig.browser.ts index 5fd83a089588..d8a2cadaa580 100644 --- a/clients/client-identitystore/runtimeConfig.browser.ts +++ b/clients/client-identitystore/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-identitystore/runtimeConfig.native.ts b/clients/client-identitystore/runtimeConfig.native.ts index b19b8146668f..614b2deec496 100644 --- a/clients/client-identitystore/runtimeConfig.native.ts +++ b/clients/client-identitystore/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IdentitystoreClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-identitystore/runtimeConfig.ts b/clients/client-identitystore/runtimeConfig.ts index 17f04bfe149d..a11e26c35853 100644 --- a/clients/client-identitystore/runtimeConfig.ts +++ b/clients/client-identitystore/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-imagebuilder/ImagebuilderClient.ts b/clients/client-imagebuilder/ImagebuilderClient.ts index 3c9d326e037f..29b5359d1060 100644 --- a/clients/client-imagebuilder/ImagebuilderClient.ts +++ b/clients/client-imagebuilder/ImagebuilderClient.ts @@ -140,6 +140,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -150,6 +151,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -287,11 +289,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -333,6 +330,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ImagebuilderClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -341,8 +344,8 @@ export type ImagebuilderClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ImagebuilderClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -350,8 +353,8 @@ export type ImagebuilderClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

EC2 Image Builder is a fully managed AWS service that makes it easier to automate the creation, management, and deployment of customized, secure, and up-to-date “golden” server images that are pre-installed and pre-configured with software and settings to meet specific IT standards.

@@ -373,16 +376,16 @@ export class ImagebuilderClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-imagebuilder/runtimeConfig.browser.ts b/clients/client-imagebuilder/runtimeConfig.browser.ts index ee32dda920d7..b6306f2ab833 100644 --- a/clients/client-imagebuilder/runtimeConfig.browser.ts +++ b/clients/client-imagebuilder/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-imagebuilder/runtimeConfig.native.ts b/clients/client-imagebuilder/runtimeConfig.native.ts index 6b13e01d7af4..3f695e2f0715 100644 --- a/clients/client-imagebuilder/runtimeConfig.native.ts +++ b/clients/client-imagebuilder/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ImagebuilderClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-imagebuilder/runtimeConfig.ts b/clients/client-imagebuilder/runtimeConfig.ts index 840a8b42e4d9..0727f6902aa1 100644 --- a/clients/client-imagebuilder/runtimeConfig.ts +++ b/clients/client-imagebuilder/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-inspector/InspectorClient.ts b/clients/client-inspector/InspectorClient.ts index 49331db397bf..f048693e1440 100644 --- a/clients/client-inspector/InspectorClient.ts +++ b/clients/client-inspector/InspectorClient.ts @@ -150,6 +150,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -160,6 +161,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -287,11 +289,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -333,6 +330,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type InspectorClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -341,8 +344,8 @@ export type InspectorClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type InspectorClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -350,8 +353,8 @@ export type InspectorClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Inspector @@ -376,16 +379,16 @@ export class InspectorClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-inspector/runtimeConfig.browser.ts b/clients/client-inspector/runtimeConfig.browser.ts index 5a01db88c24a..1f5d3b0db130 100644 --- a/clients/client-inspector/runtimeConfig.browser.ts +++ b/clients/client-inspector/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-inspector/runtimeConfig.native.ts b/clients/client-inspector/runtimeConfig.native.ts index d8d382462da9..925dd30f5e86 100644 --- a/clients/client-inspector/runtimeConfig.native.ts +++ b/clients/client-inspector/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./InspectorClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-inspector/runtimeConfig.ts b/clients/client-inspector/runtimeConfig.ts index 96a508aadadd..7ef1a40da6af 100644 --- a/clients/client-inspector/runtimeConfig.ts +++ b/clients/client-inspector/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-1click-devices-service/IoT1ClickDevicesServiceClient.ts b/clients/client-iot-1click-devices-service/IoT1ClickDevicesServiceClient.ts index 2960f82f5386..70ee5dbfc8fc 100644 --- a/clients/client-iot-1click-devices-service/IoT1ClickDevicesServiceClient.ts +++ b/clients/client-iot-1click-devices-service/IoT1ClickDevicesServiceClient.ts @@ -60,6 +60,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -70,6 +71,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -149,11 +151,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -195,6 +192,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoT1ClickDevicesServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -203,8 +206,8 @@ export type IoT1ClickDevicesServiceClientConfig = Partial<__SmithyConfiguration< EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoT1ClickDevicesServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -212,8 +215,8 @@ export type IoT1ClickDevicesServiceClientResolvedConfig = __SmithyResolvedConfig EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Describes all of the AWS IoT 1-Click device-related API operations for the service. @@ -237,16 +240,16 @@ export class IoT1ClickDevicesServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-1click-devices-service/runtimeConfig.browser.ts b/clients/client-iot-1click-devices-service/runtimeConfig.browser.ts index 5657814d55c2..25b6583ea85a 100644 --- a/clients/client-iot-1click-devices-service/runtimeConfig.browser.ts +++ b/clients/client-iot-1click-devices-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-1click-devices-service/runtimeConfig.native.ts b/clients/client-iot-1click-devices-service/runtimeConfig.native.ts index f86e6e9dce99..aa8a1e5bc377 100644 --- a/clients/client-iot-1click-devices-service/runtimeConfig.native.ts +++ b/clients/client-iot-1click-devices-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoT1ClickDevicesServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-1click-devices-service/runtimeConfig.ts b/clients/client-iot-1click-devices-service/runtimeConfig.ts index 5ee39c34cfd0..6065d59bea9f 100644 --- a/clients/client-iot-1click-devices-service/runtimeConfig.ts +++ b/clients/client-iot-1click-devices-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-1click-projects/IoT1ClickProjectsClient.ts b/clients/client-iot-1click-projects/IoT1ClickProjectsClient.ts index 60cf49887d71..5bde8a3a7a81 100644 --- a/clients/client-iot-1click-projects/IoT1ClickProjectsClient.ts +++ b/clients/client-iot-1click-projects/IoT1ClickProjectsClient.ts @@ -63,6 +63,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -73,6 +74,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -158,11 +160,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -204,6 +201,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoT1ClickProjectsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -212,8 +215,8 @@ export type IoT1ClickProjectsClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoT1ClickProjectsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -221,8 +224,8 @@ export type IoT1ClickProjectsClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS IoT 1-Click Projects API Reference

@@ -244,16 +247,16 @@ export class IoT1ClickProjectsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-1click-projects/runtimeConfig.browser.ts b/clients/client-iot-1click-projects/runtimeConfig.browser.ts index 74eda9ea8326..faf186a8ecc3 100644 --- a/clients/client-iot-1click-projects/runtimeConfig.browser.ts +++ b/clients/client-iot-1click-projects/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-1click-projects/runtimeConfig.native.ts b/clients/client-iot-1click-projects/runtimeConfig.native.ts index a5bd4ffe1fc0..ed52b2091d01 100644 --- a/clients/client-iot-1click-projects/runtimeConfig.native.ts +++ b/clients/client-iot-1click-projects/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoT1ClickProjectsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-1click-projects/runtimeConfig.ts b/clients/client-iot-1click-projects/runtimeConfig.ts index c336965ae390..7035d8943f0a 100644 --- a/clients/client-iot-1click-projects/runtimeConfig.ts +++ b/clients/client-iot-1click-projects/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-data-plane/IoTDataPlaneClient.ts b/clients/client-iot-data-plane/IoTDataPlaneClient.ts index 7c4475f674ca..d367ad632c80 100644 --- a/clients/client-iot-data-plane/IoTDataPlaneClient.ts +++ b/clients/client-iot-data-plane/IoTDataPlaneClient.ts @@ -43,6 +43,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -53,6 +54,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -116,11 +118,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -162,6 +159,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTDataPlaneClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -170,8 +173,8 @@ export type IoTDataPlaneClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTDataPlaneClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -179,8 +182,8 @@ export type IoTDataPlaneClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS IoT @@ -212,16 +215,16 @@ export class IoTDataPlaneClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-data-plane/runtimeConfig.browser.ts b/clients/client-iot-data-plane/runtimeConfig.browser.ts index a0282f592e89..194deddffebf 100644 --- a/clients/client-iot-data-plane/runtimeConfig.browser.ts +++ b/clients/client-iot-data-plane/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-data-plane/runtimeConfig.native.ts b/clients/client-iot-data-plane/runtimeConfig.native.ts index f667ec0e6231..4e4ea28faab2 100644 --- a/clients/client-iot-data-plane/runtimeConfig.native.ts +++ b/clients/client-iot-data-plane/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTDataPlaneClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-data-plane/runtimeConfig.ts b/clients/client-iot-data-plane/runtimeConfig.ts index b9d051dce059..f10ae5116251 100644 --- a/clients/client-iot-data-plane/runtimeConfig.ts +++ b/clients/client-iot-data-plane/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-events-data/IoTEventsDataClient.ts b/clients/client-iot-events-data/IoTEventsDataClient.ts index 47b1dffda2e8..d7700ef08563 100644 --- a/clients/client-iot-events-data/IoTEventsDataClient.ts +++ b/clients/client-iot-events-data/IoTEventsDataClient.ts @@ -42,6 +42,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -52,6 +53,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -113,11 +115,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -159,6 +156,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTEventsDataClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -167,8 +170,8 @@ export type IoTEventsDataClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTEventsDataClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -176,8 +179,8 @@ export type IoTEventsDataClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS IoT Events monitors your equipment or device fleets for failures or changes in operation, @@ -201,16 +204,16 @@ export class IoTEventsDataClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-events-data/runtimeConfig.browser.ts b/clients/client-iot-events-data/runtimeConfig.browser.ts index 1b65ea876666..01eb8f57b9c5 100644 --- a/clients/client-iot-events-data/runtimeConfig.browser.ts +++ b/clients/client-iot-events-data/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-events-data/runtimeConfig.native.ts b/clients/client-iot-events-data/runtimeConfig.native.ts index 78149a851e49..0aeb7db1ce3c 100644 --- a/clients/client-iot-events-data/runtimeConfig.native.ts +++ b/clients/client-iot-events-data/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTEventsDataClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-events-data/runtimeConfig.ts b/clients/client-iot-events-data/runtimeConfig.ts index f6b621402611..e6ba6e800c88 100644 --- a/clients/client-iot-events-data/runtimeConfig.ts +++ b/clients/client-iot-events-data/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-events/IoTEventsClient.ts b/clients/client-iot-events/IoTEventsClient.ts index eca0d490de8a..a98378b1b27d 100644 --- a/clients/client-iot-events/IoTEventsClient.ts +++ b/clients/client-iot-events/IoTEventsClient.ts @@ -72,6 +72,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -82,6 +83,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -213,6 +210,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTEventsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -221,8 +224,8 @@ export type IoTEventsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTEventsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -230,8 +233,8 @@ export type IoTEventsClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS IoT Events monitors your equipment or device fleets for failures or changes in operation, and @@ -255,16 +258,16 @@ export class IoTEventsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-events/runtimeConfig.browser.ts b/clients/client-iot-events/runtimeConfig.browser.ts index c23b7156601c..804b7eb72473 100644 --- a/clients/client-iot-events/runtimeConfig.browser.ts +++ b/clients/client-iot-events/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-events/runtimeConfig.native.ts b/clients/client-iot-events/runtimeConfig.native.ts index 2f1a3ebeef31..eaa85451d4b6 100644 --- a/clients/client-iot-events/runtimeConfig.native.ts +++ b/clients/client-iot-events/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTEventsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-events/runtimeConfig.ts b/clients/client-iot-events/runtimeConfig.ts index 0246c2690c05..12b412636e5a 100644 --- a/clients/client-iot-events/runtimeConfig.ts +++ b/clients/client-iot-events/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot-jobs-data-plane/IoTJobsDataPlaneClient.ts b/clients/client-iot-jobs-data-plane/IoTJobsDataPlaneClient.ts index b234757cda31..840837f3d30a 100644 --- a/clients/client-iot-jobs-data-plane/IoTJobsDataPlaneClient.ts +++ b/clients/client-iot-jobs-data-plane/IoTJobsDataPlaneClient.ts @@ -48,6 +48,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -58,6 +59,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -119,11 +121,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -165,6 +162,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTJobsDataPlaneClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -173,8 +176,8 @@ export type IoTJobsDataPlaneClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTJobsDataPlaneClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -182,8 +185,8 @@ export type IoTJobsDataPlaneClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS IoT Jobs is a service that allows you to define a set of jobs — remote operations that are sent to @@ -215,16 +218,16 @@ export class IoTJobsDataPlaneClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot-jobs-data-plane/runtimeConfig.browser.ts b/clients/client-iot-jobs-data-plane/runtimeConfig.browser.ts index 2fbc727eac35..31f147e2cddb 100644 --- a/clients/client-iot-jobs-data-plane/runtimeConfig.browser.ts +++ b/clients/client-iot-jobs-data-plane/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot-jobs-data-plane/runtimeConfig.native.ts b/clients/client-iot-jobs-data-plane/runtimeConfig.native.ts index 923cfbf90662..abad19f8dc8d 100644 --- a/clients/client-iot-jobs-data-plane/runtimeConfig.native.ts +++ b/clients/client-iot-jobs-data-plane/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTJobsDataPlaneClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot-jobs-data-plane/runtimeConfig.ts b/clients/client-iot-jobs-data-plane/runtimeConfig.ts index a9963712a96f..165ab5067b59 100644 --- a/clients/client-iot-jobs-data-plane/runtimeConfig.ts +++ b/clients/client-iot-jobs-data-plane/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iot/IoTClient.ts b/clients/client-iot/IoTClient.ts index bc693d2c2aae..95f504178176 100644 --- a/clients/client-iot/IoTClient.ts +++ b/clients/client-iot/IoTClient.ts @@ -616,6 +616,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -626,6 +627,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -1103,11 +1105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -1149,6 +1146,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -1157,8 +1160,8 @@ export type IoTClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -1166,8 +1169,8 @@ export type IoTClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS IoT @@ -1204,16 +1207,16 @@ export class IoTClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iot/runtimeConfig.browser.ts b/clients/client-iot/runtimeConfig.browser.ts index 22885b57e581..5e9d55556e85 100644 --- a/clients/client-iot/runtimeConfig.browser.ts +++ b/clients/client-iot/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iot/runtimeConfig.native.ts b/clients/client-iot/runtimeConfig.native.ts index 6198932a1074..defb8198e3d5 100644 --- a/clients/client-iot/runtimeConfig.native.ts +++ b/clients/client-iot/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iot/runtimeConfig.ts b/clients/client-iot/runtimeConfig.ts index a4a6bcd60000..a32b9249b455 100644 --- a/clients/client-iot/runtimeConfig.ts +++ b/clients/client-iot/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iotanalytics/IoTAnalyticsClient.ts b/clients/client-iotanalytics/IoTAnalyticsClient.ts index 8ae72a8de38f..51b4717b99ba 100644 --- a/clients/client-iotanalytics/IoTAnalyticsClient.ts +++ b/clients/client-iotanalytics/IoTAnalyticsClient.ts @@ -93,6 +93,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -103,6 +104,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -224,11 +226,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -270,6 +267,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTAnalyticsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -278,8 +281,8 @@ export type IoTAnalyticsClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTAnalyticsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -287,8 +290,8 @@ export type IoTAnalyticsClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS IoT Analytics allows you to collect large amounts of device data, process messages, and store them. @@ -328,16 +331,16 @@ export class IoTAnalyticsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iotanalytics/runtimeConfig.browser.ts b/clients/client-iotanalytics/runtimeConfig.browser.ts index ebce7964af70..0d538cb77aab 100644 --- a/clients/client-iotanalytics/runtimeConfig.browser.ts +++ b/clients/client-iotanalytics/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iotanalytics/runtimeConfig.native.ts b/clients/client-iotanalytics/runtimeConfig.native.ts index 117a38577fed..23b40c4c1168 100644 --- a/clients/client-iotanalytics/runtimeConfig.native.ts +++ b/clients/client-iotanalytics/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTAnalyticsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iotanalytics/runtimeConfig.ts b/clients/client-iotanalytics/runtimeConfig.ts index 737120b90296..94fee36290de 100644 --- a/clients/client-iotanalytics/runtimeConfig.ts +++ b/clients/client-iotanalytics/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iotsecuretunneling/IoTSecureTunnelingClient.ts b/clients/client-iotsecuretunneling/IoTSecureTunnelingClient.ts index 598f6a650e4a..b9da0d65480e 100644 --- a/clients/client-iotsecuretunneling/IoTSecureTunnelingClient.ts +++ b/clients/client-iotsecuretunneling/IoTSecureTunnelingClient.ts @@ -45,6 +45,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -55,6 +56,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -122,11 +124,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -168,6 +165,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTSecureTunnelingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -176,8 +179,8 @@ export type IoTSecureTunnelingClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTSecureTunnelingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -185,8 +188,8 @@ export type IoTSecureTunnelingClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS IoT Secure Tunneling @@ -212,16 +215,16 @@ export class IoTSecureTunnelingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iotsecuretunneling/runtimeConfig.browser.ts b/clients/client-iotsecuretunneling/runtimeConfig.browser.ts index e05269009106..a283dc531b8a 100644 --- a/clients/client-iotsecuretunneling/runtimeConfig.browser.ts +++ b/clients/client-iotsecuretunneling/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iotsecuretunneling/runtimeConfig.native.ts b/clients/client-iotsecuretunneling/runtimeConfig.native.ts index 6ebdb592cf13..775e2c3dfe3f 100644 --- a/clients/client-iotsecuretunneling/runtimeConfig.native.ts +++ b/clients/client-iotsecuretunneling/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTSecureTunnelingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iotsecuretunneling/runtimeConfig.ts b/clients/client-iotsecuretunneling/runtimeConfig.ts index 5c767909f1e2..2b1313e03c3c 100644 --- a/clients/client-iotsecuretunneling/runtimeConfig.ts +++ b/clients/client-iotsecuretunneling/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iotsitewise/IoTSiteWiseClient.ts b/clients/client-iotsitewise/IoTSiteWiseClient.ts index 16dcf5574d9c..ca6efddd21a7 100644 --- a/clients/client-iotsitewise/IoTSiteWiseClient.ts +++ b/clients/client-iotsitewise/IoTSiteWiseClient.ts @@ -143,6 +143,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -153,6 +154,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -320,11 +322,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -366,6 +363,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTSiteWiseClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -374,8 +377,8 @@ export type IoTSiteWiseClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTSiteWiseClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -383,8 +386,8 @@ export type IoTSiteWiseClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the AWS IoT SiteWise API Reference. AWS IoT SiteWise is an AWS service that connects Industrial Internet of Things (IIoT) devices to the power of the AWS Cloud. For more information, see the @@ -407,16 +410,16 @@ export class IoTSiteWiseClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iotsitewise/runtimeConfig.browser.ts b/clients/client-iotsitewise/runtimeConfig.browser.ts index ce1cfd4eb1a7..6cbdb8c98bca 100644 --- a/clients/client-iotsitewise/runtimeConfig.browser.ts +++ b/clients/client-iotsitewise/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iotsitewise/runtimeConfig.native.ts b/clients/client-iotsitewise/runtimeConfig.native.ts index 9a54d295a80e..4be83e5b6441 100644 --- a/clients/client-iotsitewise/runtimeConfig.native.ts +++ b/clients/client-iotsitewise/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTSiteWiseClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iotsitewise/runtimeConfig.ts b/clients/client-iotsitewise/runtimeConfig.ts index cfbdefac4625..6ffd6ace2c74 100644 --- a/clients/client-iotsitewise/runtimeConfig.ts +++ b/clients/client-iotsitewise/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-iotthingsgraph/IoTThingsGraphClient.ts b/clients/client-iotthingsgraph/IoTThingsGraphClient.ts index 03052b99ca83..8212b1671651 100644 --- a/clients/client-iotthingsgraph/IoTThingsGraphClient.ts +++ b/clients/client-iotthingsgraph/IoTThingsGraphClient.ts @@ -133,6 +133,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -143,6 +144,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -266,11 +268,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -312,6 +309,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IoTThingsGraphClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -320,8 +323,8 @@ export type IoTThingsGraphClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IoTThingsGraphClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -329,8 +332,8 @@ export type IoTThingsGraphClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS IoT Things Graph @@ -356,16 +359,16 @@ export class IoTThingsGraphClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-iotthingsgraph/runtimeConfig.browser.ts b/clients/client-iotthingsgraph/runtimeConfig.browser.ts index ab12a90c403d..159ad6ba04c0 100644 --- a/clients/client-iotthingsgraph/runtimeConfig.browser.ts +++ b/clients/client-iotthingsgraph/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-iotthingsgraph/runtimeConfig.native.ts b/clients/client-iotthingsgraph/runtimeConfig.native.ts index 07fb9211275f..245cc397926d 100644 --- a/clients/client-iotthingsgraph/runtimeConfig.native.ts +++ b/clients/client-iotthingsgraph/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IoTThingsGraphClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-iotthingsgraph/runtimeConfig.ts b/clients/client-iotthingsgraph/runtimeConfig.ts index 228ed6e4fd4b..1ef947bdc995 100644 --- a/clients/client-iotthingsgraph/runtimeConfig.ts +++ b/clients/client-iotthingsgraph/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ivs/IvsClient.ts b/clients/client-ivs/IvsClient.ts index 7e598fe25cb5..16a23b63c4dc 100644 --- a/clients/client-ivs/IvsClient.ts +++ b/clients/client-ivs/IvsClient.ts @@ -69,6 +69,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -79,6 +80,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -176,11 +178,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -222,6 +219,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type IvsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -230,8 +233,8 @@ export type IvsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type IvsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -239,8 +242,8 @@ export type IvsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -537,16 +540,16 @@ export class IvsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ivs/runtimeConfig.browser.ts b/clients/client-ivs/runtimeConfig.browser.ts index 7ab32ca29a68..a89f8e29d34b 100644 --- a/clients/client-ivs/runtimeConfig.browser.ts +++ b/clients/client-ivs/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ivs/runtimeConfig.native.ts b/clients/client-ivs/runtimeConfig.native.ts index a3ae4490de2d..4b1a6f4af45e 100644 --- a/clients/client-ivs/runtimeConfig.native.ts +++ b/clients/client-ivs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./IvsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ivs/runtimeConfig.ts b/clients/client-ivs/runtimeConfig.ts index 64682c169a78..0a12439b0934 100644 --- a/clients/client-ivs/runtimeConfig.ts +++ b/clients/client-ivs/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kafka/KafkaClient.ts b/clients/client-kafka/KafkaClient.ts index 29b639e20a70..c83e804a23af 100644 --- a/clients/client-kafka/KafkaClient.ts +++ b/clients/client-kafka/KafkaClient.ts @@ -112,6 +112,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -122,6 +123,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -233,11 +235,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -279,6 +276,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KafkaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -287,8 +290,8 @@ export type KafkaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KafkaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -296,8 +299,8 @@ export type KafkaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The operations for managing an Amazon MSK cluster.

@@ -319,16 +322,16 @@ export class KafkaClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kafka/runtimeConfig.browser.ts b/clients/client-kafka/runtimeConfig.browser.ts index 1cbf19108983..482bfddb2bc1 100644 --- a/clients/client-kafka/runtimeConfig.browser.ts +++ b/clients/client-kafka/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kafka/runtimeConfig.native.ts b/clients/client-kafka/runtimeConfig.native.ts index 68f1b5b25b89..d07a4bd8f655 100644 --- a/clients/client-kafka/runtimeConfig.native.ts +++ b/clients/client-kafka/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KafkaClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kafka/runtimeConfig.ts b/clients/client-kafka/runtimeConfig.ts index 98d4c018d4a4..5bbe2256b697 100644 --- a/clients/client-kafka/runtimeConfig.ts +++ b/clients/client-kafka/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kendra/KendraClient.ts b/clients/client-kendra/KendraClient.ts index 09128593a4c9..67758bcd349a 100644 --- a/clients/client-kendra/KendraClient.ts +++ b/clients/client-kendra/KendraClient.ts @@ -79,6 +79,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -89,6 +90,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -200,11 +202,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -246,6 +243,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KendraClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -254,8 +257,8 @@ export type KendraClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KendraClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -263,8 +266,8 @@ export type KendraClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Kendra is a service for indexing large document sets.

@@ -286,16 +289,16 @@ export class KendraClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kendra/runtimeConfig.browser.ts b/clients/client-kendra/runtimeConfig.browser.ts index 214af8a7d83e..5de465a4dc60 100644 --- a/clients/client-kendra/runtimeConfig.browser.ts +++ b/clients/client-kendra/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kendra/runtimeConfig.native.ts b/clients/client-kendra/runtimeConfig.native.ts index ac61356eb12e..755249dcd233 100644 --- a/clients/client-kendra/runtimeConfig.native.ts +++ b/clients/client-kendra/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KendraClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kendra/runtimeConfig.ts b/clients/client-kendra/runtimeConfig.ts index 599c639044b6..3b185671504a 100644 --- a/clients/client-kendra/runtimeConfig.ts +++ b/clients/client-kendra/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-analytics-v2/KinesisAnalyticsV2Client.ts b/clients/client-kinesis-analytics-v2/KinesisAnalyticsV2Client.ts index 0d02be0f19fc..93499168e79e 100644 --- a/clients/client-kinesis-analytics-v2/KinesisAnalyticsV2Client.ts +++ b/clients/client-kinesis-analytics-v2/KinesisAnalyticsV2Client.ts @@ -119,6 +119,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -129,6 +130,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -236,11 +238,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -282,6 +279,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KinesisAnalyticsV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -290,8 +293,8 @@ export type KinesisAnalyticsV2ClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisAnalyticsV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -299,8 +302,8 @@ export type KinesisAnalyticsV2ClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Kinesis Data Analytics is a fully managed service that you can use to process and analyze streaming data using Java, SQL, or Scala. The service @@ -324,16 +327,16 @@ export class KinesisAnalyticsV2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-analytics-v2/runtimeConfig.browser.ts b/clients/client-kinesis-analytics-v2/runtimeConfig.browser.ts index 937d32a94b37..20883a7973d8 100644 --- a/clients/client-kinesis-analytics-v2/runtimeConfig.browser.ts +++ b/clients/client-kinesis-analytics-v2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-analytics-v2/runtimeConfig.native.ts b/clients/client-kinesis-analytics-v2/runtimeConfig.native.ts index 606d5e3900cf..99b3f7a09ee3 100644 --- a/clients/client-kinesis-analytics-v2/runtimeConfig.native.ts +++ b/clients/client-kinesis-analytics-v2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisAnalyticsV2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-analytics-v2/runtimeConfig.ts b/clients/client-kinesis-analytics-v2/runtimeConfig.ts index 17a51ee82a49..7c9c33b7ab47 100644 --- a/clients/client-kinesis-analytics-v2/runtimeConfig.ts +++ b/clients/client-kinesis-analytics-v2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-analytics/KinesisAnalyticsClient.ts b/clients/client-kinesis-analytics/KinesisAnalyticsClient.ts index b111f393f2dc..db54ebd2f997 100644 --- a/clients/client-kinesis-analytics/KinesisAnalyticsClient.ts +++ b/clients/client-kinesis-analytics/KinesisAnalyticsClient.ts @@ -91,6 +91,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -101,6 +102,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -194,11 +196,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -240,6 +237,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KinesisAnalyticsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -248,8 +251,8 @@ export type KinesisAnalyticsClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisAnalyticsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -257,8 +260,8 @@ export type KinesisAnalyticsClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Kinesis Analytics @@ -289,16 +292,16 @@ export class KinesisAnalyticsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-analytics/runtimeConfig.browser.ts b/clients/client-kinesis-analytics/runtimeConfig.browser.ts index 659d88daaccf..5a4f7b637179 100644 --- a/clients/client-kinesis-analytics/runtimeConfig.browser.ts +++ b/clients/client-kinesis-analytics/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-analytics/runtimeConfig.native.ts b/clients/client-kinesis-analytics/runtimeConfig.native.ts index 0b4967f929ec..8e2002dedfb3 100644 --- a/clients/client-kinesis-analytics/runtimeConfig.native.ts +++ b/clients/client-kinesis-analytics/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisAnalyticsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-analytics/runtimeConfig.ts b/clients/client-kinesis-analytics/runtimeConfig.ts index f851dc8599a5..9a36a75e0f55 100644 --- a/clients/client-kinesis-analytics/runtimeConfig.ts +++ b/clients/client-kinesis-analytics/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-video-archived-media/KinesisVideoArchivedMediaClient.ts b/clients/client-kinesis-video-archived-media/KinesisVideoArchivedMediaClient.ts index c07c02ff7fef..ae93bc628c97 100644 --- a/clients/client-kinesis-video-archived-media/KinesisVideoArchivedMediaClient.ts +++ b/clients/client-kinesis-video-archived-media/KinesisVideoArchivedMediaClient.ts @@ -49,6 +49,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -59,6 +60,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -122,11 +124,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -168,6 +165,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KinesisVideoArchivedMediaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -176,8 +179,8 @@ export type KinesisVideoArchivedMediaClientConfig = Partial<__SmithyConfiguratio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisVideoArchivedMediaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -185,8 +188,8 @@ export type KinesisVideoArchivedMediaClientResolvedConfig = __SmithyResolvedConf EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -208,16 +211,16 @@ export class KinesisVideoArchivedMediaClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-video-archived-media/runtimeConfig.browser.ts b/clients/client-kinesis-video-archived-media/runtimeConfig.browser.ts index 03046c3eafa2..726ce434e9bc 100644 --- a/clients/client-kinesis-video-archived-media/runtimeConfig.browser.ts +++ b/clients/client-kinesis-video-archived-media/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-video-archived-media/runtimeConfig.native.ts b/clients/client-kinesis-video-archived-media/runtimeConfig.native.ts index 35aab72b2651..a989d29c4357 100644 --- a/clients/client-kinesis-video-archived-media/runtimeConfig.native.ts +++ b/clients/client-kinesis-video-archived-media/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisVideoArchivedMediaClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-video-archived-media/runtimeConfig.ts b/clients/client-kinesis-video-archived-media/runtimeConfig.ts index e04c61531cd7..5f54109f79d4 100644 --- a/clients/client-kinesis-video-archived-media/runtimeConfig.ts +++ b/clients/client-kinesis-video-archived-media/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-video-media/KinesisVideoMediaClient.ts b/clients/client-kinesis-video-media/KinesisVideoMediaClient.ts index 5e37683b2608..50e44ade120e 100644 --- a/clients/client-kinesis-video-media/KinesisVideoMediaClient.ts +++ b/clients/client-kinesis-video-media/KinesisVideoMediaClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetMediaCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KinesisVideoMediaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +156,8 @@ export type KinesisVideoMediaClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisVideoMediaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +165,8 @@ export type KinesisVideoMediaClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -185,16 +188,16 @@ export class KinesisVideoMediaClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-video-media/runtimeConfig.browser.ts b/clients/client-kinesis-video-media/runtimeConfig.browser.ts index c3f79ca4d69b..dc4e45085385 100644 --- a/clients/client-kinesis-video-media/runtimeConfig.browser.ts +++ b/clients/client-kinesis-video-media/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-video-media/runtimeConfig.native.ts b/clients/client-kinesis-video-media/runtimeConfig.native.ts index 6d03ff5513a6..d96c0cda321b 100644 --- a/clients/client-kinesis-video-media/runtimeConfig.native.ts +++ b/clients/client-kinesis-video-media/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisVideoMediaClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-video-media/runtimeConfig.ts b/clients/client-kinesis-video-media/runtimeConfig.ts index 7c6e92295fae..f99959ebf39f 100644 --- a/clients/client-kinesis-video-media/runtimeConfig.ts +++ b/clients/client-kinesis-video-media/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-video-signaling/KinesisVideoSignalingClient.ts b/clients/client-kinesis-video-signaling/KinesisVideoSignalingClient.ts index 4c73a9b7a3f7..a7ceba404a3f 100644 --- a/clients/client-kinesis-video-signaling/KinesisVideoSignalingClient.ts +++ b/clients/client-kinesis-video-signaling/KinesisVideoSignalingClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetIceServerConfigCommandInput | SendAlexaOfferToMasterCommandInput; @@ -103,11 +105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -149,6 +146,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KinesisVideoSignalingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -157,8 +160,8 @@ export type KinesisVideoSignalingClientConfig = Partial<__SmithyConfiguration<__ EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisVideoSignalingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -166,8 +169,8 @@ export type KinesisVideoSignalingClientResolvedConfig = __SmithyResolvedConfigur EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Kinesis Video Streams Signaling Service is a intermediate service that establishes a @@ -191,16 +194,16 @@ export class KinesisVideoSignalingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-video-signaling/runtimeConfig.browser.ts b/clients/client-kinesis-video-signaling/runtimeConfig.browser.ts index cc758db8a392..b8a4a05b10bb 100644 --- a/clients/client-kinesis-video-signaling/runtimeConfig.browser.ts +++ b/clients/client-kinesis-video-signaling/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-video-signaling/runtimeConfig.native.ts b/clients/client-kinesis-video-signaling/runtimeConfig.native.ts index 937f52f01ab1..cad8c52fe0a2 100644 --- a/clients/client-kinesis-video-signaling/runtimeConfig.native.ts +++ b/clients/client-kinesis-video-signaling/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisVideoSignalingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-video-signaling/runtimeConfig.ts b/clients/client-kinesis-video-signaling/runtimeConfig.ts index 1e2930df1e8c..41f2b8d1653a 100644 --- a/clients/client-kinesis-video-signaling/runtimeConfig.ts +++ b/clients/client-kinesis-video-signaling/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis-video/KinesisVideoClient.ts b/clients/client-kinesis-video/KinesisVideoClient.ts index 95abff7b5774..201ea2ce307d 100644 --- a/clients/client-kinesis-video/KinesisVideoClient.ts +++ b/clients/client-kinesis-video/KinesisVideoClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -179,11 +181,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -225,6 +222,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KinesisVideoClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -233,8 +236,8 @@ export type KinesisVideoClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KinesisVideoClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -242,8 +245,8 @@ export type KinesisVideoClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -265,16 +268,16 @@ export class KinesisVideoClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis-video/runtimeConfig.browser.ts b/clients/client-kinesis-video/runtimeConfig.browser.ts index a0515622f4c1..b4f7f5823785 100644 --- a/clients/client-kinesis-video/runtimeConfig.browser.ts +++ b/clients/client-kinesis-video/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kinesis-video/runtimeConfig.native.ts b/clients/client-kinesis-video/runtimeConfig.native.ts index fe63b5e9b234..111673a8627f 100644 --- a/clients/client-kinesis-video/runtimeConfig.native.ts +++ b/clients/client-kinesis-video/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisVideoClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis-video/runtimeConfig.ts b/clients/client-kinesis-video/runtimeConfig.ts index 21787e7efa9e..675f608c296f 100644 --- a/clients/client-kinesis-video/runtimeConfig.ts +++ b/clients/client-kinesis-video/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-kinesis/KinesisClient.ts b/clients/client-kinesis/KinesisClient.ts index 29fc04810df9..5ab9ac7c0d73 100644 --- a/clients/client-kinesis/KinesisClient.ts +++ b/clients/client-kinesis/KinesisClient.ts @@ -104,6 +104,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -115,6 +116,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -224,11 +226,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -271,6 +268,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ regionInfoProvider?: RegionInfoProvider; + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + /** * The function that provides necessary utilities for generating and parsing event stream */ @@ -283,8 +286,8 @@ export type KinesisClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & HostHeaderInputConfig & + UserAgentInputConfig & EventStreamSerdeInputConfig; export type KinesisClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & @@ -293,8 +296,8 @@ export type KinesisClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & HostHeaderResolvedConfig & + UserAgentResolvedConfig & EventStreamSerdeResolvedConfig; /** @@ -319,17 +322,17 @@ export class KinesisClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); let _config_7 = resolveEventStreamSerdeConfig(_config_6); super(_config_7); this.config = _config_7; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kinesis/runtimeConfig.browser.ts b/clients/client-kinesis/runtimeConfig.browser.ts index 1eaaa5072663..9e50610795c8 100644 --- a/clients/client-kinesis/runtimeConfig.browser.ts +++ b/clients/client-kinesis/runtimeConfig.browser.ts @@ -23,7 +23,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), eventStreamSerdeProvider, maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, diff --git a/clients/client-kinesis/runtimeConfig.native.ts b/clients/client-kinesis/runtimeConfig.native.ts index 2680f5dc28e3..6db24364702c 100644 --- a/clients/client-kinesis/runtimeConfig.native.ts +++ b/clients/client-kinesis/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KinesisClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kinesis/runtimeConfig.ts b/clients/client-kinesis/runtimeConfig.ts index f08804e57ff8..918ea23b8e79 100644 --- a/clients/client-kinesis/runtimeConfig.ts +++ b/clients/client-kinesis/runtimeConfig.ts @@ -25,7 +25,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), eventStreamSerdeProvider, maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), diff --git a/clients/client-kms/KMSClient.ts b/clients/client-kms/KMSClient.ts index 4b60eeb36738..57795aaf6144 100644 --- a/clients/client-kms/KMSClient.ts +++ b/clients/client-kms/KMSClient.ts @@ -126,6 +126,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -136,6 +137,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -281,11 +283,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -327,6 +324,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type KMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -335,8 +338,8 @@ export type KMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type KMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -344,8 +347,8 @@ export type KMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Key Management Service @@ -455,16 +458,16 @@ export class KMSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-kms/runtimeConfig.browser.ts b/clients/client-kms/runtimeConfig.browser.ts index 6a2f63e13ccd..e405ffcb16b9 100644 --- a/clients/client-kms/runtimeConfig.browser.ts +++ b/clients/client-kms/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-kms/runtimeConfig.native.ts b/clients/client-kms/runtimeConfig.native.ts index f589702c79b6..9f37a196e9a6 100644 --- a/clients/client-kms/runtimeConfig.native.ts +++ b/clients/client-kms/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./KMSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-kms/runtimeConfig.ts b/clients/client-kms/runtimeConfig.ts index fa965e1a8bd2..2d2f1327c837 100644 --- a/clients/client-kms/runtimeConfig.ts +++ b/clients/client-kms/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lakeformation/LakeFormationClient.ts b/clients/client-lakeformation/LakeFormationClient.ts index bbfb99b62bda..52d496dcaff7 100644 --- a/clients/client-lakeformation/LakeFormationClient.ts +++ b/clients/client-lakeformation/LakeFormationClient.ts @@ -63,6 +63,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -73,6 +74,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -152,11 +154,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -198,6 +195,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type LakeFormationClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -206,8 +209,8 @@ export type LakeFormationClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LakeFormationClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -215,8 +218,8 @@ export type LakeFormationClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Lake Formation @@ -239,16 +242,16 @@ export class LakeFormationClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lakeformation/runtimeConfig.browser.ts b/clients/client-lakeformation/runtimeConfig.browser.ts index c3f4c7865c5e..544afdc81a0b 100644 --- a/clients/client-lakeformation/runtimeConfig.browser.ts +++ b/clients/client-lakeformation/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lakeformation/runtimeConfig.native.ts b/clients/client-lakeformation/runtimeConfig.native.ts index 0dbe680ce5b4..cc112c366196 100644 --- a/clients/client-lakeformation/runtimeConfig.native.ts +++ b/clients/client-lakeformation/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LakeFormationClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lakeformation/runtimeConfig.ts b/clients/client-lakeformation/runtimeConfig.ts index dc67071f583d..28f26047522d 100644 --- a/clients/client-lakeformation/runtimeConfig.ts +++ b/clients/client-lakeformation/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lambda/LambdaClient.ts b/clients/client-lambda/LambdaClient.ts index fc4be790bc28..7cd72f36b54e 100644 --- a/clients/client-lambda/LambdaClient.ts +++ b/clients/client-lambda/LambdaClient.ts @@ -195,6 +195,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -205,6 +206,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -374,11 +376,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -420,6 +417,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type LambdaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -428,8 +431,8 @@ export type LambdaClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LambdaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -437,8 +440,8 @@ export type LambdaClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Lambda @@ -466,16 +469,16 @@ export class LambdaClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lambda/runtimeConfig.browser.ts b/clients/client-lambda/runtimeConfig.browser.ts index bc489aa675a8..6eb4f52d4894 100644 --- a/clients/client-lambda/runtimeConfig.browser.ts +++ b/clients/client-lambda/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lambda/runtimeConfig.native.ts b/clients/client-lambda/runtimeConfig.native.ts index 95427ba54a60..294305bfb6eb 100644 --- a/clients/client-lambda/runtimeConfig.native.ts +++ b/clients/client-lambda/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LambdaClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lambda/runtimeConfig.ts b/clients/client-lambda/runtimeConfig.ts index 57812c2d25f8..df5a968474ea 100644 --- a/clients/client-lambda/runtimeConfig.ts +++ b/clients/client-lambda/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lex-model-building-service/LexModelBuildingServiceClient.ts b/clients/client-lex-model-building-service/LexModelBuildingServiceClient.ts index c9a278b45a5f..55b5c263c964 100644 --- a/clients/client-lex-model-building-service/LexModelBuildingServiceClient.ts +++ b/clients/client-lex-model-building-service/LexModelBuildingServiceClient.ts @@ -104,6 +104,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -114,6 +115,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -245,11 +247,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -291,6 +288,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type LexModelBuildingServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -299,8 +302,8 @@ export type LexModelBuildingServiceClientConfig = Partial<__SmithyConfiguration< EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LexModelBuildingServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -308,8 +311,8 @@ export type LexModelBuildingServiceClientResolvedConfig = __SmithyResolvedConfig EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Lex Build-Time Actions @@ -334,16 +337,16 @@ export class LexModelBuildingServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lex-model-building-service/runtimeConfig.browser.ts b/clients/client-lex-model-building-service/runtimeConfig.browser.ts index 7bff2a013b34..28692dc4c13b 100644 --- a/clients/client-lex-model-building-service/runtimeConfig.browser.ts +++ b/clients/client-lex-model-building-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lex-model-building-service/runtimeConfig.native.ts b/clients/client-lex-model-building-service/runtimeConfig.native.ts index efae1a69a053..f972a1b1781e 100644 --- a/clients/client-lex-model-building-service/runtimeConfig.native.ts +++ b/clients/client-lex-model-building-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LexModelBuildingServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lex-model-building-service/runtimeConfig.ts b/clients/client-lex-model-building-service/runtimeConfig.ts index c06f2589364a..8b7e4273e607 100644 --- a/clients/client-lex-model-building-service/runtimeConfig.ts +++ b/clients/client-lex-model-building-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lex-runtime-service/LexRuntimeServiceClient.ts b/clients/client-lex-runtime-service/LexRuntimeServiceClient.ts index 30c574f902e8..1e4465fcc45c 100644 --- a/clients/client-lex-runtime-service/LexRuntimeServiceClient.ts +++ b/clients/client-lex-runtime-service/LexRuntimeServiceClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -113,11 +115,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -159,6 +156,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type LexRuntimeServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -167,8 +170,8 @@ export type LexRuntimeServiceClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LexRuntimeServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -176,8 +179,8 @@ export type LexRuntimeServiceClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Lex provides both build and runtime endpoints. Each endpoint provides a set of @@ -207,16 +210,16 @@ export class LexRuntimeServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lex-runtime-service/runtimeConfig.browser.ts b/clients/client-lex-runtime-service/runtimeConfig.browser.ts index 3fee6e138d0f..372e780aedeb 100644 --- a/clients/client-lex-runtime-service/runtimeConfig.browser.ts +++ b/clients/client-lex-runtime-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lex-runtime-service/runtimeConfig.native.ts b/clients/client-lex-runtime-service/runtimeConfig.native.ts index 3d97604d2104..2dafe4e39ae0 100644 --- a/clients/client-lex-runtime-service/runtimeConfig.native.ts +++ b/clients/client-lex-runtime-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LexRuntimeServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lex-runtime-service/runtimeConfig.ts b/clients/client-lex-runtime-service/runtimeConfig.ts index 0a67dee71d61..934d12d5411e 100644 --- a/clients/client-lex-runtime-service/runtimeConfig.ts +++ b/clients/client-lex-runtime-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-license-manager/LicenseManagerClient.ts b/clients/client-license-manager/LicenseManagerClient.ts index c189a024dcf1..61d712254b75 100644 --- a/clients/client-license-manager/LicenseManagerClient.ts +++ b/clients/client-license-manager/LicenseManagerClient.ts @@ -132,6 +132,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -142,6 +143,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -275,11 +277,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -321,6 +318,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type LicenseManagerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -329,8 +332,8 @@ export type LicenseManagerClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LicenseManagerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -338,8 +341,8 @@ export type LicenseManagerClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS License Manager @@ -363,16 +366,16 @@ export class LicenseManagerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-license-manager/runtimeConfig.browser.ts b/clients/client-license-manager/runtimeConfig.browser.ts index a84c699effda..900ebefbe423 100644 --- a/clients/client-license-manager/runtimeConfig.browser.ts +++ b/clients/client-license-manager/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-license-manager/runtimeConfig.native.ts b/clients/client-license-manager/runtimeConfig.native.ts index f2d40a146319..40aba5fecaee 100644 --- a/clients/client-license-manager/runtimeConfig.native.ts +++ b/clients/client-license-manager/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LicenseManagerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-license-manager/runtimeConfig.ts b/clients/client-license-manager/runtimeConfig.ts index e0698a2e9427..4af0572dd20d 100644 --- a/clients/client-license-manager/runtimeConfig.ts +++ b/clients/client-license-manager/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lightsail/LightsailClient.ts b/clients/client-lightsail/LightsailClient.ts index 69549b4294e0..24d603c3d1f2 100644 --- a/clients/client-lightsail/LightsailClient.ts +++ b/clients/client-lightsail/LightsailClient.ts @@ -386,6 +386,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -396,6 +397,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -731,11 +733,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -777,6 +774,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type LightsailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -785,8 +788,8 @@ export type LightsailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LightsailClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -794,8 +797,8 @@ export type LightsailClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Lightsail is the easiest way to get started with Amazon Web Services (AWS) for developers @@ -831,16 +834,16 @@ export class LightsailClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lightsail/runtimeConfig.browser.ts b/clients/client-lightsail/runtimeConfig.browser.ts index 0ac4cd8d625d..58ebf455d018 100644 --- a/clients/client-lightsail/runtimeConfig.browser.ts +++ b/clients/client-lightsail/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lightsail/runtimeConfig.native.ts b/clients/client-lightsail/runtimeConfig.native.ts index 5868249ab557..591ab77bd51d 100644 --- a/clients/client-lightsail/runtimeConfig.native.ts +++ b/clients/client-lightsail/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LightsailClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lightsail/runtimeConfig.ts b/clients/client-lightsail/runtimeConfig.ts index fec6ffebc3c9..48f8022b21db 100644 --- a/clients/client-lightsail/runtimeConfig.ts +++ b/clients/client-lightsail/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-lookoutvision/LookoutVisionClient.ts b/clients/client-lookoutvision/LookoutVisionClient.ts index f26001f1d048..4e51c47f4a25 100644 --- a/clients/client-lookoutvision/LookoutVisionClient.ts +++ b/clients/client-lookoutvision/LookoutVisionClient.ts @@ -54,6 +54,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -64,6 +65,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -149,11 +151,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -195,6 +192,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type LookoutVisionClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -203,8 +206,8 @@ export type LookoutVisionClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type LookoutVisionClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -212,8 +215,8 @@ export type LookoutVisionClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This is the Amazon Lookout for Vision API Reference. It provides descriptions of actions, @@ -241,16 +244,16 @@ export class LookoutVisionClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-lookoutvision/runtimeConfig.browser.ts b/clients/client-lookoutvision/runtimeConfig.browser.ts index 174f22a943bb..398dcae421f1 100644 --- a/clients/client-lookoutvision/runtimeConfig.browser.ts +++ b/clients/client-lookoutvision/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-lookoutvision/runtimeConfig.native.ts b/clients/client-lookoutvision/runtimeConfig.native.ts index 9c425471e054..dbd3e5d33f27 100644 --- a/clients/client-lookoutvision/runtimeConfig.native.ts +++ b/clients/client-lookoutvision/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./LookoutVisionClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-lookoutvision/runtimeConfig.ts b/clients/client-lookoutvision/runtimeConfig.ts index 9ebb374218c6..485b5ab26e06 100644 --- a/clients/client-lookoutvision/runtimeConfig.ts +++ b/clients/client-lookoutvision/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-machine-learning/MachineLearningClient.ts b/clients/client-machine-learning/MachineLearningClient.ts index 27d5872e39fd..ca5dc922954e 100644 --- a/clients/client-machine-learning/MachineLearningClient.ts +++ b/clients/client-machine-learning/MachineLearningClient.ts @@ -96,6 +96,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -106,6 +107,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -215,11 +217,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -261,6 +258,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MachineLearningClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -269,8 +272,8 @@ export type MachineLearningClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MachineLearningClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -278,8 +281,8 @@ export type MachineLearningClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Definition of the public APIs @@ -302,16 +305,16 @@ export class MachineLearningClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-machine-learning/runtimeConfig.browser.ts b/clients/client-machine-learning/runtimeConfig.browser.ts index 1658535d8132..fe9066f189ed 100644 --- a/clients/client-machine-learning/runtimeConfig.browser.ts +++ b/clients/client-machine-learning/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-machine-learning/runtimeConfig.native.ts b/clients/client-machine-learning/runtimeConfig.native.ts index 6f46fd040c75..b84819bb1280 100644 --- a/clients/client-machine-learning/runtimeConfig.native.ts +++ b/clients/client-machine-learning/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MachineLearningClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-machine-learning/runtimeConfig.ts b/clients/client-machine-learning/runtimeConfig.ts index 04050d943d6c..f1f1ad56bf86 100644 --- a/clients/client-machine-learning/runtimeConfig.ts +++ b/clients/client-machine-learning/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-macie/MacieClient.ts b/clients/client-macie/MacieClient.ts index e4f88b336e2f..6cce2fac315f 100644 --- a/clients/client-macie/MacieClient.ts +++ b/clients/client-macie/MacieClient.ts @@ -54,6 +54,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -64,6 +65,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -131,11 +133,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -177,6 +174,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MacieClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -185,8 +188,8 @@ export type MacieClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MacieClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -194,8 +197,8 @@ export type MacieClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Macie Classic @@ -227,16 +230,16 @@ export class MacieClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-macie/runtimeConfig.browser.ts b/clients/client-macie/runtimeConfig.browser.ts index a6a89f18a7bd..feabe5319b68 100644 --- a/clients/client-macie/runtimeConfig.browser.ts +++ b/clients/client-macie/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-macie/runtimeConfig.native.ts b/clients/client-macie/runtimeConfig.native.ts index 7177195219a5..8af081227fcb 100644 --- a/clients/client-macie/runtimeConfig.native.ts +++ b/clients/client-macie/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MacieClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-macie/runtimeConfig.ts b/clients/client-macie/runtimeConfig.ts index 54ae38186ed7..314b5cda946c 100644 --- a/clients/client-macie/runtimeConfig.ts +++ b/clients/client-macie/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-macie2/Macie2Client.ts b/clients/client-macie2/Macie2Client.ts index 819416067d5a..296663805024 100644 --- a/clients/client-macie2/Macie2Client.ts +++ b/clients/client-macie2/Macie2Client.ts @@ -170,6 +170,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -180,6 +181,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -335,11 +337,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -381,6 +378,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type Macie2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -389,8 +392,8 @@ export type Macie2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type Macie2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -398,8 +401,8 @@ export type Macie2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Macie is a fully managed data security and data privacy service that uses machine learning and pattern matching to discover and protect your sensitive data in AWS. Macie automates the discovery of sensitive data, such as PII and intellectual property, to provide you with insight into the data that your organization stores in AWS. Macie also provides an inventory of your Amazon S3 buckets, which it continually monitors for you. If Macie detects sensitive data or potential data access issues, it generates detailed findings for you to review and act upon as necessary.

@@ -421,16 +424,16 @@ export class Macie2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-macie2/runtimeConfig.browser.ts b/clients/client-macie2/runtimeConfig.browser.ts index a44591556115..781ab5aa9361 100644 --- a/clients/client-macie2/runtimeConfig.browser.ts +++ b/clients/client-macie2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-macie2/runtimeConfig.native.ts b/clients/client-macie2/runtimeConfig.native.ts index c947e3b96a93..56aa2e97b888 100644 --- a/clients/client-macie2/runtimeConfig.native.ts +++ b/clients/client-macie2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./Macie2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-macie2/runtimeConfig.ts b/clients/client-macie2/runtimeConfig.ts index 372f10f8bbf1..288773103701 100644 --- a/clients/client-macie2/runtimeConfig.ts +++ b/clients/client-macie2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-managedblockchain/ManagedBlockchainClient.ts b/clients/client-managedblockchain/ManagedBlockchainClient.ts index 29c08b1a2a6b..95791b0d5018 100644 --- a/clients/client-managedblockchain/ManagedBlockchainClient.ts +++ b/clients/client-managedblockchain/ManagedBlockchainClient.ts @@ -55,6 +55,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -65,6 +66,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -158,11 +160,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -204,6 +201,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ManagedBlockchainClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -212,8 +215,8 @@ export type ManagedBlockchainClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ManagedBlockchainClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -221,8 +224,8 @@ export type ManagedBlockchainClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -245,16 +248,16 @@ export class ManagedBlockchainClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-managedblockchain/runtimeConfig.browser.ts b/clients/client-managedblockchain/runtimeConfig.browser.ts index 0abd1eda0787..252b912df3f5 100644 --- a/clients/client-managedblockchain/runtimeConfig.browser.ts +++ b/clients/client-managedblockchain/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-managedblockchain/runtimeConfig.native.ts b/clients/client-managedblockchain/runtimeConfig.native.ts index 958e3de5d484..faeead11e077 100644 --- a/clients/client-managedblockchain/runtimeConfig.native.ts +++ b/clients/client-managedblockchain/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ManagedBlockchainClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-managedblockchain/runtimeConfig.ts b/clients/client-managedblockchain/runtimeConfig.ts index 6be200e1d018..36dbcb9871cb 100644 --- a/clients/client-managedblockchain/runtimeConfig.ts +++ b/clients/client-managedblockchain/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-marketplace-catalog/MarketplaceCatalogClient.ts b/clients/client-marketplace-catalog/MarketplaceCatalogClient.ts index da3780b62cae..20665f2ea8eb 100644 --- a/clients/client-marketplace-catalog/MarketplaceCatalogClient.ts +++ b/clients/client-marketplace-catalog/MarketplaceCatalogClient.ts @@ -41,6 +41,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -51,6 +52,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -116,11 +118,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -162,6 +159,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MarketplaceCatalogClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -170,8 +173,8 @@ export type MarketplaceCatalogClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MarketplaceCatalogClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -179,8 +182,8 @@ export type MarketplaceCatalogClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Catalog API actions allow you to manage your entities through list, describe, and update @@ -208,16 +211,16 @@ export class MarketplaceCatalogClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-marketplace-catalog/runtimeConfig.browser.ts b/clients/client-marketplace-catalog/runtimeConfig.browser.ts index 24faccf6ed40..7d950c823a99 100644 --- a/clients/client-marketplace-catalog/runtimeConfig.browser.ts +++ b/clients/client-marketplace-catalog/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-marketplace-catalog/runtimeConfig.native.ts b/clients/client-marketplace-catalog/runtimeConfig.native.ts index db977ea40f23..e2dfdfb7bd7c 100644 --- a/clients/client-marketplace-catalog/runtimeConfig.native.ts +++ b/clients/client-marketplace-catalog/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MarketplaceCatalogClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-marketplace-catalog/runtimeConfig.ts b/clients/client-marketplace-catalog/runtimeConfig.ts index b04154ca820e..21e9f856e862 100644 --- a/clients/client-marketplace-catalog/runtimeConfig.ts +++ b/clients/client-marketplace-catalog/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-marketplace-commerce-analytics/MarketplaceCommerceAnalyticsClient.ts b/clients/client-marketplace-commerce-analytics/MarketplaceCommerceAnalyticsClient.ts index d51affc18445..ca166809d1ac 100644 --- a/clients/client-marketplace-commerce-analytics/MarketplaceCommerceAnalyticsClient.ts +++ b/clients/client-marketplace-commerce-analytics/MarketplaceCommerceAnalyticsClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GenerateDataSetCommandInput | StartSupportDataExportCommandInput; @@ -103,11 +105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -149,6 +146,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MarketplaceCommerceAnalyticsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -157,8 +160,8 @@ export type MarketplaceCommerceAnalyticsClientConfig = Partial<__SmithyConfigura EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MarketplaceCommerceAnalyticsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -166,8 +169,8 @@ export type MarketplaceCommerceAnalyticsClientResolvedConfig = __SmithyResolvedC EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Provides AWS Marketplace business intelligence data on-demand. @@ -189,16 +192,16 @@ export class MarketplaceCommerceAnalyticsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-marketplace-commerce-analytics/runtimeConfig.browser.ts b/clients/client-marketplace-commerce-analytics/runtimeConfig.browser.ts index 38c169205c46..4aa94f6bfe7d 100644 --- a/clients/client-marketplace-commerce-analytics/runtimeConfig.browser.ts +++ b/clients/client-marketplace-commerce-analytics/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-marketplace-commerce-analytics/runtimeConfig.native.ts b/clients/client-marketplace-commerce-analytics/runtimeConfig.native.ts index 5521199facf3..1ff4198d6d66 100644 --- a/clients/client-marketplace-commerce-analytics/runtimeConfig.native.ts +++ b/clients/client-marketplace-commerce-analytics/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MarketplaceCommerceAnalyticsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-marketplace-commerce-analytics/runtimeConfig.ts b/clients/client-marketplace-commerce-analytics/runtimeConfig.ts index b53b4bb6ccd7..2441510ef22c 100644 --- a/clients/client-marketplace-commerce-analytics/runtimeConfig.ts +++ b/clients/client-marketplace-commerce-analytics/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-marketplace-entitlement-service/MarketplaceEntitlementServiceClient.ts b/clients/client-marketplace-entitlement-service/MarketplaceEntitlementServiceClient.ts index a6bc0c100f77..d6cc3b717996 100644 --- a/clients/client-marketplace-entitlement-service/MarketplaceEntitlementServiceClient.ts +++ b/clients/client-marketplace-entitlement-service/MarketplaceEntitlementServiceClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetEntitlementsCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MarketplaceEntitlementServiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +156,8 @@ export type MarketplaceEntitlementServiceClientConfig = Partial<__SmithyConfigur EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MarketplaceEntitlementServiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +165,8 @@ export type MarketplaceEntitlementServiceClientResolvedConfig = __SmithyResolved EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Marketplace Entitlement Service @@ -201,16 +204,16 @@ export class MarketplaceEntitlementServiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-marketplace-entitlement-service/runtimeConfig.browser.ts b/clients/client-marketplace-entitlement-service/runtimeConfig.browser.ts index 78333b72fbff..1c7f94b781e2 100644 --- a/clients/client-marketplace-entitlement-service/runtimeConfig.browser.ts +++ b/clients/client-marketplace-entitlement-service/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-marketplace-entitlement-service/runtimeConfig.native.ts b/clients/client-marketplace-entitlement-service/runtimeConfig.native.ts index cf94a1d6e5a4..9a05824b6595 100644 --- a/clients/client-marketplace-entitlement-service/runtimeConfig.native.ts +++ b/clients/client-marketplace-entitlement-service/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MarketplaceEntitlementServiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-marketplace-entitlement-service/runtimeConfig.ts b/clients/client-marketplace-entitlement-service/runtimeConfig.ts index 9cea2f8517be..7ab8df905576 100644 --- a/clients/client-marketplace-entitlement-service/runtimeConfig.ts +++ b/clients/client-marketplace-entitlement-service/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-marketplace-metering/MarketplaceMeteringClient.ts b/clients/client-marketplace-metering/MarketplaceMeteringClient.ts index 86597ebe23e7..e34dc8adade7 100644 --- a/clients/client-marketplace-metering/MarketplaceMeteringClient.ts +++ b/clients/client-marketplace-metering/MarketplaceMeteringClient.ts @@ -39,6 +39,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -49,6 +50,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -110,11 +112,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -156,6 +153,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MarketplaceMeteringClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -164,8 +167,8 @@ export type MarketplaceMeteringClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MarketplaceMeteringClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -173,8 +176,8 @@ export type MarketplaceMeteringClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Marketplace Metering Service @@ -252,16 +255,16 @@ export class MarketplaceMeteringClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-marketplace-metering/runtimeConfig.browser.ts b/clients/client-marketplace-metering/runtimeConfig.browser.ts index c41c5e38106a..05926f90a756 100644 --- a/clients/client-marketplace-metering/runtimeConfig.browser.ts +++ b/clients/client-marketplace-metering/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-marketplace-metering/runtimeConfig.native.ts b/clients/client-marketplace-metering/runtimeConfig.native.ts index e42dc36ff62f..822a898b4f80 100644 --- a/clients/client-marketplace-metering/runtimeConfig.native.ts +++ b/clients/client-marketplace-metering/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MarketplaceMeteringClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-marketplace-metering/runtimeConfig.ts b/clients/client-marketplace-metering/runtimeConfig.ts index 88c43d3d14a2..f99392ef440a 100644 --- a/clients/client-marketplace-metering/runtimeConfig.ts +++ b/clients/client-marketplace-metering/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediaconnect/MediaConnectClient.ts b/clients/client-mediaconnect/MediaConnectClient.ts index 557df93d6ae9..5cfa7cf351c9 100644 --- a/clients/client-mediaconnect/MediaConnectClient.ts +++ b/clients/client-mediaconnect/MediaConnectClient.ts @@ -83,6 +83,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -93,6 +94,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -200,11 +202,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -246,6 +243,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MediaConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -254,8 +257,8 @@ export type MediaConnectClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaConnectClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -263,8 +266,8 @@ export type MediaConnectClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * API for AWS Elemental MediaConnect @@ -286,16 +289,16 @@ export class MediaConnectClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediaconnect/runtimeConfig.browser.ts b/clients/client-mediaconnect/runtimeConfig.browser.ts index a7f8aa623d14..c4e5bca28f5e 100644 --- a/clients/client-mediaconnect/runtimeConfig.browser.ts +++ b/clients/client-mediaconnect/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediaconnect/runtimeConfig.native.ts b/clients/client-mediaconnect/runtimeConfig.native.ts index 5d0e362bb3e9..65480d3e2865 100644 --- a/clients/client-mediaconnect/runtimeConfig.native.ts +++ b/clients/client-mediaconnect/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaConnectClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediaconnect/runtimeConfig.ts b/clients/client-mediaconnect/runtimeConfig.ts index 50ee9f024cd2..5078e3a32a8f 100644 --- a/clients/client-mediaconnect/runtimeConfig.ts +++ b/clients/client-mediaconnect/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediaconvert/MediaConvertClient.ts b/clients/client-mediaconvert/MediaConvertClient.ts index 65e408b3b5fe..7b55a3d90452 100644 --- a/clients/client-mediaconvert/MediaConvertClient.ts +++ b/clients/client-mediaconvert/MediaConvertClient.ts @@ -69,6 +69,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -79,6 +80,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -182,11 +184,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -228,6 +225,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MediaConvertClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -236,8 +239,8 @@ export type MediaConvertClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaConvertClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -245,8 +248,8 @@ export type MediaConvertClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Elemental MediaConvert @@ -268,16 +271,16 @@ export class MediaConvertClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediaconvert/runtimeConfig.browser.ts b/clients/client-mediaconvert/runtimeConfig.browser.ts index b431a5e74268..0fce6306bee4 100644 --- a/clients/client-mediaconvert/runtimeConfig.browser.ts +++ b/clients/client-mediaconvert/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediaconvert/runtimeConfig.native.ts b/clients/client-mediaconvert/runtimeConfig.native.ts index 9f886f7722f6..384cb42f0b1d 100644 --- a/clients/client-mediaconvert/runtimeConfig.native.ts +++ b/clients/client-mediaconvert/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaConvertClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediaconvert/runtimeConfig.ts b/clients/client-mediaconvert/runtimeConfig.ts index c51e53d7ae3f..b613a8a25a88 100644 --- a/clients/client-mediaconvert/runtimeConfig.ts +++ b/clients/client-mediaconvert/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-medialive/MediaLiveClient.ts b/clients/client-medialive/MediaLiveClient.ts index 3017f0f00fc8..dc5bdf8f2631 100644 --- a/clients/client-medialive/MediaLiveClient.ts +++ b/clients/client-medialive/MediaLiveClient.ts @@ -150,6 +150,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -160,6 +161,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -323,11 +325,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -369,6 +366,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MediaLiveClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -377,8 +380,8 @@ export type MediaLiveClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaLiveClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -386,8 +389,8 @@ export type MediaLiveClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * API for AWS Elemental MediaLive @@ -409,16 +412,16 @@ export class MediaLiveClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-medialive/runtimeConfig.browser.ts b/clients/client-medialive/runtimeConfig.browser.ts index c806ed837fda..a9ef851ef24d 100644 --- a/clients/client-medialive/runtimeConfig.browser.ts +++ b/clients/client-medialive/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-medialive/runtimeConfig.native.ts b/clients/client-medialive/runtimeConfig.native.ts index 978431e867c8..1c811ff93104 100644 --- a/clients/client-medialive/runtimeConfig.native.ts +++ b/clients/client-medialive/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaLiveClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-medialive/runtimeConfig.ts b/clients/client-medialive/runtimeConfig.ts index b395e847f656..bb43c1f54091 100644 --- a/clients/client-medialive/runtimeConfig.ts +++ b/clients/client-medialive/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediapackage-vod/MediaPackageVodClient.ts b/clients/client-mediapackage-vod/MediaPackageVodClient.ts index 24a4c9f5084c..7da2a98f9648 100644 --- a/clients/client-mediapackage-vod/MediaPackageVodClient.ts +++ b/clients/client-mediapackage-vod/MediaPackageVodClient.ts @@ -81,6 +81,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -91,6 +92,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -176,11 +178,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -222,6 +219,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MediaPackageVodClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -230,8 +233,8 @@ export type MediaPackageVodClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaPackageVodClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -239,8 +242,8 @@ export type MediaPackageVodClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Elemental MediaPackage VOD @@ -262,16 +265,16 @@ export class MediaPackageVodClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediapackage-vod/runtimeConfig.browser.ts b/clients/client-mediapackage-vod/runtimeConfig.browser.ts index c21fda55558e..db74a22c4d59 100644 --- a/clients/client-mediapackage-vod/runtimeConfig.browser.ts +++ b/clients/client-mediapackage-vod/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediapackage-vod/runtimeConfig.native.ts b/clients/client-mediapackage-vod/runtimeConfig.native.ts index 2fb54a3a1bfa..ebf00bea258a 100644 --- a/clients/client-mediapackage-vod/runtimeConfig.native.ts +++ b/clients/client-mediapackage-vod/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaPackageVodClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediapackage-vod/runtimeConfig.ts b/clients/client-mediapackage-vod/runtimeConfig.ts index 7dfcfc1ccc97..d680695ae8c4 100644 --- a/clients/client-mediapackage-vod/runtimeConfig.ts +++ b/clients/client-mediapackage-vod/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediapackage/MediaPackageClient.ts b/clients/client-mediapackage/MediaPackageClient.ts index 7334d9c98da0..52b2defa0c1a 100644 --- a/clients/client-mediapackage/MediaPackageClient.ts +++ b/clients/client-mediapackage/MediaPackageClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -179,11 +181,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -225,6 +222,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MediaPackageClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -233,8 +236,8 @@ export type MediaPackageClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaPackageClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -242,8 +245,8 @@ export type MediaPackageClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Elemental MediaPackage @@ -265,16 +268,16 @@ export class MediaPackageClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediapackage/runtimeConfig.browser.ts b/clients/client-mediapackage/runtimeConfig.browser.ts index eb1e8310a0f4..08bfbaeb4728 100644 --- a/clients/client-mediapackage/runtimeConfig.browser.ts +++ b/clients/client-mediapackage/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediapackage/runtimeConfig.native.ts b/clients/client-mediapackage/runtimeConfig.native.ts index a554726da5a5..54d8667e228c 100644 --- a/clients/client-mediapackage/runtimeConfig.native.ts +++ b/clients/client-mediapackage/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaPackageClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediapackage/runtimeConfig.ts b/clients/client-mediapackage/runtimeConfig.ts index faed062b5b34..a23854c3e3c3 100644 --- a/clients/client-mediapackage/runtimeConfig.ts +++ b/clients/client-mediapackage/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediastore-data/MediaStoreDataClient.ts b/clients/client-mediastore-data/MediaStoreDataClient.ts index 7838080ad64c..6267d878f79b 100644 --- a/clients/client-mediastore-data/MediaStoreDataClient.ts +++ b/clients/client-mediastore-data/MediaStoreDataClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -113,11 +115,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -159,6 +156,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MediaStoreDataClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -167,8 +170,8 @@ export type MediaStoreDataClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaStoreDataClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -176,8 +179,8 @@ export type MediaStoreDataClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

An AWS Elemental MediaStore asset is an object, similar to an object in the Amazon S3 @@ -201,16 +204,16 @@ export class MediaStoreDataClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediastore-data/runtimeConfig.browser.ts b/clients/client-mediastore-data/runtimeConfig.browser.ts index 958f1b4c0751..e633725eb489 100644 --- a/clients/client-mediastore-data/runtimeConfig.browser.ts +++ b/clients/client-mediastore-data/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediastore-data/runtimeConfig.native.ts b/clients/client-mediastore-data/runtimeConfig.native.ts index f4fa4b4a5c53..45b59a450dc2 100644 --- a/clients/client-mediastore-data/runtimeConfig.native.ts +++ b/clients/client-mediastore-data/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaStoreDataClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediastore-data/runtimeConfig.ts b/clients/client-mediastore-data/runtimeConfig.ts index dc70773617c5..299816ab913a 100644 --- a/clients/client-mediastore-data/runtimeConfig.ts +++ b/clients/client-mediastore-data/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediastore/MediaStoreClient.ts b/clients/client-mediastore/MediaStoreClient.ts index b1b4e5aab8f7..ea74ca011bf5 100644 --- a/clients/client-mediastore/MediaStoreClient.ts +++ b/clients/client-mediastore/MediaStoreClient.ts @@ -65,6 +65,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -75,6 +76,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MediaStoreClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +227,8 @@ export type MediaStoreClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaStoreClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +236,8 @@ export type MediaStoreClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

An AWS Elemental MediaStore container is a namespace that holds folders and objects. @@ -257,16 +260,16 @@ export class MediaStoreClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediastore/runtimeConfig.browser.ts b/clients/client-mediastore/runtimeConfig.browser.ts index 1719626d88c7..d01eecf79f06 100644 --- a/clients/client-mediastore/runtimeConfig.browser.ts +++ b/clients/client-mediastore/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediastore/runtimeConfig.native.ts b/clients/client-mediastore/runtimeConfig.native.ts index 35ed4f0e88ff..1086d5038f18 100644 --- a/clients/client-mediastore/runtimeConfig.native.ts +++ b/clients/client-mediastore/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaStoreClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediastore/runtimeConfig.ts b/clients/client-mediastore/runtimeConfig.ts index c1ed36b0e902..cd483c7b9127 100644 --- a/clients/client-mediastore/runtimeConfig.ts +++ b/clients/client-mediastore/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mediatailor/MediaTailorClient.ts b/clients/client-mediatailor/MediaTailorClient.ts index ccdfa9fc7b3f..d154c02d14ea 100644 --- a/clients/client-mediatailor/MediaTailorClient.ts +++ b/clients/client-mediatailor/MediaTailorClient.ts @@ -57,6 +57,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -67,6 +68,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -134,11 +136,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -180,6 +177,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MediaTailorClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -188,8 +191,8 @@ export type MediaTailorClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MediaTailorClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -197,8 +200,8 @@ export type MediaTailorClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Use the AWS Elemental MediaTailor SDK to configure scalable ad insertion for your live and VOD content. With AWS Elemental MediaTailor, you can serve targeted ads to viewers while maintaining broadcast quality in over-the-top (OTT) video applications. For information about using the service, including detailed information about the settings covered in this guide, see the AWS Elemental MediaTailor User Guide.

Through the SDK, you manage AWS Elemental MediaTailor configurations the same as you do through the console. For example, you specify ad insertion behavior and mapping information for the origin server and the ad decision server (ADS).

@@ -220,16 +223,16 @@ export class MediaTailorClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mediatailor/runtimeConfig.browser.ts b/clients/client-mediatailor/runtimeConfig.browser.ts index b1e53b07d908..43d481229aa9 100644 --- a/clients/client-mediatailor/runtimeConfig.browser.ts +++ b/clients/client-mediatailor/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mediatailor/runtimeConfig.native.ts b/clients/client-mediatailor/runtimeConfig.native.ts index 21f532e35a46..e55085eac7ae 100644 --- a/clients/client-mediatailor/runtimeConfig.native.ts +++ b/clients/client-mediatailor/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MediaTailorClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mediatailor/runtimeConfig.ts b/clients/client-mediatailor/runtimeConfig.ts index cf2ac30a12ed..663e496d7200 100644 --- a/clients/client-mediatailor/runtimeConfig.ts +++ b/clients/client-mediatailor/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-migration-hub/MigrationHubClient.ts b/clients/client-migration-hub/MigrationHubClient.ts index 82e8e5ef89f1..454f60796692 100644 --- a/clients/client-migration-hub/MigrationHubClient.ts +++ b/clients/client-migration-hub/MigrationHubClient.ts @@ -100,6 +100,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -110,6 +111,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -197,11 +199,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -243,6 +240,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MigrationHubClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -251,8 +254,8 @@ export type MigrationHubClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MigrationHubClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -260,8 +263,8 @@ export type MigrationHubClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS Migration Hub API methods help to obtain server and application migration status @@ -288,16 +291,16 @@ export class MigrationHubClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-migration-hub/runtimeConfig.browser.ts b/clients/client-migration-hub/runtimeConfig.browser.ts index 35c86deda734..dab14126017f 100644 --- a/clients/client-migration-hub/runtimeConfig.browser.ts +++ b/clients/client-migration-hub/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-migration-hub/runtimeConfig.native.ts b/clients/client-migration-hub/runtimeConfig.native.ts index 3e31aa7543c6..8a79f34c301e 100644 --- a/clients/client-migration-hub/runtimeConfig.native.ts +++ b/clients/client-migration-hub/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MigrationHubClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-migration-hub/runtimeConfig.ts b/clients/client-migration-hub/runtimeConfig.ts index 7e4956403719..7a920bd7d5fe 100644 --- a/clients/client-migration-hub/runtimeConfig.ts +++ b/clients/client-migration-hub/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-migrationhub-config/MigrationHubConfigClient.ts b/clients/client-migrationhub-config/MigrationHubConfigClient.ts index a77acbedd690..cf15010c6936 100644 --- a/clients/client-migrationhub-config/MigrationHubConfigClient.ts +++ b/clients/client-migrationhub-config/MigrationHubConfigClient.ts @@ -44,6 +44,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -54,6 +55,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -113,11 +115,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -159,6 +156,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MigrationHubConfigClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -167,8 +170,8 @@ export type MigrationHubConfigClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MigrationHubConfigClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -176,8 +179,8 @@ export type MigrationHubConfigClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS Migration Hub home region APIs are available specifically for working with your @@ -224,16 +227,16 @@ export class MigrationHubConfigClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-migrationhub-config/runtimeConfig.browser.ts b/clients/client-migrationhub-config/runtimeConfig.browser.ts index e50d07af4775..c4b08edced93 100644 --- a/clients/client-migrationhub-config/runtimeConfig.browser.ts +++ b/clients/client-migrationhub-config/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-migrationhub-config/runtimeConfig.native.ts b/clients/client-migrationhub-config/runtimeConfig.native.ts index 8d1f21b78e31..a747856aa20d 100644 --- a/clients/client-migrationhub-config/runtimeConfig.native.ts +++ b/clients/client-migrationhub-config/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MigrationHubConfigClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-migrationhub-config/runtimeConfig.ts b/clients/client-migrationhub-config/runtimeConfig.ts index 39dbea53eda8..dce3549104ac 100644 --- a/clients/client-migrationhub-config/runtimeConfig.ts +++ b/clients/client-migrationhub-config/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mobile/MobileClient.ts b/clients/client-mobile/MobileClient.ts index 85b1e8eec2f2..ad42114922d9 100644 --- a/clients/client-mobile/MobileClient.ts +++ b/clients/client-mobile/MobileClient.ts @@ -44,6 +44,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -54,6 +55,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -125,11 +127,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -171,6 +168,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MobileClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -179,8 +182,8 @@ export type MobileClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MobileClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -188,8 +191,8 @@ export type MobileClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -215,16 +218,16 @@ export class MobileClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mobile/runtimeConfig.browser.ts b/clients/client-mobile/runtimeConfig.browser.ts index 070b80b5b7d5..ef8542c72690 100644 --- a/clients/client-mobile/runtimeConfig.browser.ts +++ b/clients/client-mobile/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mobile/runtimeConfig.native.ts b/clients/client-mobile/runtimeConfig.native.ts index 84ba34ab5324..17e2209140c7 100644 --- a/clients/client-mobile/runtimeConfig.native.ts +++ b/clients/client-mobile/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MobileClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mobile/runtimeConfig.ts b/clients/client-mobile/runtimeConfig.ts index 3c4665f0c5f7..022252616e08 100644 --- a/clients/client-mobile/runtimeConfig.ts +++ b/clients/client-mobile/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mq/MqClient.ts b/clients/client-mq/MqClient.ts index efa22e857882..02add361288a 100644 --- a/clients/client-mq/MqClient.ts +++ b/clients/client-mq/MqClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MqClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +242,8 @@ export type MqClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions> EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MqClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +251,8 @@ export type MqClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandler EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ that makes it easy to set up and operate message brokers in the cloud. A message broker allows software applications and components to communicate using various programming languages, operating systems, and formal messaging protocols. @@ -271,16 +274,16 @@ export class MqClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mq/runtimeConfig.browser.ts b/clients/client-mq/runtimeConfig.browser.ts index 8e45013929d2..4fe8d23829f0 100644 --- a/clients/client-mq/runtimeConfig.browser.ts +++ b/clients/client-mq/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mq/runtimeConfig.native.ts b/clients/client-mq/runtimeConfig.native.ts index 0c06fe3b99b3..95a55aa5e437 100644 --- a/clients/client-mq/runtimeConfig.native.ts +++ b/clients/client-mq/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MqClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mq/runtimeConfig.ts b/clients/client-mq/runtimeConfig.ts index 65927b97b4e7..9862396080bb 100644 --- a/clients/client-mq/runtimeConfig.ts +++ b/clients/client-mq/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-mturk/MTurkClient.ts b/clients/client-mturk/MTurkClient.ts index 0a442ef6171b..9ef3f15597f0 100644 --- a/clients/client-mturk/MTurkClient.ts +++ b/clients/client-mturk/MTurkClient.ts @@ -137,6 +137,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -147,6 +148,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -278,11 +280,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -324,6 +321,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type MTurkClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -332,8 +335,8 @@ export type MTurkClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type MTurkClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -341,8 +344,8 @@ export type MTurkClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Mechanical Turk API Reference @@ -364,16 +367,16 @@ export class MTurkClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-mturk/runtimeConfig.browser.ts b/clients/client-mturk/runtimeConfig.browser.ts index 700ac5768ac7..fffa5f6f2f72 100644 --- a/clients/client-mturk/runtimeConfig.browser.ts +++ b/clients/client-mturk/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-mturk/runtimeConfig.native.ts b/clients/client-mturk/runtimeConfig.native.ts index 687ba097dc70..f87ecc7df4fa 100644 --- a/clients/client-mturk/runtimeConfig.native.ts +++ b/clients/client-mturk/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./MTurkClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-mturk/runtimeConfig.ts b/clients/client-mturk/runtimeConfig.ts index 7d468769805b..aabda4f54d98 100644 --- a/clients/client-mturk/runtimeConfig.ts +++ b/clients/client-mturk/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-neptune/NeptuneClient.ts b/clients/client-neptune/NeptuneClient.ts index d4e4907f238d..ff5ad417d634 100644 --- a/clients/client-neptune/NeptuneClient.ts +++ b/clients/client-neptune/NeptuneClient.ts @@ -245,6 +245,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -255,6 +256,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -434,11 +436,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -480,6 +477,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type NeptuneClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -488,8 +491,8 @@ export type NeptuneClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type NeptuneClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -497,8 +500,8 @@ export type NeptuneClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Neptune @@ -537,16 +540,16 @@ export class NeptuneClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-neptune/runtimeConfig.browser.ts b/clients/client-neptune/runtimeConfig.browser.ts index cd560819dfcf..a78e68c38ab4 100644 --- a/clients/client-neptune/runtimeConfig.browser.ts +++ b/clients/client-neptune/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-neptune/runtimeConfig.native.ts b/clients/client-neptune/runtimeConfig.native.ts index 2b8c9ce73320..72d1508cda8b 100644 --- a/clients/client-neptune/runtimeConfig.native.ts +++ b/clients/client-neptune/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./NeptuneClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-neptune/runtimeConfig.ts b/clients/client-neptune/runtimeConfig.ts index a339deeb1e6d..1e09d36f386b 100644 --- a/clients/client-neptune/runtimeConfig.ts +++ b/clients/client-neptune/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-network-firewall/NetworkFirewallClient.ts b/clients/client-network-firewall/NetworkFirewallClient.ts index 5d9a7b15ccd7..53ffe5151a96 100644 --- a/clients/client-network-firewall/NetworkFirewallClient.ts +++ b/clients/client-network-firewall/NetworkFirewallClient.ts @@ -112,6 +112,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -122,6 +123,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -233,11 +235,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -279,6 +276,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type NetworkFirewallClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -287,8 +290,8 @@ export type NetworkFirewallClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type NetworkFirewallClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -296,8 +299,8 @@ export type NetworkFirewallClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This is the API Reference for AWS Network Firewall. This guide is for developers who need @@ -398,16 +401,16 @@ export class NetworkFirewallClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-network-firewall/runtimeConfig.browser.ts b/clients/client-network-firewall/runtimeConfig.browser.ts index 181e838300cb..db9d1c9ee76b 100644 --- a/clients/client-network-firewall/runtimeConfig.browser.ts +++ b/clients/client-network-firewall/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-network-firewall/runtimeConfig.native.ts b/clients/client-network-firewall/runtimeConfig.native.ts index 9080a99499d2..de9e7ea510f2 100644 --- a/clients/client-network-firewall/runtimeConfig.native.ts +++ b/clients/client-network-firewall/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./NetworkFirewallClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-network-firewall/runtimeConfig.ts b/clients/client-network-firewall/runtimeConfig.ts index e4bd0276e1fc..7b1d2e26f1f2 100644 --- a/clients/client-network-firewall/runtimeConfig.ts +++ b/clients/client-network-firewall/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-networkmanager/NetworkManagerClient.ts b/clients/client-networkmanager/NetworkManagerClient.ts index 21c1507c1d24..e0ec87004f84 100644 --- a/clients/client-networkmanager/NetworkManagerClient.ts +++ b/clients/client-networkmanager/NetworkManagerClient.ts @@ -115,6 +115,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -125,6 +126,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -248,11 +250,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -294,6 +291,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type NetworkManagerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -302,8 +305,8 @@ export type NetworkManagerClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type NetworkManagerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -311,8 +314,8 @@ export type NetworkManagerClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Transit Gateway Network Manager (Network Manager) enables you to create a global network, in which you can monitor your @@ -336,16 +339,16 @@ export class NetworkManagerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-networkmanager/runtimeConfig.browser.ts b/clients/client-networkmanager/runtimeConfig.browser.ts index 118482dbb678..5107e027a729 100644 --- a/clients/client-networkmanager/runtimeConfig.browser.ts +++ b/clients/client-networkmanager/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-networkmanager/runtimeConfig.native.ts b/clients/client-networkmanager/runtimeConfig.native.ts index 2dad3f50694e..9f36f057a7a6 100644 --- a/clients/client-networkmanager/runtimeConfig.native.ts +++ b/clients/client-networkmanager/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./NetworkManagerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-networkmanager/runtimeConfig.ts b/clients/client-networkmanager/runtimeConfig.ts index e0b69d70634f..e2d52d6a5a04 100644 --- a/clients/client-networkmanager/runtimeConfig.ts +++ b/clients/client-networkmanager/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-opsworks/OpsWorksClient.ts b/clients/client-opsworks/OpsWorksClient.ts index bb373592a0c2..57fccb06490b 100644 --- a/clients/client-opsworks/OpsWorksClient.ts +++ b/clients/client-opsworks/OpsWorksClient.ts @@ -187,6 +187,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -197,6 +198,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -398,11 +400,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -444,6 +441,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type OpsWorksClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -452,8 +455,8 @@ export type OpsWorksClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type OpsWorksClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -461,8 +464,8 @@ export type OpsWorksClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS OpsWorks @@ -598,16 +601,16 @@ export class OpsWorksClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-opsworks/runtimeConfig.browser.ts b/clients/client-opsworks/runtimeConfig.browser.ts index a8485afee019..4057c7787d36 100644 --- a/clients/client-opsworks/runtimeConfig.browser.ts +++ b/clients/client-opsworks/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-opsworks/runtimeConfig.native.ts b/clients/client-opsworks/runtimeConfig.native.ts index 190be7c51134..4e1e13b3eeba 100644 --- a/clients/client-opsworks/runtimeConfig.native.ts +++ b/clients/client-opsworks/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./OpsWorksClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-opsworks/runtimeConfig.ts b/clients/client-opsworks/runtimeConfig.ts index 83dd8c28207a..7c7a47fbc09f 100644 --- a/clients/client-opsworks/runtimeConfig.ts +++ b/clients/client-opsworks/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-opsworkscm/OpsWorksCMClient.ts b/clients/client-opsworkscm/OpsWorksCMClient.ts index 9ec3ce2fbf40..b495afa58c08 100644 --- a/clients/client-opsworkscm/OpsWorksCMClient.ts +++ b/clients/client-opsworkscm/OpsWorksCMClient.ts @@ -69,6 +69,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -79,6 +80,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type OpsWorksCMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +227,8 @@ export type OpsWorksCMClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type OpsWorksCMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +236,8 @@ export type OpsWorksCMClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS OpsWorks CM @@ -343,16 +346,16 @@ export class OpsWorksCMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-opsworkscm/runtimeConfig.browser.ts b/clients/client-opsworkscm/runtimeConfig.browser.ts index 9faa544c9b79..7f2185cac520 100644 --- a/clients/client-opsworkscm/runtimeConfig.browser.ts +++ b/clients/client-opsworkscm/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-opsworkscm/runtimeConfig.native.ts b/clients/client-opsworkscm/runtimeConfig.native.ts index 46c8df411113..136b8193f32c 100644 --- a/clients/client-opsworkscm/runtimeConfig.native.ts +++ b/clients/client-opsworkscm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./OpsWorksCMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-opsworkscm/runtimeConfig.ts b/clients/client-opsworkscm/runtimeConfig.ts index 05574e57fe01..2e2c70a40401 100644 --- a/clients/client-opsworkscm/runtimeConfig.ts +++ b/clients/client-opsworkscm/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-organizations/OrganizationsClient.ts b/clients/client-organizations/OrganizationsClient.ts index b54d8a2f63cc..829095ecc537 100644 --- a/clients/client-organizations/OrganizationsClient.ts +++ b/clients/client-organizations/OrganizationsClient.ts @@ -161,6 +161,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -171,6 +172,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -326,11 +328,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -372,6 +369,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type OrganizationsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -380,8 +383,8 @@ export type OrganizationsClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type OrganizationsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -389,8 +392,8 @@ export type OrganizationsClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Organizations @@ -412,16 +415,16 @@ export class OrganizationsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-organizations/runtimeConfig.browser.ts b/clients/client-organizations/runtimeConfig.browser.ts index 0bbd70320908..2d368f08078c 100644 --- a/clients/client-organizations/runtimeConfig.browser.ts +++ b/clients/client-organizations/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-organizations/runtimeConfig.native.ts b/clients/client-organizations/runtimeConfig.native.ts index 7f114f369b56..e8e94b4f2b0a 100644 --- a/clients/client-organizations/runtimeConfig.native.ts +++ b/clients/client-organizations/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./OrganizationsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-organizations/runtimeConfig.ts b/clients/client-organizations/runtimeConfig.ts index 4ef2f0fadf82..fd5cbad4b727 100644 --- a/clients/client-organizations/runtimeConfig.ts +++ b/clients/client-organizations/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-outposts/OutpostsClient.ts b/clients/client-outposts/OutpostsClient.ts index d26eb71be356..198420cc6da2 100644 --- a/clients/client-outposts/OutpostsClient.ts +++ b/clients/client-outposts/OutpostsClient.ts @@ -45,6 +45,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -55,6 +56,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -122,11 +124,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -168,6 +165,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type OutpostsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -176,8 +179,8 @@ export type OutpostsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type OutpostsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -185,8 +188,8 @@ export type OutpostsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Outposts is a fully-managed service that extends AWS infrastructure, @@ -213,16 +216,16 @@ export class OutpostsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-outposts/runtimeConfig.browser.ts b/clients/client-outposts/runtimeConfig.browser.ts index f52a4bc657f7..cc31f1773f6a 100644 --- a/clients/client-outposts/runtimeConfig.browser.ts +++ b/clients/client-outposts/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-outposts/runtimeConfig.native.ts b/clients/client-outposts/runtimeConfig.native.ts index 0438b4ad69bd..b79a1ac2d391 100644 --- a/clients/client-outposts/runtimeConfig.native.ts +++ b/clients/client-outposts/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./OutpostsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-outposts/runtimeConfig.ts b/clients/client-outposts/runtimeConfig.ts index 4365b133e0d4..85d94e67e8fd 100644 --- a/clients/client-outposts/runtimeConfig.ts +++ b/clients/client-outposts/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-personalize-events/PersonalizeEventsClient.ts b/clients/client-personalize-events/PersonalizeEventsClient.ts index a7083b118ee4..6cf2467423c7 100644 --- a/clients/client-personalize-events/PersonalizeEventsClient.ts +++ b/clients/client-personalize-events/PersonalizeEventsClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = PutEventsCommandInput | PutItemsCommandInput | PutUsersCommandInput; @@ -101,11 +103,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -147,6 +144,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PersonalizeEventsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -155,8 +158,8 @@ export type PersonalizeEventsClientConfig = Partial<__SmithyConfiguration<__Http EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PersonalizeEventsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -164,8 +167,8 @@ export type PersonalizeEventsClientResolvedConfig = __SmithyResolvedConfiguratio EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Personalize can consume real-time user event data, such as stream or click data, and use @@ -188,16 +191,16 @@ export class PersonalizeEventsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-personalize-events/runtimeConfig.browser.ts b/clients/client-personalize-events/runtimeConfig.browser.ts index be6605596fd2..29d961ec3988 100644 --- a/clients/client-personalize-events/runtimeConfig.browser.ts +++ b/clients/client-personalize-events/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-personalize-events/runtimeConfig.native.ts b/clients/client-personalize-events/runtimeConfig.native.ts index 4014e952d21d..fa4b108562d0 100644 --- a/clients/client-personalize-events/runtimeConfig.native.ts +++ b/clients/client-personalize-events/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PersonalizeEventsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-personalize-events/runtimeConfig.ts b/clients/client-personalize-events/runtimeConfig.ts index 8b8938c4b931..fb7047407c17 100644 --- a/clients/client-personalize-events/runtimeConfig.ts +++ b/clients/client-personalize-events/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-personalize-runtime/PersonalizeRuntimeClient.ts b/clients/client-personalize-runtime/PersonalizeRuntimeClient.ts index aa2e4cf300c5..205d61272d9d 100644 --- a/clients/client-personalize-runtime/PersonalizeRuntimeClient.ts +++ b/clients/client-personalize-runtime/PersonalizeRuntimeClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetPersonalizedRankingCommandInput | GetRecommendationsCommandInput; @@ -103,11 +105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -149,6 +146,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PersonalizeRuntimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -157,8 +160,8 @@ export type PersonalizeRuntimeClientConfig = Partial<__SmithyConfiguration<__Htt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PersonalizeRuntimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -166,8 +169,8 @@ export type PersonalizeRuntimeClientResolvedConfig = __SmithyResolvedConfigurati EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -189,16 +192,16 @@ export class PersonalizeRuntimeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-personalize-runtime/runtimeConfig.browser.ts b/clients/client-personalize-runtime/runtimeConfig.browser.ts index 84c92ec5acfa..c78c795d4b63 100644 --- a/clients/client-personalize-runtime/runtimeConfig.browser.ts +++ b/clients/client-personalize-runtime/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-personalize-runtime/runtimeConfig.native.ts b/clients/client-personalize-runtime/runtimeConfig.native.ts index ce7f23fe94f3..d3639a5e6f11 100644 --- a/clients/client-personalize-runtime/runtimeConfig.native.ts +++ b/clients/client-personalize-runtime/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PersonalizeRuntimeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-personalize-runtime/runtimeConfig.ts b/clients/client-personalize-runtime/runtimeConfig.ts index 30d5025f9e3d..b8e0ac87b530 100644 --- a/clients/client-personalize-runtime/runtimeConfig.ts +++ b/clients/client-personalize-runtime/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-personalize/PersonalizeClient.ts b/clients/client-personalize/PersonalizeClient.ts index 671dc6b410ec..672d55f66a22 100644 --- a/clients/client-personalize/PersonalizeClient.ts +++ b/clients/client-personalize/PersonalizeClient.ts @@ -114,6 +114,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -124,6 +125,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -263,11 +265,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -309,6 +306,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PersonalizeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -317,8 +320,8 @@ export type PersonalizeClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PersonalizeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -326,8 +329,8 @@ export type PersonalizeClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Personalize is a machine learning service that makes it easy to add individualized @@ -350,16 +353,16 @@ export class PersonalizeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-personalize/runtimeConfig.browser.ts b/clients/client-personalize/runtimeConfig.browser.ts index c29645ad4194..ccca8adda904 100644 --- a/clients/client-personalize/runtimeConfig.browser.ts +++ b/clients/client-personalize/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-personalize/runtimeConfig.native.ts b/clients/client-personalize/runtimeConfig.native.ts index 21b3daa6c979..d04e00fcec44 100644 --- a/clients/client-personalize/runtimeConfig.native.ts +++ b/clients/client-personalize/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PersonalizeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-personalize/runtimeConfig.ts b/clients/client-personalize/runtimeConfig.ts index 842195f9f891..a7685f8cd27f 100644 --- a/clients/client-personalize/runtimeConfig.ts +++ b/clients/client-personalize/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-pi/PIClient.ts b/clients/client-pi/PIClient.ts index f3cf5276b6c6..7b5366616dfa 100644 --- a/clients/client-pi/PIClient.ts +++ b/clients/client-pi/PIClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = DescribeDimensionKeysCommandInput | GetResourceMetricsCommandInput; @@ -103,11 +105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -149,6 +146,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PIClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -157,8 +160,8 @@ export type PIClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions> EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PIClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -166,8 +169,8 @@ export type PIClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandler EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Performance Insights enables you to monitor and explore different dimensions of @@ -202,16 +205,16 @@ export class PIClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-pi/runtimeConfig.browser.ts b/clients/client-pi/runtimeConfig.browser.ts index 8505dd027c93..ce5fcb03867d 100644 --- a/clients/client-pi/runtimeConfig.browser.ts +++ b/clients/client-pi/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-pi/runtimeConfig.native.ts b/clients/client-pi/runtimeConfig.native.ts index a21490f338d4..8f1728634593 100644 --- a/clients/client-pi/runtimeConfig.native.ts +++ b/clients/client-pi/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PIClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-pi/runtimeConfig.ts b/clients/client-pi/runtimeConfig.ts index d6c06c872fd5..f1b2e8d5f41f 100644 --- a/clients/client-pi/runtimeConfig.ts +++ b/clients/client-pi/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-pinpoint-email/PinpointEmailClient.ts b/clients/client-pinpoint-email/PinpointEmailClient.ts index bf81efa63bac..fae575ee8673 100644 --- a/clients/client-pinpoint-email/PinpointEmailClient.ts +++ b/clients/client-pinpoint-email/PinpointEmailClient.ts @@ -182,6 +182,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -192,6 +193,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -329,11 +331,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -375,6 +372,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PinpointEmailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -383,8 +386,8 @@ export type PinpointEmailClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PinpointEmailClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -392,8 +395,8 @@ export type PinpointEmailClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Pinpoint Email Service @@ -443,16 +446,16 @@ export class PinpointEmailClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-pinpoint-email/runtimeConfig.browser.ts b/clients/client-pinpoint-email/runtimeConfig.browser.ts index 4a03a5f4e91d..3e52b3e2c7d0 100644 --- a/clients/client-pinpoint-email/runtimeConfig.browser.ts +++ b/clients/client-pinpoint-email/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-pinpoint-email/runtimeConfig.native.ts b/clients/client-pinpoint-email/runtimeConfig.native.ts index 1b92604d7e02..24013a65d121 100644 --- a/clients/client-pinpoint-email/runtimeConfig.native.ts +++ b/clients/client-pinpoint-email/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PinpointEmailClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-pinpoint-email/runtimeConfig.ts b/clients/client-pinpoint-email/runtimeConfig.ts index c977404112de..dd64e28c2b25 100644 --- a/clients/client-pinpoint-email/runtimeConfig.ts +++ b/clients/client-pinpoint-email/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-pinpoint-sms-voice/PinpointSMSVoiceClient.ts b/clients/client-pinpoint-sms-voice/PinpointSMSVoiceClient.ts index d4ebe4b192d6..1c49e2d8ef48 100644 --- a/clients/client-pinpoint-sms-voice/PinpointSMSVoiceClient.ts +++ b/clients/client-pinpoint-sms-voice/PinpointSMSVoiceClient.ts @@ -64,6 +64,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -74,6 +75,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -143,11 +145,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -189,6 +186,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PinpointSMSVoiceClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -197,8 +200,8 @@ export type PinpointSMSVoiceClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PinpointSMSVoiceClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -206,8 +209,8 @@ export type PinpointSMSVoiceClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Pinpoint SMS and Voice Messaging public facing APIs @@ -229,16 +232,16 @@ export class PinpointSMSVoiceClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-pinpoint-sms-voice/runtimeConfig.browser.ts b/clients/client-pinpoint-sms-voice/runtimeConfig.browser.ts index 24d8d2b7e92e..d53c04af3c93 100644 --- a/clients/client-pinpoint-sms-voice/runtimeConfig.browser.ts +++ b/clients/client-pinpoint-sms-voice/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-pinpoint-sms-voice/runtimeConfig.native.ts b/clients/client-pinpoint-sms-voice/runtimeConfig.native.ts index 31636ad78cee..e97a34cebcca 100644 --- a/clients/client-pinpoint-sms-voice/runtimeConfig.native.ts +++ b/clients/client-pinpoint-sms-voice/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PinpointSMSVoiceClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-pinpoint-sms-voice/runtimeConfig.ts b/clients/client-pinpoint-sms-voice/runtimeConfig.ts index 9ba47ed1ffb7..8ba8ff15275e 100644 --- a/clients/client-pinpoint-sms-voice/runtimeConfig.ts +++ b/clients/client-pinpoint-sms-voice/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-pinpoint/PinpointClient.ts b/clients/client-pinpoint/PinpointClient.ts index 028bdf5e9913..61044c7be16e 100644 --- a/clients/client-pinpoint/PinpointClient.ts +++ b/clients/client-pinpoint/PinpointClient.ts @@ -255,6 +255,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -265,6 +266,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -542,11 +544,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -588,6 +585,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PinpointClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -596,8 +599,8 @@ export type PinpointClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PinpointClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -605,8 +608,8 @@ export type PinpointClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Doc Engage API - Amazon Pinpoint API

@@ -628,16 +631,16 @@ export class PinpointClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-pinpoint/runtimeConfig.browser.ts b/clients/client-pinpoint/runtimeConfig.browser.ts index 2f20bbbad2bc..3cd77708455f 100644 --- a/clients/client-pinpoint/runtimeConfig.browser.ts +++ b/clients/client-pinpoint/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-pinpoint/runtimeConfig.native.ts b/clients/client-pinpoint/runtimeConfig.native.ts index 023c17306d02..2f202ac7dc1d 100644 --- a/clients/client-pinpoint/runtimeConfig.native.ts +++ b/clients/client-pinpoint/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PinpointClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-pinpoint/runtimeConfig.ts b/clients/client-pinpoint/runtimeConfig.ts index 3163da034d73..694292a36224 100644 --- a/clients/client-pinpoint/runtimeConfig.ts +++ b/clients/client-pinpoint/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-polly/PollyClient.ts b/clients/client-polly/PollyClient.ts index c090841946a9..8761da4926ba 100644 --- a/clients/client-polly/PollyClient.ts +++ b/clients/client-polly/PollyClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -134,11 +136,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -180,6 +177,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PollyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -188,8 +191,8 @@ export type PollyClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PollyClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -197,8 +200,8 @@ export type PollyClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Polly is a web service that makes it easy to synthesize speech from @@ -225,16 +228,16 @@ export class PollyClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-polly/runtimeConfig.browser.ts b/clients/client-polly/runtimeConfig.browser.ts index d666057083bc..2d61a1001fb6 100644 --- a/clients/client-polly/runtimeConfig.browser.ts +++ b/clients/client-polly/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-polly/runtimeConfig.native.ts b/clients/client-polly/runtimeConfig.native.ts index d4c46a6faab6..247aeafab705 100644 --- a/clients/client-polly/runtimeConfig.native.ts +++ b/clients/client-polly/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PollyClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-polly/runtimeConfig.ts b/clients/client-polly/runtimeConfig.ts index ee8ac9800836..3e55dc929b66 100644 --- a/clients/client-polly/runtimeConfig.ts +++ b/clients/client-polly/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-pricing/PricingClient.ts b/clients/client-pricing/PricingClient.ts index df0e5d62679b..bb140e14873c 100644 --- a/clients/client-pricing/PricingClient.ts +++ b/clients/client-pricing/PricingClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = DescribeServicesCommandInput | GetAttributeValuesCommandInput | GetProductsCommandInput; @@ -104,11 +106,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -150,6 +147,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type PricingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -158,8 +161,8 @@ export type PricingClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type PricingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -167,8 +170,8 @@ export type PricingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Price List Service API (AWS Price List Service) is a centralized and convenient way to @@ -213,16 +216,16 @@ export class PricingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-pricing/runtimeConfig.browser.ts b/clients/client-pricing/runtimeConfig.browser.ts index 9727b15241e3..14c3de2c1ed1 100644 --- a/clients/client-pricing/runtimeConfig.browser.ts +++ b/clients/client-pricing/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-pricing/runtimeConfig.native.ts b/clients/client-pricing/runtimeConfig.native.ts index b503eccafd0f..4792ba1e56e2 100644 --- a/clients/client-pricing/runtimeConfig.native.ts +++ b/clients/client-pricing/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./PricingClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-pricing/runtimeConfig.ts b/clients/client-pricing/runtimeConfig.ts index a4ee6b5f3925..db7b72ba2607 100644 --- a/clients/client-pricing/runtimeConfig.ts +++ b/clients/client-pricing/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-qldb-session/QLDBSessionClient.ts b/clients/client-qldb-session/QLDBSessionClient.ts index 3010230b3350..dbea8ccb2869 100644 --- a/clients/client-qldb-session/QLDBSessionClient.ts +++ b/clients/client-qldb-session/QLDBSessionClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = SendCommandCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type QLDBSessionClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +156,8 @@ export type QLDBSessionClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type QLDBSessionClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +165,8 @@ export type QLDBSessionClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The transactional data APIs for Amazon QLDB

@@ -205,16 +208,16 @@ export class QLDBSessionClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-qldb-session/runtimeConfig.browser.ts b/clients/client-qldb-session/runtimeConfig.browser.ts index fe0ee71dbd68..cbdc898f9e8a 100644 --- a/clients/client-qldb-session/runtimeConfig.browser.ts +++ b/clients/client-qldb-session/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-qldb-session/runtimeConfig.native.ts b/clients/client-qldb-session/runtimeConfig.native.ts index 57fef2977730..9eadf3401b96 100644 --- a/clients/client-qldb-session/runtimeConfig.native.ts +++ b/clients/client-qldb-session/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./QLDBSessionClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-qldb-session/runtimeConfig.ts b/clients/client-qldb-session/runtimeConfig.ts index 34d88d8c6aae..23954907193a 100644 --- a/clients/client-qldb-session/runtimeConfig.ts +++ b/clients/client-qldb-session/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-qldb/QLDBClient.ts b/clients/client-qldb/QLDBClient.ts index 78e024bd1dfa..34f9d4ebeccb 100644 --- a/clients/client-qldb/QLDBClient.ts +++ b/clients/client-qldb/QLDBClient.ts @@ -78,6 +78,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -88,6 +89,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -179,11 +181,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -225,6 +222,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type QLDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -233,8 +236,8 @@ export type QLDBClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOption EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type QLDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -242,8 +245,8 @@ export type QLDBClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandl EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The control plane for Amazon QLDB

@@ -265,16 +268,16 @@ export class QLDBClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-qldb/runtimeConfig.browser.ts b/clients/client-qldb/runtimeConfig.browser.ts index c7139cb57ae8..b0232ba79b34 100644 --- a/clients/client-qldb/runtimeConfig.browser.ts +++ b/clients/client-qldb/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-qldb/runtimeConfig.native.ts b/clients/client-qldb/runtimeConfig.native.ts index bd8912906853..fee104745edf 100644 --- a/clients/client-qldb/runtimeConfig.native.ts +++ b/clients/client-qldb/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./QLDBClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-qldb/runtimeConfig.ts b/clients/client-qldb/runtimeConfig.ts index 7a236f0e51cb..b720880168bd 100644 --- a/clients/client-qldb/runtimeConfig.ts +++ b/clients/client-qldb/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-quicksight/QuickSightClient.ts b/clients/client-quicksight/QuickSightClient.ts index 1e08316051d1..11d15672fa69 100644 --- a/clients/client-quicksight/QuickSightClient.ts +++ b/clients/client-quicksight/QuickSightClient.ts @@ -248,6 +248,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -258,6 +259,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -509,11 +511,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -555,6 +552,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type QuickSightClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -563,8 +566,8 @@ export type QuickSightClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type QuickSightClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -572,8 +575,8 @@ export type QuickSightClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon QuickSight API Reference @@ -599,16 +602,16 @@ export class QuickSightClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-quicksight/runtimeConfig.browser.ts b/clients/client-quicksight/runtimeConfig.browser.ts index 1cd4c65e949e..baad8cbe2390 100644 --- a/clients/client-quicksight/runtimeConfig.browser.ts +++ b/clients/client-quicksight/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-quicksight/runtimeConfig.native.ts b/clients/client-quicksight/runtimeConfig.native.ts index 4a75770c2502..c140fe2890a5 100644 --- a/clients/client-quicksight/runtimeConfig.native.ts +++ b/clients/client-quicksight/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./QuickSightClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-quicksight/runtimeConfig.ts b/clients/client-quicksight/runtimeConfig.ts index 79d6ad23426b..06e408843312 100644 --- a/clients/client-quicksight/runtimeConfig.ts +++ b/clients/client-quicksight/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ram/RAMClient.ts b/clients/client-ram/RAMClient.ts index d1e1e1ad8a61..16d9632e1702 100644 --- a/clients/client-ram/RAMClient.ts +++ b/clients/client-ram/RAMClient.ts @@ -107,6 +107,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -117,6 +118,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -218,11 +220,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -264,6 +261,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RAMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -272,8 +275,8 @@ export type RAMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RAMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -281,8 +284,8 @@ export type RAMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Use AWS Resource Access Manager to share AWS resources between AWS accounts. To share a resource, you @@ -309,16 +312,16 @@ export class RAMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ram/runtimeConfig.browser.ts b/clients/client-ram/runtimeConfig.browser.ts index 5c9dfc43f568..ff3ede4ef91b 100644 --- a/clients/client-ram/runtimeConfig.browser.ts +++ b/clients/client-ram/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ram/runtimeConfig.native.ts b/clients/client-ram/runtimeConfig.native.ts index 0055d86d41c3..e90e29b19f8e 100644 --- a/clients/client-ram/runtimeConfig.native.ts +++ b/clients/client-ram/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RAMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ram/runtimeConfig.ts b/clients/client-ram/runtimeConfig.ts index cf2e668214a2..45df96b74d89 100644 --- a/clients/client-ram/runtimeConfig.ts +++ b/clients/client-ram/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-rds-data/RDSDataClient.ts b/clients/client-rds-data/RDSDataClient.ts index f391e8b7944b..9d13bfadb251 100644 --- a/clients/client-rds-data/RDSDataClient.ts +++ b/clients/client-rds-data/RDSDataClient.ts @@ -47,6 +47,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -57,6 +58,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -122,11 +124,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -168,6 +165,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RDSDataClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -176,8 +179,8 @@ export type RDSDataClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RDSDataClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -185,8 +188,8 @@ export type RDSDataClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon RDS Data Service @@ -217,16 +220,16 @@ export class RDSDataClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-rds-data/runtimeConfig.browser.ts b/clients/client-rds-data/runtimeConfig.browser.ts index a2cc85379b4f..d4d9e6db5c9b 100644 --- a/clients/client-rds-data/runtimeConfig.browser.ts +++ b/clients/client-rds-data/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-rds-data/runtimeConfig.native.ts b/clients/client-rds-data/runtimeConfig.native.ts index 10e0bc1347be..67e12ed55cd6 100644 --- a/clients/client-rds-data/runtimeConfig.native.ts +++ b/clients/client-rds-data/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RDSDataClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-rds-data/runtimeConfig.ts b/clients/client-rds-data/runtimeConfig.ts index cd98eb24aa51..93c2a3186956 100644 --- a/clients/client-rds-data/runtimeConfig.ts +++ b/clients/client-rds-data/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-rds/RDSClient.ts b/clients/client-rds/RDSClient.ts index 57cda35d6402..956b5ba1088b 100644 --- a/clients/client-rds/RDSClient.ts +++ b/clients/client-rds/RDSClient.ts @@ -458,6 +458,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -468,6 +469,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -785,11 +787,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -831,6 +828,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RDSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -839,8 +842,8 @@ export type RDSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RDSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -848,8 +851,8 @@ export type RDSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Relational Database Service @@ -927,16 +930,16 @@ export class RDSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-rds/runtimeConfig.browser.ts b/clients/client-rds/runtimeConfig.browser.ts index e1dd909bb3aa..e8a83bb55950 100644 --- a/clients/client-rds/runtimeConfig.browser.ts +++ b/clients/client-rds/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-rds/runtimeConfig.native.ts b/clients/client-rds/runtimeConfig.native.ts index df367c874d58..10be77159956 100644 --- a/clients/client-rds/runtimeConfig.native.ts +++ b/clients/client-rds/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RDSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-rds/runtimeConfig.ts b/clients/client-rds/runtimeConfig.ts index de3407d0c2ab..5c42388c6891 100644 --- a/clients/client-rds/runtimeConfig.ts +++ b/clients/client-rds/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-redshift-data/RedshiftDataClient.ts b/clients/client-redshift-data/RedshiftDataClient.ts index 83a4eae5ea2d..66ccf7fee7e2 100644 --- a/clients/client-redshift-data/RedshiftDataClient.ts +++ b/clients/client-redshift-data/RedshiftDataClient.ts @@ -44,6 +44,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -54,6 +55,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -125,11 +127,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -171,6 +168,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RedshiftDataClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -179,8 +182,8 @@ export type RedshiftDataClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RedshiftDataClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -188,8 +191,8 @@ export type RedshiftDataClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

You can use the Amazon Redshift Data API to run queries on Amazon Redshift tables. You @@ -212,16 +215,16 @@ export class RedshiftDataClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-redshift-data/runtimeConfig.browser.ts b/clients/client-redshift-data/runtimeConfig.browser.ts index 0ddcb664de06..8ade1939e18b 100644 --- a/clients/client-redshift-data/runtimeConfig.browser.ts +++ b/clients/client-redshift-data/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-redshift-data/runtimeConfig.native.ts b/clients/client-redshift-data/runtimeConfig.native.ts index c2681c976a1c..1c8f8e313b9c 100644 --- a/clients/client-redshift-data/runtimeConfig.native.ts +++ b/clients/client-redshift-data/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RedshiftDataClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-redshift-data/runtimeConfig.ts b/clients/client-redshift-data/runtimeConfig.ts index bcb0acc43dbe..dba7e470be4d 100644 --- a/clients/client-redshift-data/runtimeConfig.ts +++ b/clients/client-redshift-data/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-redshift/RedshiftClient.ts b/clients/client-redshift/RedshiftClient.ts index 2ab0cfffda95..0e8163a10a33 100644 --- a/clients/client-redshift/RedshiftClient.ts +++ b/clients/client-redshift/RedshiftClient.ts @@ -340,6 +340,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -350,6 +351,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -587,11 +589,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -633,6 +630,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RedshiftClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -641,8 +644,8 @@ export type RedshiftClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RedshiftClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -650,8 +653,8 @@ export type RedshiftClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Redshift @@ -694,16 +697,16 @@ export class RedshiftClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-redshift/runtimeConfig.browser.ts b/clients/client-redshift/runtimeConfig.browser.ts index 3c941956d348..0073064ccbd3 100644 --- a/clients/client-redshift/runtimeConfig.browser.ts +++ b/clients/client-redshift/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-redshift/runtimeConfig.native.ts b/clients/client-redshift/runtimeConfig.native.ts index 3e750a39c9fa..d0ff8a798c01 100644 --- a/clients/client-redshift/runtimeConfig.native.ts +++ b/clients/client-redshift/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RedshiftClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-redshift/runtimeConfig.ts b/clients/client-redshift/runtimeConfig.ts index 39398cc997b6..0c47c88843d8 100644 --- a/clients/client-redshift/runtimeConfig.ts +++ b/clients/client-redshift/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-rekognition/RekognitionClient.ts b/clients/client-rekognition/RekognitionClient.ts index dd3519e6f4d2..5e74f94c63ab 100644 --- a/clients/client-rekognition/RekognitionClient.ts +++ b/clients/client-rekognition/RekognitionClient.ts @@ -146,6 +146,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -156,6 +157,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -305,11 +307,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -351,6 +348,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RekognitionClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -359,8 +362,8 @@ export type RekognitionClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RekognitionClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -368,8 +371,8 @@ export type RekognitionClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This is the Amazon Rekognition API reference.

@@ -391,16 +394,16 @@ export class RekognitionClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-rekognition/runtimeConfig.browser.ts b/clients/client-rekognition/runtimeConfig.browser.ts index a4e078b5ac7f..f2ad5648510d 100644 --- a/clients/client-rekognition/runtimeConfig.browser.ts +++ b/clients/client-rekognition/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-rekognition/runtimeConfig.native.ts b/clients/client-rekognition/runtimeConfig.native.ts index 25394ac24fc4..66912db06ab3 100644 --- a/clients/client-rekognition/runtimeConfig.native.ts +++ b/clients/client-rekognition/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RekognitionClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-rekognition/runtimeConfig.ts b/clients/client-rekognition/runtimeConfig.ts index 02b01ecc142b..01c3d544c839 100644 --- a/clients/client-rekognition/runtimeConfig.ts +++ b/clients/client-rekognition/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-resource-groups-tagging-api/ResourceGroupsTaggingAPIClient.ts b/clients/client-resource-groups-tagging-api/ResourceGroupsTaggingAPIClient.ts index 550ef8af8b12..190a4a6faf39 100644 --- a/clients/client-resource-groups-tagging-api/ResourceGroupsTaggingAPIClient.ts +++ b/clients/client-resource-groups-tagging-api/ResourceGroupsTaggingAPIClient.ts @@ -52,6 +52,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -62,6 +63,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -131,11 +133,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -177,6 +174,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ResourceGroupsTaggingAPIClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -185,8 +188,8 @@ export type ResourceGroupsTaggingAPIClientConfig = Partial<__SmithyConfiguration EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ResourceGroupsTaggingAPIClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -194,8 +197,8 @@ export type ResourceGroupsTaggingAPIClientResolvedConfig = __SmithyResolvedConfi EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Resource Groups Tagging API @@ -973,16 +976,16 @@ export class ResourceGroupsTaggingAPIClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-resource-groups-tagging-api/runtimeConfig.browser.ts b/clients/client-resource-groups-tagging-api/runtimeConfig.browser.ts index 85702060e838..59de4b69fb7e 100644 --- a/clients/client-resource-groups-tagging-api/runtimeConfig.browser.ts +++ b/clients/client-resource-groups-tagging-api/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-resource-groups-tagging-api/runtimeConfig.native.ts b/clients/client-resource-groups-tagging-api/runtimeConfig.native.ts index 48a22bdedd23..94081e75c64a 100644 --- a/clients/client-resource-groups-tagging-api/runtimeConfig.native.ts +++ b/clients/client-resource-groups-tagging-api/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ResourceGroupsTaggingAPIClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-resource-groups-tagging-api/runtimeConfig.ts b/clients/client-resource-groups-tagging-api/runtimeConfig.ts index 53d23d89f3d7..b3b7a948f886 100644 --- a/clients/client-resource-groups-tagging-api/runtimeConfig.ts +++ b/clients/client-resource-groups-tagging-api/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-resource-groups/ResourceGroupsClient.ts b/clients/client-resource-groups/ResourceGroupsClient.ts index c84717252369..dda1624f7d3b 100644 --- a/clients/client-resource-groups/ResourceGroupsClient.ts +++ b/clients/client-resource-groups/ResourceGroupsClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -146,11 +148,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -192,6 +189,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ResourceGroupsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -200,8 +203,8 @@ export type ResourceGroupsClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ResourceGroupsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -209,8 +212,8 @@ export type ResourceGroupsClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Resource Groups @@ -267,16 +270,16 @@ export class ResourceGroupsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-resource-groups/runtimeConfig.browser.ts b/clients/client-resource-groups/runtimeConfig.browser.ts index a2823ee8e785..3402d2e436bd 100644 --- a/clients/client-resource-groups/runtimeConfig.browser.ts +++ b/clients/client-resource-groups/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-resource-groups/runtimeConfig.native.ts b/clients/client-resource-groups/runtimeConfig.native.ts index 2becb0f1bae9..2372597f2969 100644 --- a/clients/client-resource-groups/runtimeConfig.native.ts +++ b/clients/client-resource-groups/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ResourceGroupsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-resource-groups/runtimeConfig.ts b/clients/client-resource-groups/runtimeConfig.ts index 566747c107bd..cf0b2e270b14 100644 --- a/clients/client-resource-groups/runtimeConfig.ts +++ b/clients/client-resource-groups/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-robomaker/RoboMakerClient.ts b/clients/client-robomaker/RoboMakerClient.ts index 5e5c1d86b772..5b925669b311 100644 --- a/clients/client-robomaker/RoboMakerClient.ts +++ b/clients/client-robomaker/RoboMakerClient.ts @@ -206,6 +206,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -216,6 +217,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -383,11 +385,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -429,6 +426,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RoboMakerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -437,8 +440,8 @@ export type RoboMakerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RoboMakerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -446,8 +449,8 @@ export type RoboMakerClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

This section provides documentation for the AWS RoboMaker API operations.

@@ -469,16 +472,16 @@ export class RoboMakerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-robomaker/runtimeConfig.browser.ts b/clients/client-robomaker/runtimeConfig.browser.ts index 18c64ac90a05..40b9c97b70d0 100644 --- a/clients/client-robomaker/runtimeConfig.browser.ts +++ b/clients/client-robomaker/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-robomaker/runtimeConfig.native.ts b/clients/client-robomaker/runtimeConfig.native.ts index a97e86f8b06d..a94796711ac8 100644 --- a/clients/client-robomaker/runtimeConfig.native.ts +++ b/clients/client-robomaker/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RoboMakerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-robomaker/runtimeConfig.ts b/clients/client-robomaker/runtimeConfig.ts index 6ad9fb078aa4..96c7359faea3 100644 --- a/clients/client-robomaker/runtimeConfig.ts +++ b/clients/client-robomaker/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-route-53-domains/Route53DomainsClient.ts b/clients/client-route-53-domains/Route53DomainsClient.ts index 1d2c7f7b3bea..3d09047b81f8 100644 --- a/clients/client-route-53-domains/Route53DomainsClient.ts +++ b/clients/client-route-53-domains/Route53DomainsClient.ts @@ -120,6 +120,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -130,6 +131,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -239,11 +241,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -285,6 +282,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type Route53DomainsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -293,8 +296,8 @@ export type Route53DomainsClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type Route53DomainsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -302,8 +305,8 @@ export type Route53DomainsClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Route 53 API actions let you register domain names and perform related operations.

@@ -325,16 +328,16 @@ export class Route53DomainsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-route-53-domains/runtimeConfig.browser.ts b/clients/client-route-53-domains/runtimeConfig.browser.ts index 20d16d59875c..b46103d9f6b1 100644 --- a/clients/client-route-53-domains/runtimeConfig.browser.ts +++ b/clients/client-route-53-domains/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-route-53-domains/runtimeConfig.native.ts b/clients/client-route-53-domains/runtimeConfig.native.ts index cec0f17700e7..bc2a62428f65 100644 --- a/clients/client-route-53-domains/runtimeConfig.native.ts +++ b/clients/client-route-53-domains/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./Route53DomainsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-route-53-domains/runtimeConfig.ts b/clients/client-route-53-domains/runtimeConfig.ts index aff6ba976d8b..5351d2be3d7f 100644 --- a/clients/client-route-53-domains/runtimeConfig.ts +++ b/clients/client-route-53-domains/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-route-53/Route53Client.ts b/clients/client-route-53/Route53Client.ts index 2e451275f75e..70654160a5d9 100644 --- a/clients/client-route-53/Route53Client.ts +++ b/clients/client-route-53/Route53Client.ts @@ -209,6 +209,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -219,6 +220,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -386,11 +388,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -432,6 +429,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type Route53ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -440,8 +443,8 @@ export type Route53ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type Route53ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -449,8 +452,8 @@ export type Route53ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Route 53 is a highly available and scalable Domain Name System (DNS) web service.

@@ -472,16 +475,16 @@ export class Route53Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-route-53/runtimeConfig.browser.ts b/clients/client-route-53/runtimeConfig.browser.ts index 7d7799b09f66..55cc424c3ada 100644 --- a/clients/client-route-53/runtimeConfig.browser.ts +++ b/clients/client-route-53/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-route-53/runtimeConfig.native.ts b/clients/client-route-53/runtimeConfig.native.ts index 5ae542c98f1a..2b2235c56777 100644 --- a/clients/client-route-53/runtimeConfig.native.ts +++ b/clients/client-route-53/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./Route53Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-route-53/runtimeConfig.ts b/clients/client-route-53/runtimeConfig.ts index 1d788bdb042a..aa26b0a45f48 100644 --- a/clients/client-route-53/runtimeConfig.ts +++ b/clients/client-route-53/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-route53resolver/Route53ResolverClient.ts b/clients/client-route53resolver/Route53ResolverClient.ts index 179261dd3c6d..09d894bd7040 100644 --- a/clients/client-route53resolver/Route53ResolverClient.ts +++ b/clients/client-route53resolver/Route53ResolverClient.ts @@ -142,6 +142,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -152,6 +153,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -269,11 +271,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -315,6 +312,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type Route53ResolverClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -323,8 +326,8 @@ export type Route53ResolverClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type Route53ResolverClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -332,8 +335,8 @@ export type Route53ResolverClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

When you create a VPC using Amazon VPC, you automatically get DNS resolution within the VPC from Route 53 Resolver. @@ -384,16 +387,16 @@ export class Route53ResolverClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-route53resolver/runtimeConfig.browser.ts b/clients/client-route53resolver/runtimeConfig.browser.ts index 8227eab7f4b0..ea448824a938 100644 --- a/clients/client-route53resolver/runtimeConfig.browser.ts +++ b/clients/client-route53resolver/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-route53resolver/runtimeConfig.native.ts b/clients/client-route53resolver/runtimeConfig.native.ts index 8cf96cc7ad42..d1646c2c7e28 100644 --- a/clients/client-route53resolver/runtimeConfig.native.ts +++ b/clients/client-route53resolver/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./Route53ResolverClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-route53resolver/runtimeConfig.ts b/clients/client-route53resolver/runtimeConfig.ts index 8f905b163c68..53af4680828b 100644 --- a/clients/client-route53resolver/runtimeConfig.ts +++ b/clients/client-route53resolver/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-s3-control/S3ControlClient.ts b/clients/client-s3-control/S3ControlClient.ts index b2347ab75ba3..2598803b1b7c 100644 --- a/clients/client-s3-control/S3ControlClient.ts +++ b/clients/client-s3-control/S3ControlClient.ts @@ -136,6 +136,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -146,6 +147,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -277,11 +279,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -323,6 +320,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type S3ControlClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -331,9 +334,9 @@ export type S3ControlClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & HostHeaderInputConfig & - S3ControlInputConfig; + S3ControlInputConfig & + UserAgentInputConfig; export type S3ControlClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -341,9 +344,9 @@ export type S3ControlClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & HostHeaderResolvedConfig & - S3ControlResolvedConfig; + S3ControlResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -368,17 +371,17 @@ export class S3ControlClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); - let _config_7 = resolveS3ControlConfig(_config_6); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveS3ControlConfig(_config_5); + let _config_7 = resolveUserAgentConfig(_config_6); super(_config_7); this.config = _config_7; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-s3-control/runtimeConfig.browser.ts b/clients/client-s3-control/runtimeConfig.browser.ts index 77cade9d06bb..7a5ad67c1de6 100644 --- a/clients/client-s3-control/runtimeConfig.browser.ts +++ b/clients/client-s3-control/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-s3-control/runtimeConfig.native.ts b/clients/client-s3-control/runtimeConfig.native.ts index d80b766e2815..3b6f6952f670 100644 --- a/clients/client-s3-control/runtimeConfig.native.ts +++ b/clients/client-s3-control/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./S3ControlClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-s3-control/runtimeConfig.ts b/clients/client-s3-control/runtimeConfig.ts index efc104aee1f1..088d314337b6 100644 --- a/clients/client-s3-control/runtimeConfig.ts +++ b/clients/client-s3-control/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-s3/S3Client.ts b/clients/client-s3/S3Client.ts index 8470e6d7778d..600a15ef27eb 100644 --- a/clients/client-s3/S3Client.ts +++ b/clients/client-s3/S3Client.ts @@ -301,6 +301,7 @@ import { StreamCollector as __StreamCollector, StreamHasher as __StreamHasher, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; import { Readable } from "stream"; @@ -537,11 +538,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -605,6 +601,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Whether to override the request region with the region inferred from requested resource's ARN. Defaults to false. */ useArnRegion?: boolean | Provider; + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + /** * The function that provides necessary utilities for generating and parsing event stream */ @@ -617,9 +619,9 @@ export type S3ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions> EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & HostHeaderInputConfig & BucketEndpointInputConfig & + UserAgentInputConfig & EventStreamSerdeInputConfig; export type S3ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & @@ -628,9 +630,9 @@ export type S3ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandler EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & HostHeaderResolvedConfig & BucketEndpointResolvedConfig & + UserAgentResolvedConfig & EventStreamSerdeResolvedConfig; /** @@ -653,21 +655,21 @@ export class S3Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); - let _config_7 = resolveBucketEndpointConfig(_config_6); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveBucketEndpointConfig(_config_5); + let _config_7 = resolveUserAgentConfig(_config_6); let _config_8 = resolveEventStreamSerdeConfig(_config_7); super(_config_8); this.config = _config_8; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); this.middlewareStack.use(getValidateBucketNamePlugin(this.config)); this.middlewareStack.use(getUseRegionalEndpointPlugin(this.config)); this.middlewareStack.use(getAddExpectContinuePlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-s3/runtimeConfig.browser.ts b/clients/client-s3/runtimeConfig.browser.ts index 3e7ed9ca99e3..a40ebe805729 100644 --- a/clients/client-s3/runtimeConfig.browser.ts +++ b/clients/client-s3/runtimeConfig.browser.ts @@ -25,7 +25,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), eventStreamSerdeProvider, maxAttempts: DEFAULT_MAX_ATTEMPTS, md5: Md5, diff --git a/clients/client-s3/runtimeConfig.native.ts b/clients/client-s3/runtimeConfig.native.ts index 4011cbdb3c47..3982fdd7d24b 100644 --- a/clients/client-s3/runtimeConfig.native.ts +++ b/clients/client-s3/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./S3Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-s3/runtimeConfig.ts b/clients/client-s3/runtimeConfig.ts index 50a05de926d4..3278b5f89d8d 100644 --- a/clients/client-s3/runtimeConfig.ts +++ b/clients/client-s3/runtimeConfig.ts @@ -28,7 +28,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), eventStreamSerdeProvider, maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), md5: Hash.bind(null, "md5"), diff --git a/clients/client-s3outposts/S3OutpostsClient.ts b/clients/client-s3outposts/S3OutpostsClient.ts index ddb0e63df845..22b37059ba05 100644 --- a/clients/client-s3outposts/S3OutpostsClient.ts +++ b/clients/client-s3outposts/S3OutpostsClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = CreateEndpointCommandInput | DeleteEndpointCommandInput | ListEndpointsCommandInput; @@ -101,11 +103,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -147,6 +144,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type S3OutpostsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -155,8 +158,8 @@ export type S3OutpostsClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type S3OutpostsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -164,8 +167,8 @@ export type S3OutpostsClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon S3 on Outposts provides access to S3 on Outposts operations.

@@ -187,16 +190,16 @@ export class S3OutpostsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-s3outposts/runtimeConfig.browser.ts b/clients/client-s3outposts/runtimeConfig.browser.ts index 6ae63da72eba..a45cef78c9b6 100644 --- a/clients/client-s3outposts/runtimeConfig.browser.ts +++ b/clients/client-s3outposts/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-s3outposts/runtimeConfig.native.ts b/clients/client-s3outposts/runtimeConfig.native.ts index 0a755860d14d..dace87cef6b2 100644 --- a/clients/client-s3outposts/runtimeConfig.native.ts +++ b/clients/client-s3outposts/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./S3OutpostsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-s3outposts/runtimeConfig.ts b/clients/client-s3outposts/runtimeConfig.ts index d739f7bd78d2..a82b2c81d9af 100644 --- a/clients/client-s3outposts/runtimeConfig.ts +++ b/clients/client-s3outposts/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sagemaker-a2i-runtime/SageMakerA2IRuntimeClient.ts b/clients/client-sagemaker-a2i-runtime/SageMakerA2IRuntimeClient.ts index e60180315db4..a474ea6b14fb 100644 --- a/clients/client-sagemaker-a2i-runtime/SageMakerA2IRuntimeClient.ts +++ b/clients/client-sagemaker-a2i-runtime/SageMakerA2IRuntimeClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -113,11 +115,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -159,6 +156,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SageMakerA2IRuntimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -167,8 +170,8 @@ export type SageMakerA2IRuntimeClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SageMakerA2IRuntimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -176,8 +179,8 @@ export type SageMakerA2IRuntimeClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * @@ -228,16 +231,16 @@ export class SageMakerA2IRuntimeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sagemaker-a2i-runtime/runtimeConfig.browser.ts b/clients/client-sagemaker-a2i-runtime/runtimeConfig.browser.ts index a292984f9787..415392b4e693 100644 --- a/clients/client-sagemaker-a2i-runtime/runtimeConfig.browser.ts +++ b/clients/client-sagemaker-a2i-runtime/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sagemaker-a2i-runtime/runtimeConfig.native.ts b/clients/client-sagemaker-a2i-runtime/runtimeConfig.native.ts index 49248f418db6..80117347da1d 100644 --- a/clients/client-sagemaker-a2i-runtime/runtimeConfig.native.ts +++ b/clients/client-sagemaker-a2i-runtime/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SageMakerA2IRuntimeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sagemaker-a2i-runtime/runtimeConfig.ts b/clients/client-sagemaker-a2i-runtime/runtimeConfig.ts index 6df54fcbdcf6..1f989b86a8db 100644 --- a/clients/client-sagemaker-a2i-runtime/runtimeConfig.ts +++ b/clients/client-sagemaker-a2i-runtime/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sagemaker-edge/SagemakerEdgeClient.ts b/clients/client-sagemaker-edge/SagemakerEdgeClient.ts index d769accc9d3d..c298595ab2da 100644 --- a/clients/client-sagemaker-edge/SagemakerEdgeClient.ts +++ b/clients/client-sagemaker-edge/SagemakerEdgeClient.ts @@ -40,6 +40,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -50,6 +51,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetDeviceRegistrationCommandInput | SendHeartbeatCommandInput; @@ -103,11 +105,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -149,6 +146,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SagemakerEdgeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -157,8 +160,8 @@ export type SagemakerEdgeClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SagemakerEdgeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -166,8 +169,8 @@ export type SagemakerEdgeClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

SageMaker Edge Manager dataplane service for communicating with active agents.

@@ -189,16 +192,16 @@ export class SagemakerEdgeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sagemaker-edge/runtimeConfig.browser.ts b/clients/client-sagemaker-edge/runtimeConfig.browser.ts index b95d7c41ca79..07691bcf0d29 100644 --- a/clients/client-sagemaker-edge/runtimeConfig.browser.ts +++ b/clients/client-sagemaker-edge/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sagemaker-edge/runtimeConfig.native.ts b/clients/client-sagemaker-edge/runtimeConfig.native.ts index b486e532174d..6ca52bb341ed 100644 --- a/clients/client-sagemaker-edge/runtimeConfig.native.ts +++ b/clients/client-sagemaker-edge/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SagemakerEdgeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sagemaker-edge/runtimeConfig.ts b/clients/client-sagemaker-edge/runtimeConfig.ts index 89e3b964d59e..b31960f514b1 100644 --- a/clients/client-sagemaker-edge/runtimeConfig.ts +++ b/clients/client-sagemaker-edge/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sagemaker-featurestore-runtime/SageMakerFeatureStoreRuntimeClient.ts b/clients/client-sagemaker-featurestore-runtime/SageMakerFeatureStoreRuntimeClient.ts index 09733c0a9a26..8fdfaaec4899 100644 --- a/clients/client-sagemaker-featurestore-runtime/SageMakerFeatureStoreRuntimeClient.ts +++ b/clients/client-sagemaker-featurestore-runtime/SageMakerFeatureStoreRuntimeClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = DeleteRecordCommandInput | GetRecordCommandInput | PutRecordCommandInput; @@ -101,11 +103,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -147,6 +144,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SageMakerFeatureStoreRuntimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -155,8 +158,8 @@ export type SageMakerFeatureStoreRuntimeClientConfig = Partial<__SmithyConfigura EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SageMakerFeatureStoreRuntimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -164,8 +167,8 @@ export type SageMakerFeatureStoreRuntimeClientResolvedConfig = __SmithyResolvedC EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Contains all data plane API operations and data types for the Amazon SageMaker Feature @@ -213,16 +216,16 @@ export class SageMakerFeatureStoreRuntimeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.browser.ts b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.browser.ts index 14f48f2b1c9b..47abf099083b 100644 --- a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.browser.ts +++ b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.native.ts b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.native.ts index ab1868223d04..ed2f094a6ab9 100644 --- a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.native.ts +++ b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SageMakerFeatureStoreRuntimeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.ts b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.ts index 4f8fa9b74adc..431e4229dc58 100644 --- a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.ts +++ b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sagemaker-runtime/SageMakerRuntimeClient.ts b/clients/client-sagemaker-runtime/SageMakerRuntimeClient.ts index 30b90bbf9b74..7fcf7639005b 100644 --- a/clients/client-sagemaker-runtime/SageMakerRuntimeClient.ts +++ b/clients/client-sagemaker-runtime/SageMakerRuntimeClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = InvokeEndpointCommandInput; @@ -99,11 +101,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -145,6 +142,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SageMakerRuntimeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -153,8 +156,8 @@ export type SageMakerRuntimeClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SageMakerRuntimeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -162,8 +165,8 @@ export type SageMakerRuntimeClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The Amazon SageMaker runtime API.

@@ -185,16 +188,16 @@ export class SageMakerRuntimeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sagemaker-runtime/runtimeConfig.browser.ts b/clients/client-sagemaker-runtime/runtimeConfig.browser.ts index ff82f4baef70..66dc79dc4bb3 100644 --- a/clients/client-sagemaker-runtime/runtimeConfig.browser.ts +++ b/clients/client-sagemaker-runtime/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sagemaker-runtime/runtimeConfig.native.ts b/clients/client-sagemaker-runtime/runtimeConfig.native.ts index 2261c4f642fa..cdaeb8c508c4 100644 --- a/clients/client-sagemaker-runtime/runtimeConfig.native.ts +++ b/clients/client-sagemaker-runtime/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SageMakerRuntimeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sagemaker-runtime/runtimeConfig.ts b/clients/client-sagemaker-runtime/runtimeConfig.ts index 66eeb877f6c0..4b0ad0de0063 100644 --- a/clients/client-sagemaker-runtime/runtimeConfig.ts +++ b/clients/client-sagemaker-runtime/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sagemaker/SageMakerClient.ts b/clients/client-sagemaker/SageMakerClient.ts index dc613c3984c9..cc89e327572c 100644 --- a/clients/client-sagemaker/SageMakerClient.ts +++ b/clients/client-sagemaker/SageMakerClient.ts @@ -601,6 +601,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -611,6 +612,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -1130,11 +1132,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -1176,6 +1173,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SageMakerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -1184,8 +1187,8 @@ export type SageMakerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SageMakerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -1193,8 +1196,8 @@ export type SageMakerClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Provides APIs for creating and managing Amazon SageMaker resources.

@@ -1231,16 +1234,16 @@ export class SageMakerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sagemaker/runtimeConfig.browser.ts b/clients/client-sagemaker/runtimeConfig.browser.ts index 0b3a61ed323d..f1ff8687fbad 100644 --- a/clients/client-sagemaker/runtimeConfig.browser.ts +++ b/clients/client-sagemaker/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sagemaker/runtimeConfig.native.ts b/clients/client-sagemaker/runtimeConfig.native.ts index 6dfb2f325c43..3741f42cc11e 100644 --- a/clients/client-sagemaker/runtimeConfig.native.ts +++ b/clients/client-sagemaker/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SageMakerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sagemaker/runtimeConfig.ts b/clients/client-sagemaker/runtimeConfig.ts index 7f42cb25dea1..32aa3687d7fc 100644 --- a/clients/client-sagemaker/runtimeConfig.ts +++ b/clients/client-sagemaker/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-savingsplans/SavingsplansClient.ts b/clients/client-savingsplans/SavingsplansClient.ts index b5095fa5a77e..fefae3c70e36 100644 --- a/clients/client-savingsplans/SavingsplansClient.ts +++ b/clients/client-savingsplans/SavingsplansClient.ts @@ -62,6 +62,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -72,6 +73,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -143,11 +145,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -189,6 +186,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SavingsplansClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -197,8 +200,8 @@ export type SavingsplansClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SavingsplansClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -206,8 +209,8 @@ export type SavingsplansClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Savings Plans are a pricing model that offer significant savings on AWS usage (for @@ -232,16 +235,16 @@ export class SavingsplansClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-savingsplans/runtimeConfig.browser.ts b/clients/client-savingsplans/runtimeConfig.browser.ts index de7d8132f165..eb401f250ce5 100644 --- a/clients/client-savingsplans/runtimeConfig.browser.ts +++ b/clients/client-savingsplans/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-savingsplans/runtimeConfig.native.ts b/clients/client-savingsplans/runtimeConfig.native.ts index 43fd9d4d9fc5..c91d78dd62dc 100644 --- a/clients/client-savingsplans/runtimeConfig.native.ts +++ b/clients/client-savingsplans/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SavingsplansClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-savingsplans/runtimeConfig.ts b/clients/client-savingsplans/runtimeConfig.ts index 06130fe386e9..0e91dc5e9069 100644 --- a/clients/client-savingsplans/runtimeConfig.ts +++ b/clients/client-savingsplans/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-schemas/SchemasClient.ts b/clients/client-schemas/SchemasClient.ts index acbd6fda9d8a..6c3b2648f53b 100644 --- a/clients/client-schemas/SchemasClient.ts +++ b/clients/client-schemas/SchemasClient.ts @@ -84,6 +84,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -94,6 +95,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -209,11 +211,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -255,6 +252,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SchemasClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -263,8 +266,8 @@ export type SchemasClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SchemasClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -272,8 +275,8 @@ export type SchemasClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon EventBridge Schema Registry

@@ -295,16 +298,16 @@ export class SchemasClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-schemas/runtimeConfig.browser.ts b/clients/client-schemas/runtimeConfig.browser.ts index e9a919557cbe..915071791fbb 100644 --- a/clients/client-schemas/runtimeConfig.browser.ts +++ b/clients/client-schemas/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-schemas/runtimeConfig.native.ts b/clients/client-schemas/runtimeConfig.native.ts index 6ec04bfab8de..51138d369373 100644 --- a/clients/client-schemas/runtimeConfig.native.ts +++ b/clients/client-schemas/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SchemasClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-schemas/runtimeConfig.ts b/clients/client-schemas/runtimeConfig.ts index f553aec4d19b..45636e8a830d 100644 --- a/clients/client-schemas/runtimeConfig.ts +++ b/clients/client-schemas/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-secrets-manager/SecretsManagerClient.ts b/clients/client-secrets-manager/SecretsManagerClient.ts index b42a55d3449b..2617bafcf3dc 100644 --- a/clients/client-secrets-manager/SecretsManagerClient.ts +++ b/clients/client-secrets-manager/SecretsManagerClient.ts @@ -66,6 +66,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -76,6 +77,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -213,6 +210,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SecretsManagerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -221,8 +224,8 @@ export type SecretsManagerClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SecretsManagerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -230,8 +233,8 @@ export type SecretsManagerClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Secrets Manager API Reference @@ -315,16 +318,16 @@ export class SecretsManagerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-secrets-manager/runtimeConfig.browser.ts b/clients/client-secrets-manager/runtimeConfig.browser.ts index 2dddda132a68..9e26246a3c46 100644 --- a/clients/client-secrets-manager/runtimeConfig.browser.ts +++ b/clients/client-secrets-manager/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-secrets-manager/runtimeConfig.native.ts b/clients/client-secrets-manager/runtimeConfig.native.ts index 657c775b8f3f..ceed11dc98bf 100644 --- a/clients/client-secrets-manager/runtimeConfig.native.ts +++ b/clients/client-secrets-manager/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SecretsManagerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-secrets-manager/runtimeConfig.ts b/clients/client-secrets-manager/runtimeConfig.ts index 8f54fe76eb28..fecf768159e7 100644 --- a/clients/client-secrets-manager/runtimeConfig.ts +++ b/clients/client-secrets-manager/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-securityhub/SecurityHubClient.ts b/clients/client-securityhub/SecurityHubClient.ts index c6da8a7cc61b..983e152215a8 100644 --- a/clients/client-securityhub/SecurityHubClient.ts +++ b/clients/client-securityhub/SecurityHubClient.ts @@ -146,6 +146,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -156,6 +157,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -305,11 +307,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -351,6 +348,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SecurityHubClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -359,8 +362,8 @@ export type SecurityHubClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SecurityHubClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -368,8 +371,8 @@ export type SecurityHubClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Security Hub provides you with a comprehensive view of the security state of your AWS @@ -445,16 +448,16 @@ export class SecurityHubClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-securityhub/runtimeConfig.browser.ts b/clients/client-securityhub/runtimeConfig.browser.ts index 895ae6aafc3a..6ba9bee2afa0 100644 --- a/clients/client-securityhub/runtimeConfig.browser.ts +++ b/clients/client-securityhub/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-securityhub/runtimeConfig.native.ts b/clients/client-securityhub/runtimeConfig.native.ts index 3521fd7b35c7..dd9d2e7caab3 100644 --- a/clients/client-securityhub/runtimeConfig.native.ts +++ b/clients/client-securityhub/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SecurityHubClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-securityhub/runtimeConfig.ts b/clients/client-securityhub/runtimeConfig.ts index ae21fc35654d..0eebedf88d71 100644 --- a/clients/client-securityhub/runtimeConfig.ts +++ b/clients/client-securityhub/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-serverlessapplicationrepository/ServerlessApplicationRepositoryClient.ts b/clients/client-serverlessapplicationrepository/ServerlessApplicationRepositoryClient.ts index bb4bc7e1bad6..6e68abcf5fe1 100644 --- a/clients/client-serverlessapplicationrepository/ServerlessApplicationRepositoryClient.ts +++ b/clients/client-serverlessapplicationrepository/ServerlessApplicationRepositoryClient.ts @@ -73,6 +73,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -83,6 +84,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -164,11 +166,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -210,6 +207,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ServerlessApplicationRepositoryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -218,8 +221,8 @@ export type ServerlessApplicationRepositoryClientConfig = Partial<__SmithyConfig EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ServerlessApplicationRepositoryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -227,8 +230,8 @@ export type ServerlessApplicationRepositoryClientResolvedConfig = __SmithyResolv EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The AWS Serverless Application Repository makes it easy for developers and enterprises to quickly find @@ -269,16 +272,16 @@ export class ServerlessApplicationRepositoryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-serverlessapplicationrepository/runtimeConfig.browser.ts b/clients/client-serverlessapplicationrepository/runtimeConfig.browser.ts index 0fedf8d4dc24..be17cfbba112 100644 --- a/clients/client-serverlessapplicationrepository/runtimeConfig.browser.ts +++ b/clients/client-serverlessapplicationrepository/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-serverlessapplicationrepository/runtimeConfig.native.ts b/clients/client-serverlessapplicationrepository/runtimeConfig.native.ts index cf2754a217ee..1c230fb24295 100644 --- a/clients/client-serverlessapplicationrepository/runtimeConfig.native.ts +++ b/clients/client-serverlessapplicationrepository/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ServerlessApplicationRepositoryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-serverlessapplicationrepository/runtimeConfig.ts b/clients/client-serverlessapplicationrepository/runtimeConfig.ts index ca18348b4e87..8fb70a7d4499 100644 --- a/clients/client-serverlessapplicationrepository/runtimeConfig.ts +++ b/clients/client-serverlessapplicationrepository/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-service-catalog-appregistry/ServiceCatalogAppRegistryClient.ts b/clients/client-service-catalog-appregistry/ServiceCatalogAppRegistryClient.ts index 5092cbcbeb02..ce2e5c2508c6 100644 --- a/clients/client-service-catalog-appregistry/ServiceCatalogAppRegistryClient.ts +++ b/clients/client-service-catalog-appregistry/ServiceCatalogAppRegistryClient.ts @@ -84,6 +84,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -94,6 +95,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ServiceCatalogAppRegistryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +242,8 @@ export type ServiceCatalogAppRegistryClientConfig = Partial<__SmithyConfiguratio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ServiceCatalogAppRegistryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +251,8 @@ export type ServiceCatalogAppRegistryClientResolvedConfig = __SmithyResolvedConf EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Service Catalog AppRegistry enables organizations to understand the application context of their AWS resources. AppRegistry provides a repository of your applications, their resources, and the application metadata that you use within your enterprise.

@@ -271,16 +274,16 @@ export class ServiceCatalogAppRegistryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-service-catalog-appregistry/runtimeConfig.browser.ts b/clients/client-service-catalog-appregistry/runtimeConfig.browser.ts index 4f451273696f..c1a44b749fce 100644 --- a/clients/client-service-catalog-appregistry/runtimeConfig.browser.ts +++ b/clients/client-service-catalog-appregistry/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-service-catalog-appregistry/runtimeConfig.native.ts b/clients/client-service-catalog-appregistry/runtimeConfig.native.ts index ee600010499f..9f3a125df0ee 100644 --- a/clients/client-service-catalog-appregistry/runtimeConfig.native.ts +++ b/clients/client-service-catalog-appregistry/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ServiceCatalogAppRegistryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-service-catalog-appregistry/runtimeConfig.ts b/clients/client-service-catalog-appregistry/runtimeConfig.ts index 78c8f1cd32c7..6b90b5bba3da 100644 --- a/clients/client-service-catalog-appregistry/runtimeConfig.ts +++ b/clients/client-service-catalog-appregistry/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-service-catalog/ServiceCatalogClient.ts b/clients/client-service-catalog/ServiceCatalogClient.ts index bec6c821a917..2ed21dbec3f7 100644 --- a/clients/client-service-catalog/ServiceCatalogClient.ts +++ b/clients/client-service-catalog/ServiceCatalogClient.ts @@ -300,6 +300,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -310,6 +311,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -533,11 +535,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -579,6 +576,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ServiceCatalogClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -587,8 +590,8 @@ export type ServiceCatalogClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ServiceCatalogClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -596,8 +599,8 @@ export type ServiceCatalogClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Service Catalog @@ -625,16 +628,16 @@ export class ServiceCatalogClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-service-catalog/runtimeConfig.browser.ts b/clients/client-service-catalog/runtimeConfig.browser.ts index afd0157c051b..77795b217d49 100644 --- a/clients/client-service-catalog/runtimeConfig.browser.ts +++ b/clients/client-service-catalog/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-service-catalog/runtimeConfig.native.ts b/clients/client-service-catalog/runtimeConfig.native.ts index 64f4d2e33b09..6e6b7c049f12 100644 --- a/clients/client-service-catalog/runtimeConfig.native.ts +++ b/clients/client-service-catalog/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ServiceCatalogClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-service-catalog/runtimeConfig.ts b/clients/client-service-catalog/runtimeConfig.ts index 9d47538a9ce3..8017131b4ba4 100644 --- a/clients/client-service-catalog/runtimeConfig.ts +++ b/clients/client-service-catalog/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-service-quotas/ServiceQuotasClient.ts b/clients/client-service-quotas/ServiceQuotasClient.ts index 678437a9809a..8bc4443ad3d0 100644 --- a/clients/client-service-quotas/ServiceQuotasClient.ts +++ b/clients/client-service-quotas/ServiceQuotasClient.ts @@ -90,6 +90,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -100,6 +101,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ServiceQuotasClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +242,8 @@ export type ServiceQuotasClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ServiceQuotasClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +251,8 @@ export type ServiceQuotasClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Service Quotas is a web service that you can use to manage many of your AWS service @@ -282,16 +285,16 @@ export class ServiceQuotasClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-service-quotas/runtimeConfig.browser.ts b/clients/client-service-quotas/runtimeConfig.browser.ts index 458ce3ce4e71..463ad036364f 100644 --- a/clients/client-service-quotas/runtimeConfig.browser.ts +++ b/clients/client-service-quotas/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-service-quotas/runtimeConfig.native.ts b/clients/client-service-quotas/runtimeConfig.native.ts index 30fe2aecdc13..48a66cb351d5 100644 --- a/clients/client-service-quotas/runtimeConfig.native.ts +++ b/clients/client-service-quotas/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ServiceQuotasClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-service-quotas/runtimeConfig.ts b/clients/client-service-quotas/runtimeConfig.ts index 91e9eefda974..ab0506d45e8d 100644 --- a/clients/client-service-quotas/runtimeConfig.ts +++ b/clients/client-service-quotas/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-servicediscovery/ServiceDiscoveryClient.ts b/clients/client-servicediscovery/ServiceDiscoveryClient.ts index d020d85f32a1..1a13f278c259 100644 --- a/clients/client-servicediscovery/ServiceDiscoveryClient.ts +++ b/clients/client-servicediscovery/ServiceDiscoveryClient.ts @@ -76,6 +76,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -86,6 +87,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -185,11 +187,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -231,6 +228,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ServiceDiscoveryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -239,8 +242,8 @@ export type ServiceDiscoveryClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ServiceDiscoveryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -248,8 +251,8 @@ export type ServiceDiscoveryClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Cloud Map lets you configure public DNS, private DNS, or HTTP namespaces that your microservice applications @@ -275,16 +278,16 @@ export class ServiceDiscoveryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-servicediscovery/runtimeConfig.browser.ts b/clients/client-servicediscovery/runtimeConfig.browser.ts index 994ee89c31f0..a3b13d5e8207 100644 --- a/clients/client-servicediscovery/runtimeConfig.browser.ts +++ b/clients/client-servicediscovery/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-servicediscovery/runtimeConfig.native.ts b/clients/client-servicediscovery/runtimeConfig.native.ts index 944f125275e0..acaccf3a0df3 100644 --- a/clients/client-servicediscovery/runtimeConfig.native.ts +++ b/clients/client-servicediscovery/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ServiceDiscoveryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-servicediscovery/runtimeConfig.ts b/clients/client-servicediscovery/runtimeConfig.ts index b7ee53509b50..ba756b546b2a 100644 --- a/clients/client-servicediscovery/runtimeConfig.ts +++ b/clients/client-servicediscovery/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-ses/SESClient.ts b/clients/client-ses/SESClient.ts index a5907055bcd9..f680612bc111 100644 --- a/clients/client-ses/SESClient.ts +++ b/clients/client-ses/SESClient.ts @@ -256,6 +256,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -266,6 +267,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -461,11 +463,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -507,6 +504,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SESClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -515,8 +518,8 @@ export type SESClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SESClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -524,8 +527,8 @@ export type SESClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Simple Email Service @@ -555,16 +558,16 @@ export class SESClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ses/runtimeConfig.browser.ts b/clients/client-ses/runtimeConfig.browser.ts index 26eb616cdfb7..d75c725b6b3e 100644 --- a/clients/client-ses/runtimeConfig.browser.ts +++ b/clients/client-ses/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ses/runtimeConfig.native.ts b/clients/client-ses/runtimeConfig.native.ts index 51f65df33326..1bb017439ca7 100644 --- a/clients/client-ses/runtimeConfig.native.ts +++ b/clients/client-ses/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SESClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ses/runtimeConfig.ts b/clients/client-ses/runtimeConfig.ts index f014c7db4057..5c1ed47b84d8 100644 --- a/clients/client-ses/runtimeConfig.ts +++ b/clients/client-ses/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sesv2/SESv2Client.ts b/clients/client-sesv2/SESv2Client.ts index aab885565596..19abbf68222d 100644 --- a/clients/client-sesv2/SESv2Client.ts +++ b/clients/client-sesv2/SESv2Client.ts @@ -283,6 +283,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -293,6 +294,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -506,11 +508,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -552,6 +549,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SESv2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -560,8 +563,8 @@ export type SESv2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SESv2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -569,8 +572,8 @@ export type SESv2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon SES API v2 @@ -611,16 +614,16 @@ export class SESv2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sesv2/runtimeConfig.browser.ts b/clients/client-sesv2/runtimeConfig.browser.ts index a540a3f32802..1dcda64649fc 100644 --- a/clients/client-sesv2/runtimeConfig.browser.ts +++ b/clients/client-sesv2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sesv2/runtimeConfig.native.ts b/clients/client-sesv2/runtimeConfig.native.ts index 643610f63256..de4ce746efe7 100644 --- a/clients/client-sesv2/runtimeConfig.native.ts +++ b/clients/client-sesv2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SESv2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sesv2/runtimeConfig.ts b/clients/client-sesv2/runtimeConfig.ts index 29dfbbbfe6c0..c10e43d09c7c 100644 --- a/clients/client-sesv2/runtimeConfig.ts +++ b/clients/client-sesv2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sfn/SFNClient.ts b/clients/client-sfn/SFNClient.ts index f900342f6236..56f5450245dc 100644 --- a/clients/client-sfn/SFNClient.ts +++ b/clients/client-sfn/SFNClient.ts @@ -70,6 +70,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -80,6 +81,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -179,11 +181,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -225,6 +222,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SFNClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -233,8 +236,8 @@ export type SFNClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SFNClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -242,8 +245,8 @@ export type SFNClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Step Functions @@ -280,16 +283,16 @@ export class SFNClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sfn/runtimeConfig.browser.ts b/clients/client-sfn/runtimeConfig.browser.ts index 29ff52e06066..feb4baba53c7 100644 --- a/clients/client-sfn/runtimeConfig.browser.ts +++ b/clients/client-sfn/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sfn/runtimeConfig.native.ts b/clients/client-sfn/runtimeConfig.native.ts index a7b55e5cb611..00d159d01f9d 100644 --- a/clients/client-sfn/runtimeConfig.native.ts +++ b/clients/client-sfn/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SFNClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sfn/runtimeConfig.ts b/clients/client-sfn/runtimeConfig.ts index afb547724557..f8216174433f 100644 --- a/clients/client-sfn/runtimeConfig.ts +++ b/clients/client-sfn/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-shield/ShieldClient.ts b/clients/client-shield/ShieldClient.ts index 927bd005b20e..176213b21ff0 100644 --- a/clients/client-shield/ShieldClient.ts +++ b/clients/client-shield/ShieldClient.ts @@ -122,6 +122,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -132,6 +133,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -245,11 +247,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -291,6 +288,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type ShieldClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -299,8 +302,8 @@ export type ShieldClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type ShieldClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -308,8 +311,8 @@ export type ShieldClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Shield Advanced @@ -334,16 +337,16 @@ export class ShieldClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-shield/runtimeConfig.browser.ts b/clients/client-shield/runtimeConfig.browser.ts index e68cfe313d51..483403f16dea 100644 --- a/clients/client-shield/runtimeConfig.browser.ts +++ b/clients/client-shield/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-shield/runtimeConfig.native.ts b/clients/client-shield/runtimeConfig.native.ts index 8c9823e405af..0ec8cbf92b19 100644 --- a/clients/client-shield/runtimeConfig.native.ts +++ b/clients/client-shield/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./ShieldClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-shield/runtimeConfig.ts b/clients/client-shield/runtimeConfig.ts index 947252f49782..720c6456ac9d 100644 --- a/clients/client-shield/runtimeConfig.ts +++ b/clients/client-shield/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-signer/SignerClient.ts b/clients/client-signer/SignerClient.ts index 7ef9a065778f..a049419b1c7a 100644 --- a/clients/client-signer/SignerClient.ts +++ b/clients/client-signer/SignerClient.ts @@ -76,6 +76,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -86,6 +87,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -173,11 +175,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -219,6 +216,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SignerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -227,8 +230,8 @@ export type SignerClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpti EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SignerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -236,8 +239,8 @@ export type SignerClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHan EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Signer is a fully managed code signing service to help you ensure the trust and @@ -275,16 +278,16 @@ export class SignerClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-signer/runtimeConfig.browser.ts b/clients/client-signer/runtimeConfig.browser.ts index 8a57aa7d2a72..1fc6924f82a8 100644 --- a/clients/client-signer/runtimeConfig.browser.ts +++ b/clients/client-signer/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-signer/runtimeConfig.native.ts b/clients/client-signer/runtimeConfig.native.ts index fbd2cc504fa7..a4baf366b894 100644 --- a/clients/client-signer/runtimeConfig.native.ts +++ b/clients/client-signer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SignerClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-signer/runtimeConfig.ts b/clients/client-signer/runtimeConfig.ts index 50a3939ca2e9..bfa850d4e9cc 100644 --- a/clients/client-signer/runtimeConfig.ts +++ b/clients/client-signer/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sms/SMSClient.ts b/clients/client-sms/SMSClient.ts index de5f6db2966d..b2e32ed217e3 100644 --- a/clients/client-sms/SMSClient.ts +++ b/clients/client-sms/SMSClient.ts @@ -130,6 +130,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -140,6 +141,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -263,11 +265,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -309,6 +306,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -317,8 +320,8 @@ export type SMSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -326,8 +329,8 @@ export type SMSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Server Migration Service @@ -365,16 +368,16 @@ export class SMSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sms/runtimeConfig.browser.ts b/clients/client-sms/runtimeConfig.browser.ts index 8232328b3c51..f832dbc9de70 100644 --- a/clients/client-sms/runtimeConfig.browser.ts +++ b/clients/client-sms/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sms/runtimeConfig.native.ts b/clients/client-sms/runtimeConfig.native.ts index 4bc1ab9e5b03..c95fc3ed6760 100644 --- a/clients/client-sms/runtimeConfig.native.ts +++ b/clients/client-sms/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SMSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sms/runtimeConfig.ts b/clients/client-sms/runtimeConfig.ts index eba8fc1d468f..75b1b996e8aa 100644 --- a/clients/client-sms/runtimeConfig.ts +++ b/clients/client-sms/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-snowball/SnowballClient.ts b/clients/client-snowball/SnowballClient.ts index 8e4333a77d91..c5a65cc2291a 100644 --- a/clients/client-snowball/SnowballClient.ts +++ b/clients/client-snowball/SnowballClient.ts @@ -69,6 +69,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -79,6 +80,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -176,11 +178,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -222,6 +219,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SnowballClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -230,8 +233,8 @@ export type SnowballClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SnowballClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -239,8 +242,8 @@ export type SnowballClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Snow Family is a petabyte-scale data transport solution that uses secure devices to @@ -268,16 +271,16 @@ export class SnowballClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-snowball/runtimeConfig.browser.ts b/clients/client-snowball/runtimeConfig.browser.ts index 6d4ae01f4a08..2f20490bf5cb 100644 --- a/clients/client-snowball/runtimeConfig.browser.ts +++ b/clients/client-snowball/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-snowball/runtimeConfig.native.ts b/clients/client-snowball/runtimeConfig.native.ts index ec4eea64dda5..2d91706b1deb 100644 --- a/clients/client-snowball/runtimeConfig.native.ts +++ b/clients/client-snowball/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SnowballClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-snowball/runtimeConfig.ts b/clients/client-snowball/runtimeConfig.ts index 5bb03ff89839..0f406bd951a7 100644 --- a/clients/client-snowball/runtimeConfig.ts +++ b/clients/client-snowball/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sns/SNSClient.ts b/clients/client-sns/SNSClient.ts index 70e7b0484367..7c4ebd797298 100644 --- a/clients/client-sns/SNSClient.ts +++ b/clients/client-sns/SNSClient.ts @@ -116,6 +116,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -126,6 +127,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -245,11 +247,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -291,6 +288,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SNSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -299,8 +302,8 @@ export type SNSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SNSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -308,8 +311,8 @@ export type SNSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Simple Notification Service @@ -344,16 +347,16 @@ export class SNSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sns/runtimeConfig.browser.ts b/clients/client-sns/runtimeConfig.browser.ts index 7a32870c3743..6fa0f51b1f04 100644 --- a/clients/client-sns/runtimeConfig.browser.ts +++ b/clients/client-sns/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sns/runtimeConfig.native.ts b/clients/client-sns/runtimeConfig.native.ts index afffe3918372..d2f5fa43ba09 100644 --- a/clients/client-sns/runtimeConfig.native.ts +++ b/clients/client-sns/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SNSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sns/runtimeConfig.ts b/clients/client-sns/runtimeConfig.ts index 9cdebd29a802..44bc42336700 100644 --- a/clients/client-sns/runtimeConfig.ts +++ b/clients/client-sns/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sqs/SQSClient.ts b/clients/client-sqs/SQSClient.ts index f046232304d7..d14932fab11b 100644 --- a/clients/client-sqs/SQSClient.ts +++ b/clients/client-sqs/SQSClient.ts @@ -64,6 +64,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -74,6 +75,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -219,6 +216,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * that computes MD5 hashes */ md5?: __HashConstructor; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SQSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -227,8 +230,8 @@ export type SQSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SQSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -236,8 +239,8 @@ export type SQSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Welcome to the Amazon Simple Queue Service API Reference.

@@ -327,16 +330,16 @@ export class SQSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sqs/runtimeConfig.browser.ts b/clients/client-sqs/runtimeConfig.browser.ts index c7810b4c2efc..764ee1f356da 100644 --- a/clients/client-sqs/runtimeConfig.browser.ts +++ b/clients/client-sqs/runtimeConfig.browser.ts @@ -23,7 +23,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, md5: Md5, region: invalidAsyncFunction("Region is missing") as any, diff --git a/clients/client-sqs/runtimeConfig.native.ts b/clients/client-sqs/runtimeConfig.native.ts index 382075f73268..747f3fc27b68 100644 --- a/clients/client-sqs/runtimeConfig.native.ts +++ b/clients/client-sqs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SQSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sqs/runtimeConfig.ts b/clients/client-sqs/runtimeConfig.ts index 1bd7ef89c53b..856c80d245c4 100644 --- a/clients/client-sqs/runtimeConfig.ts +++ b/clients/client-sqs/runtimeConfig.ts @@ -25,7 +25,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), md5: Hash.bind(null, "md5"), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), diff --git a/clients/client-ssm/SSMClient.ts b/clients/client-ssm/SSMClient.ts index df1d89e3066d..03532a9f7a0b 100644 --- a/clients/client-ssm/SSMClient.ts +++ b/clients/client-ssm/SSMClient.ts @@ -411,6 +411,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -421,6 +422,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -728,11 +730,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -774,6 +771,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SSMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -782,8 +785,8 @@ export type SSMClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SSMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -791,8 +794,8 @@ export type SSMClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Systems Manager @@ -827,16 +830,16 @@ export class SSMClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-ssm/runtimeConfig.browser.ts b/clients/client-ssm/runtimeConfig.browser.ts index 188eb31b35b2..fa23d9f2cd18 100644 --- a/clients/client-ssm/runtimeConfig.browser.ts +++ b/clients/client-ssm/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-ssm/runtimeConfig.native.ts b/clients/client-ssm/runtimeConfig.native.ts index fc2dc4d37ef4..9152a78f57a4 100644 --- a/clients/client-ssm/runtimeConfig.native.ts +++ b/clients/client-ssm/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SSMClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-ssm/runtimeConfig.ts b/clients/client-ssm/runtimeConfig.ts index c6629bfe3fa0..c35b49f5dcb3 100644 --- a/clients/client-ssm/runtimeConfig.ts +++ b/clients/client-ssm/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sso-admin/SSOAdminClient.ts b/clients/client-sso-admin/SSOAdminClient.ts index 4fbab42fab83..f8bcfcc00bd3 100644 --- a/clients/client-sso-admin/SSOAdminClient.ts +++ b/clients/client-sso-admin/SSOAdminClient.ts @@ -147,6 +147,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -157,6 +158,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -272,11 +274,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -318,6 +315,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SSOAdminClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -326,8 +329,8 @@ export type SSOAdminClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SSOAdminClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -335,8 +338,8 @@ export type SSOAdminClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; export class SSOAdminClient extends __Client< __HttpHandlerOptions, @@ -355,16 +358,16 @@ export class SSOAdminClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sso-admin/runtimeConfig.browser.ts b/clients/client-sso-admin/runtimeConfig.browser.ts index ff78878335bc..827f3a688623 100644 --- a/clients/client-sso-admin/runtimeConfig.browser.ts +++ b/clients/client-sso-admin/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sso-admin/runtimeConfig.native.ts b/clients/client-sso-admin/runtimeConfig.native.ts index 65e01ed51b19..7f6c1a49eb89 100644 --- a/clients/client-sso-admin/runtimeConfig.native.ts +++ b/clients/client-sso-admin/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SSOAdminClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sso-admin/runtimeConfig.ts b/clients/client-sso-admin/runtimeConfig.ts index 13a07e4a37c7..69f0205fd625 100644 --- a/clients/client-sso-admin/runtimeConfig.ts +++ b/clients/client-sso-admin/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sso-oidc/SSOOIDCClient.ts b/clients/client-sso-oidc/SSOOIDCClient.ts index c83e0ea34162..4fa412bb3f5c 100644 --- a/clients/client-sso-oidc/SSOOIDCClient.ts +++ b/clients/client-sso-oidc/SSOOIDCClient.ts @@ -36,6 +36,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -46,6 +47,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -105,11 +107,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -151,6 +148,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SSOOIDCClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -159,8 +162,8 @@ export type SSOOIDCClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SSOOIDCClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -168,8 +171,8 @@ export type SSOOIDCClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Single Sign-On (SSO) OpenID Connect (OIDC) is a web service that enables a client @@ -208,15 +211,15 @@ export class SSOOIDCClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sso-oidc/runtimeConfig.browser.ts b/clients/client-sso-oidc/runtimeConfig.browser.ts index c1f6b89f069a..d1cb30d36219 100644 --- a/clients/client-sso-oidc/runtimeConfig.browser.ts +++ b/clients/client-sso-oidc/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sso-oidc/runtimeConfig.native.ts b/clients/client-sso-oidc/runtimeConfig.native.ts index 2d6edb1f73af..ca0e0299d2f0 100644 --- a/clients/client-sso-oidc/runtimeConfig.native.ts +++ b/clients/client-sso-oidc/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SSOOIDCClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sso-oidc/runtimeConfig.ts b/clients/client-sso-oidc/runtimeConfig.ts index bb96ed7e7160..2007407b2752 100644 --- a/clients/client-sso-oidc/runtimeConfig.ts +++ b/clients/client-sso-oidc/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sso/SSOClient.ts b/clients/client-sso/SSOClient.ts index 78f0f7250c8e..8fb13c50c89b 100644 --- a/clients/client-sso/SSOClient.ts +++ b/clients/client-sso/SSOClient.ts @@ -34,6 +34,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -44,6 +45,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -105,11 +107,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -151,6 +148,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SSOClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -159,8 +162,8 @@ export type SSOClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SSOClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -168,8 +171,8 @@ export type SSOClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Single Sign-On Portal is a web service that makes it easy for you to assign user @@ -206,15 +209,15 @@ export class SSOClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sso/runtimeConfig.browser.ts b/clients/client-sso/runtimeConfig.browser.ts index e0586f6519e2..9df1925afc84 100644 --- a/clients/client-sso/runtimeConfig.browser.ts +++ b/clients/client-sso/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sso/runtimeConfig.native.ts b/clients/client-sso/runtimeConfig.native.ts index d8ad68c511e8..3ad0db426b84 100644 --- a/clients/client-sso/runtimeConfig.native.ts +++ b/clients/client-sso/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SSOClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sso/runtimeConfig.ts b/clients/client-sso/runtimeConfig.ts index 789068a8fee1..3d0de7113633 100644 --- a/clients/client-sso/runtimeConfig.ts +++ b/clients/client-sso/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-storage-gateway/StorageGatewayClient.ts b/clients/client-storage-gateway/StorageGatewayClient.ts index e19ddd02316c..fbf36f0be18d 100644 --- a/clients/client-storage-gateway/StorageGatewayClient.ts +++ b/clients/client-storage-gateway/StorageGatewayClient.ts @@ -254,6 +254,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -264,6 +265,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -485,11 +487,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -531,6 +528,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type StorageGatewayClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -539,8 +542,8 @@ export type StorageGatewayClientConfig = Partial<__SmithyConfiguration<__HttpHan EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type StorageGatewayClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -548,8 +551,8 @@ export type StorageGatewayClientResolvedConfig = __SmithyResolvedConfiguration<_ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Storage Gateway Service @@ -642,16 +645,16 @@ export class StorageGatewayClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-storage-gateway/runtimeConfig.browser.ts b/clients/client-storage-gateway/runtimeConfig.browser.ts index 66830ce32ac7..bd6ffe278c2e 100644 --- a/clients/client-storage-gateway/runtimeConfig.browser.ts +++ b/clients/client-storage-gateway/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-storage-gateway/runtimeConfig.native.ts b/clients/client-storage-gateway/runtimeConfig.native.ts index cc6d1c0ac637..ce154893764f 100644 --- a/clients/client-storage-gateway/runtimeConfig.native.ts +++ b/clients/client-storage-gateway/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./StorageGatewayClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-storage-gateway/runtimeConfig.ts b/clients/client-storage-gateway/runtimeConfig.ts index 8c73ede9abd2..05ca1184f758 100644 --- a/clients/client-storage-gateway/runtimeConfig.ts +++ b/clients/client-storage-gateway/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-sts/STSClient.ts b/clients/client-sts/STSClient.ts index b5554ddbccc2..11b25d8e1db4 100644 --- a/clients/client-sts/STSClient.ts +++ b/clients/client-sts/STSClient.ts @@ -44,6 +44,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -54,6 +55,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -123,11 +125,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -169,6 +166,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type STSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -177,8 +180,8 @@ export type STSClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type STSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -186,8 +189,8 @@ export type STSClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Security Token Service @@ -213,15 +216,15 @@ export class STSClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-sts/runtimeConfig.browser.ts b/clients/client-sts/runtimeConfig.browser.ts index 51151068b48d..9b88b1c246ed 100644 --- a/clients/client-sts/runtimeConfig.browser.ts +++ b/clients/client-sts/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-sts/runtimeConfig.native.ts b/clients/client-sts/runtimeConfig.native.ts index 5161b3c6ef3e..18c5e144a2e0 100644 --- a/clients/client-sts/runtimeConfig.native.ts +++ b/clients/client-sts/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./STSClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-sts/runtimeConfig.ts b/clients/client-sts/runtimeConfig.ts index 7b79d9cf829b..742e5a0e0532 100644 --- a/clients/client-sts/runtimeConfig.ts +++ b/clients/client-sts/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-support/SupportClient.ts b/clients/client-support/SupportClient.ts index effc949b286a..e1b70744ef57 100644 --- a/clients/client-support/SupportClient.ts +++ b/clients/client-support/SupportClient.ts @@ -76,6 +76,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -86,6 +87,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -167,11 +169,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -213,6 +210,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SupportClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -221,8 +224,8 @@ export type SupportClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOpt EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SupportClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -230,8 +233,8 @@ export type SupportClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHa EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * AWS Support @@ -329,16 +332,16 @@ export class SupportClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-support/runtimeConfig.browser.ts b/clients/client-support/runtimeConfig.browser.ts index 7263a91ad562..9c2064edbee9 100644 --- a/clients/client-support/runtimeConfig.browser.ts +++ b/clients/client-support/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-support/runtimeConfig.native.ts b/clients/client-support/runtimeConfig.native.ts index 91f90d7b1057..dc58990668d1 100644 --- a/clients/client-support/runtimeConfig.native.ts +++ b/clients/client-support/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SupportClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-support/runtimeConfig.ts b/clients/client-support/runtimeConfig.ts index 6eb899b68ab3..5ba10887af15 100644 --- a/clients/client-support/runtimeConfig.ts +++ b/clients/client-support/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-swf/SWFClient.ts b/clients/client-swf/SWFClient.ts index 0bca73e993ff..6f37c1c72344 100644 --- a/clients/client-swf/SWFClient.ts +++ b/clients/client-swf/SWFClient.ts @@ -156,6 +156,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -166,6 +167,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -293,11 +295,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -339,6 +336,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SWFClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -347,8 +350,8 @@ export type SWFClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SWFClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -356,8 +359,8 @@ export type SWFClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon Simple Workflow Service @@ -394,16 +397,16 @@ export class SWFClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-swf/runtimeConfig.browser.ts b/clients/client-swf/runtimeConfig.browser.ts index 59c0a7d26b5d..b6754ff11c96 100644 --- a/clients/client-swf/runtimeConfig.browser.ts +++ b/clients/client-swf/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-swf/runtimeConfig.native.ts b/clients/client-swf/runtimeConfig.native.ts index ff1e21573c41..2049ed2381d6 100644 --- a/clients/client-swf/runtimeConfig.native.ts +++ b/clients/client-swf/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SWFClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-swf/runtimeConfig.ts b/clients/client-swf/runtimeConfig.ts index 3e1b30d286a8..957d607a73b2 100644 --- a/clients/client-swf/runtimeConfig.ts +++ b/clients/client-swf/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-synthetics/SyntheticsClient.ts b/clients/client-synthetics/SyntheticsClient.ts index af58ef094e42..2f915eaca196 100644 --- a/clients/client-synthetics/SyntheticsClient.ts +++ b/clients/client-synthetics/SyntheticsClient.ts @@ -57,6 +57,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -67,6 +68,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -146,11 +148,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -192,6 +189,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type SyntheticsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -200,8 +203,8 @@ export type SyntheticsClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type SyntheticsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -209,8 +212,8 @@ export type SyntheticsClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon CloudWatch Synthetics @@ -247,16 +250,16 @@ export class SyntheticsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-synthetics/runtimeConfig.browser.ts b/clients/client-synthetics/runtimeConfig.browser.ts index 3178cc9c86a2..7b5d4d70637f 100644 --- a/clients/client-synthetics/runtimeConfig.browser.ts +++ b/clients/client-synthetics/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-synthetics/runtimeConfig.native.ts b/clients/client-synthetics/runtimeConfig.native.ts index e642b1b41832..4710dc382000 100644 --- a/clients/client-synthetics/runtimeConfig.native.ts +++ b/clients/client-synthetics/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./SyntheticsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-synthetics/runtimeConfig.ts b/clients/client-synthetics/runtimeConfig.ts index 56db6357918b..8fb6861a42c2 100644 --- a/clients/client-synthetics/runtimeConfig.ts +++ b/clients/client-synthetics/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-textract/TextractClient.ts b/clients/client-textract/TextractClient.ts index f44c90ae4197..cfa893d50f79 100644 --- a/clients/client-textract/TextractClient.ts +++ b/clients/client-textract/TextractClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -128,11 +130,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -174,6 +171,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type TextractClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -182,8 +185,8 @@ export type TextractClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TextractClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -191,8 +194,8 @@ export type TextractClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Textract detects and analyzes text in documents and converts it @@ -216,16 +219,16 @@ export class TextractClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-textract/runtimeConfig.browser.ts b/clients/client-textract/runtimeConfig.browser.ts index 7c9195aaf64e..11de7ecefc85 100644 --- a/clients/client-textract/runtimeConfig.browser.ts +++ b/clients/client-textract/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-textract/runtimeConfig.native.ts b/clients/client-textract/runtimeConfig.native.ts index 35710800d3e5..fed2a54e79dc 100644 --- a/clients/client-textract/runtimeConfig.native.ts +++ b/clients/client-textract/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TextractClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-textract/runtimeConfig.ts b/clients/client-textract/runtimeConfig.ts index 6205f94126f6..954379f3b33d 100644 --- a/clients/client-textract/runtimeConfig.ts +++ b/clients/client-textract/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-timestream-query/TimestreamQueryClient.ts b/clients/client-timestream-query/TimestreamQueryClient.ts index 2ba271e919db..d81e8332a021 100644 --- a/clients/client-timestream-query/TimestreamQueryClient.ts +++ b/clients/client-timestream-query/TimestreamQueryClient.ts @@ -38,6 +38,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -48,6 +49,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = CancelQueryCommandInput | DescribeEndpointsCommandInput | QueryCommandInput; @@ -101,11 +103,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -147,6 +144,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type TimestreamQueryClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -155,8 +158,8 @@ export type TimestreamQueryClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TimestreamQueryClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -164,8 +167,8 @@ export type TimestreamQueryClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

@@ -189,16 +192,16 @@ export class TimestreamQueryClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-timestream-query/runtimeConfig.browser.ts b/clients/client-timestream-query/runtimeConfig.browser.ts index 344860992f16..5169263f83ee 100644 --- a/clients/client-timestream-query/runtimeConfig.browser.ts +++ b/clients/client-timestream-query/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-timestream-query/runtimeConfig.native.ts b/clients/client-timestream-query/runtimeConfig.native.ts index f2dad327a360..f1dc5f589115 100644 --- a/clients/client-timestream-query/runtimeConfig.native.ts +++ b/clients/client-timestream-query/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TimestreamQueryClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-timestream-query/runtimeConfig.ts b/clients/client-timestream-query/runtimeConfig.ts index 796e40438c88..f3122f7b721d 100644 --- a/clients/client-timestream-query/runtimeConfig.ts +++ b/clients/client-timestream-query/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-timestream-write/TimestreamWriteClient.ts b/clients/client-timestream-write/TimestreamWriteClient.ts index a0641cc2f60e..a5dab4897125 100644 --- a/clients/client-timestream-write/TimestreamWriteClient.ts +++ b/clients/client-timestream-write/TimestreamWriteClient.ts @@ -53,6 +53,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -63,6 +64,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -146,11 +148,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -192,6 +189,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type TimestreamWriteClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -200,8 +203,8 @@ export type TimestreamWriteClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TimestreamWriteClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -209,8 +212,8 @@ export type TimestreamWriteClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon Timestream is a fast, scalable, fully managed time series database service that makes it easy to store and analyze trillions of time series data points per day. With Timestream, you can easily store and analyze IoT sensor data to derive insights from your IoT applications. You can analyze industrial telemetry to streamline equipment management and maintenance. You can also store and analyze log data and metrics to improve the performance and availability of your applications. Timestream is built from the ground up to effectively ingest, process, and store time series data. It organizes data to optimize query processing. It automatically scales based on the volume of data ingested and on the query volume to ensure you receive optimal performance while inserting and querying data. As your data grows over time, Timestream’s adaptive query processing engine spans across storage tiers to provide fast analysis while reducing costs.

@@ -232,16 +235,16 @@ export class TimestreamWriteClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-timestream-write/runtimeConfig.browser.ts b/clients/client-timestream-write/runtimeConfig.browser.ts index c9ababccb0db..7fd541135e2a 100644 --- a/clients/client-timestream-write/runtimeConfig.browser.ts +++ b/clients/client-timestream-write/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-timestream-write/runtimeConfig.native.ts b/clients/client-timestream-write/runtimeConfig.native.ts index 88055c11c8d4..764bd1a27223 100644 --- a/clients/client-timestream-write/runtimeConfig.native.ts +++ b/clients/client-timestream-write/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TimestreamWriteClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-timestream-write/runtimeConfig.ts b/clients/client-timestream-write/runtimeConfig.ts index f0b8a1d5a275..da2ac11edbf3 100644 --- a/clients/client-timestream-write/runtimeConfig.ts +++ b/clients/client-timestream-write/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-transcribe-streaming/TranscribeStreamingClient.ts b/clients/client-transcribe-streaming/TranscribeStreamingClient.ts index aa7ff40c3a8b..b2cdef2c16d4 100644 --- a/clients/client-transcribe-streaming/TranscribeStreamingClient.ts +++ b/clients/client-transcribe-streaming/TranscribeStreamingClient.ts @@ -59,6 +59,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -71,6 +72,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = StartMedicalStreamTranscriptionCommandInput | StartStreamTranscriptionCommandInput; @@ -124,11 +126,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -176,6 +173,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ eventStreamPayloadHandlerProvider?: __EventStreamPayloadHandlerProvider; + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + /** * The function that provides necessary utilities for generating and parsing event stream */ @@ -188,10 +191,10 @@ export type TranscribeStreamingClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & HostHeaderInputConfig & EventStreamInputConfig & WebSocketInputConfig & + UserAgentInputConfig & EventStreamSerdeInputConfig; export type TranscribeStreamingClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & @@ -200,10 +203,10 @@ export type TranscribeStreamingClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & HostHeaderResolvedConfig & EventStreamResolvedConfig & WebSocketResolvedConfig & + UserAgentResolvedConfig & EventStreamSerdeResolvedConfig; /** @@ -226,20 +229,20 @@ export class TranscribeStreamingClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); - let _config_7 = resolveEventStreamConfig(_config_6); - let _config_8 = resolveWebSocketConfig(_config_7); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveEventStreamConfig(_config_5); + let _config_7 = resolveWebSocketConfig(_config_6); + let _config_8 = resolveUserAgentConfig(_config_7); let _config_9 = resolveEventStreamSerdeConfig(_config_8); super(_config_9); this.config = _config_9; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); this.middlewareStack.use(getWebSocketPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-transcribe-streaming/runtimeConfig.browser.ts b/clients/client-transcribe-streaming/runtimeConfig.browser.ts index 4657be4850b7..275e7b9b13ea 100644 --- a/clients/client-transcribe-streaming/runtimeConfig.browser.ts +++ b/clients/client-transcribe-streaming/runtimeConfig.browser.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), eventStreamPayloadHandlerProvider: () => eventStreamPayloadHandler, eventStreamSerdeProvider, maxAttempts: DEFAULT_MAX_ATTEMPTS, diff --git a/clients/client-transcribe-streaming/runtimeConfig.native.ts b/clients/client-transcribe-streaming/runtimeConfig.native.ts index e9dfb74bf535..c5de4261d573 100644 --- a/clients/client-transcribe-streaming/runtimeConfig.native.ts +++ b/clients/client-transcribe-streaming/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { WebSocketHandler, eventStreamPayloadHandler } from "@aws-sdk/middleware-sdk-transcribe-streaming"; import { parseUrl } from "@aws-sdk/url-parser-node"; @@ -12,7 +10,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, eventStreamPayloadHandlerProvider: () => eventStreamPayloadHandler, requestHandler: new WebSocketHandler(), sha256: Sha256, diff --git a/clients/client-transcribe-streaming/runtimeConfig.ts b/clients/client-transcribe-streaming/runtimeConfig.ts index 5af99a4b1355..26e5f5bec386 100644 --- a/clients/client-transcribe-streaming/runtimeConfig.ts +++ b/clients/client-transcribe-streaming/runtimeConfig.ts @@ -26,7 +26,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), eventStreamPayloadHandlerProvider, eventStreamSerdeProvider, maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), diff --git a/clients/client-transcribe/TranscribeClient.ts b/clients/client-transcribe/TranscribeClient.ts index 3bd7170fc4b3..061eacf8efa6 100644 --- a/clients/client-transcribe/TranscribeClient.ts +++ b/clients/client-transcribe/TranscribeClient.ts @@ -125,6 +125,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -135,6 +136,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -242,11 +244,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -288,6 +285,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type TranscribeClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -296,8 +299,8 @@ export type TranscribeClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TranscribeClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -305,8 +308,8 @@ export type TranscribeClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Operations and objects for transcribing speech to text.

@@ -328,16 +331,16 @@ export class TranscribeClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-transcribe/runtimeConfig.browser.ts b/clients/client-transcribe/runtimeConfig.browser.ts index fe63667d1115..06eb8ccd38ce 100644 --- a/clients/client-transcribe/runtimeConfig.browser.ts +++ b/clients/client-transcribe/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-transcribe/runtimeConfig.native.ts b/clients/client-transcribe/runtimeConfig.native.ts index 2f32f23632c6..2e3c754e7de3 100644 --- a/clients/client-transcribe/runtimeConfig.native.ts +++ b/clients/client-transcribe/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TranscribeClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-transcribe/runtimeConfig.ts b/clients/client-transcribe/runtimeConfig.ts index de3621cfa373..8a6f385abcb0 100644 --- a/clients/client-transcribe/runtimeConfig.ts +++ b/clients/client-transcribe/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-transfer/TransferClient.ts b/clients/client-transfer/TransferClient.ts index 8aea33e09ce8..d12c9c805a35 100644 --- a/clients/client-transfer/TransferClient.ts +++ b/clients/client-transfer/TransferClient.ts @@ -67,6 +67,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -77,6 +78,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -170,11 +172,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -216,6 +213,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type TransferClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -224,8 +227,8 @@ export type TransferClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TransferClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -233,8 +236,8 @@ export type TransferClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS Transfer Family is a fully managed service that enables the transfer of files over the @@ -264,16 +267,16 @@ export class TransferClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-transfer/runtimeConfig.browser.ts b/clients/client-transfer/runtimeConfig.browser.ts index 0d93781eac69..213ee1a26176 100644 --- a/clients/client-transfer/runtimeConfig.browser.ts +++ b/clients/client-transfer/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-transfer/runtimeConfig.native.ts b/clients/client-transfer/runtimeConfig.native.ts index c862aa79ea00..b92ae70576e4 100644 --- a/clients/client-transfer/runtimeConfig.native.ts +++ b/clients/client-transfer/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TransferClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-transfer/runtimeConfig.ts b/clients/client-transfer/runtimeConfig.ts index 972871d41fab..a7f7a04ff9f7 100644 --- a/clients/client-transfer/runtimeConfig.ts +++ b/clients/client-transfer/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-translate/TranslateClient.ts b/clients/client-translate/TranslateClient.ts index 4329be8139ff..f3c67cff83fb 100644 --- a/clients/client-translate/TranslateClient.ts +++ b/clients/client-translate/TranslateClient.ts @@ -61,6 +61,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -71,6 +72,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -152,11 +154,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -198,6 +195,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type TranslateClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -206,8 +209,8 @@ export type TranslateClientConfig = Partial<__SmithyConfiguration<__HttpHandlerO EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type TranslateClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -215,8 +218,8 @@ export type TranslateClientResolvedConfig = __SmithyResolvedConfiguration<__Http EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Provides translation between one source language and another of the same set of @@ -239,16 +242,16 @@ export class TranslateClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-translate/runtimeConfig.browser.ts b/clients/client-translate/runtimeConfig.browser.ts index 3dc5a28957f9..6f390efa0477 100644 --- a/clients/client-translate/runtimeConfig.browser.ts +++ b/clients/client-translate/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-translate/runtimeConfig.native.ts b/clients/client-translate/runtimeConfig.native.ts index e6bd39b75c17..6fdd202c6526 100644 --- a/clients/client-translate/runtimeConfig.native.ts +++ b/clients/client-translate/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./TranslateClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-translate/runtimeConfig.ts b/clients/client-translate/runtimeConfig.ts index 06c4382f3723..abc996f0c3ad 100644 --- a/clients/client-translate/runtimeConfig.ts +++ b/clients/client-translate/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-waf-regional/WAFRegionalClient.ts b/clients/client-waf-regional/WAFRegionalClient.ts index 997a77ed2c41..043237022cf2 100644 --- a/clients/client-waf-regional/WAFRegionalClient.ts +++ b/clients/client-waf-regional/WAFRegionalClient.ts @@ -221,6 +221,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -231,6 +232,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -446,11 +448,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -492,6 +489,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type WAFRegionalClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -500,8 +503,8 @@ export type WAFRegionalClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WAFRegionalClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -509,8 +512,8 @@ export type WAFRegionalClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * @@ -542,16 +545,16 @@ export class WAFRegionalClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-waf-regional/runtimeConfig.browser.ts b/clients/client-waf-regional/runtimeConfig.browser.ts index 2607d15e9099..53e6577de3fd 100644 --- a/clients/client-waf-regional/runtimeConfig.browser.ts +++ b/clients/client-waf-regional/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-waf-regional/runtimeConfig.native.ts b/clients/client-waf-regional/runtimeConfig.native.ts index ada1c500934c..bc6f447ea9be 100644 --- a/clients/client-waf-regional/runtimeConfig.native.ts +++ b/clients/client-waf-regional/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WAFRegionalClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-waf-regional/runtimeConfig.ts b/clients/client-waf-regional/runtimeConfig.ts index 2527c3913844..b4aae97be0bc 100644 --- a/clients/client-waf-regional/runtimeConfig.ts +++ b/clients/client-waf-regional/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-waf/WAFClient.ts b/clients/client-waf/WAFClient.ts index e42413b83594..99b4786d82d7 100644 --- a/clients/client-waf/WAFClient.ts +++ b/clients/client-waf/WAFClient.ts @@ -211,6 +211,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -221,6 +222,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -428,11 +430,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -474,6 +471,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type WAFClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -482,8 +485,8 @@ export type WAFClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WAFClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -491,8 +494,8 @@ export type WAFClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandle EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * @@ -524,16 +527,16 @@ export class WAFClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-waf/runtimeConfig.browser.ts b/clients/client-waf/runtimeConfig.browser.ts index f91cf67d9a88..6320a2adf8c8 100644 --- a/clients/client-waf/runtimeConfig.browser.ts +++ b/clients/client-waf/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-waf/runtimeConfig.native.ts b/clients/client-waf/runtimeConfig.native.ts index 1f15f0fbe641..c1e3c02236bb 100644 --- a/clients/client-waf/runtimeConfig.native.ts +++ b/clients/client-waf/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WAFClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-waf/runtimeConfig.ts b/clients/client-waf/runtimeConfig.ts index 2d058499eb91..685211865b97 100644 --- a/clients/client-waf/runtimeConfig.ts +++ b/clients/client-waf/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-wafv2/WAFV2Client.ts b/clients/client-wafv2/WAFV2Client.ts index 7b291054c4de..8a1a48d53e73 100644 --- a/clients/client-wafv2/WAFV2Client.ts +++ b/clients/client-wafv2/WAFV2Client.ts @@ -129,6 +129,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -139,6 +140,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -272,11 +274,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -318,6 +315,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type WAFV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -326,8 +329,8 @@ export type WAFV2ClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptio EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WAFV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -335,8 +338,8 @@ export type WAFV2ClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHand EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * @@ -414,16 +417,16 @@ export class WAFV2Client extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-wafv2/runtimeConfig.browser.ts b/clients/client-wafv2/runtimeConfig.browser.ts index d724f23f635d..78ea50474f8e 100644 --- a/clients/client-wafv2/runtimeConfig.browser.ts +++ b/clients/client-wafv2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-wafv2/runtimeConfig.native.ts b/clients/client-wafv2/runtimeConfig.native.ts index 6d4f6ffe94a1..e8f9e21c4f94 100644 --- a/clients/client-wafv2/runtimeConfig.native.ts +++ b/clients/client-wafv2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WAFV2Client"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-wafv2/runtimeConfig.ts b/clients/client-wafv2/runtimeConfig.ts index 938f7f6d8979..89a685ab2985 100644 --- a/clients/client-wafv2/runtimeConfig.ts +++ b/clients/client-wafv2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-workdocs/WorkDocsClient.ts b/clients/client-workdocs/WorkDocsClient.ts index bceaa86fe5f6..856abfb1912b 100644 --- a/clients/client-workdocs/WorkDocsClient.ts +++ b/clients/client-workdocs/WorkDocsClient.ts @@ -124,6 +124,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -134,6 +135,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -269,11 +271,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -315,6 +312,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type WorkDocsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -323,8 +326,8 @@ export type WorkDocsClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WorkDocsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -332,8 +335,8 @@ export type WorkDocsClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The WorkDocs API is designed for the following use cases:

@@ -387,16 +390,16 @@ export class WorkDocsClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-workdocs/runtimeConfig.browser.ts b/clients/client-workdocs/runtimeConfig.browser.ts index e20215bf0c63..5754fdb8e48b 100644 --- a/clients/client-workdocs/runtimeConfig.browser.ts +++ b/clients/client-workdocs/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-workdocs/runtimeConfig.native.ts b/clients/client-workdocs/runtimeConfig.native.ts index 8937246365f1..5c9b238d1b67 100644 --- a/clients/client-workdocs/runtimeConfig.native.ts +++ b/clients/client-workdocs/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WorkDocsClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-workdocs/runtimeConfig.ts b/clients/client-workdocs/runtimeConfig.ts index 458f9b20e533..48473183c7c2 100644 --- a/clients/client-workdocs/runtimeConfig.ts +++ b/clients/client-workdocs/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-worklink/WorkLinkClient.ts b/clients/client-worklink/WorkLinkClient.ts index e9ae05b9e611..d443344bf044 100644 --- a/clients/client-worklink/WorkLinkClient.ts +++ b/clients/client-worklink/WorkLinkClient.ts @@ -128,6 +128,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -138,6 +139,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -257,11 +259,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -303,6 +300,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type WorkLinkClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -311,8 +314,8 @@ export type WorkLinkClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WorkLinkClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -320,8 +323,8 @@ export type WorkLinkClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon WorkLink is a cloud-based service that provides secure access @@ -349,16 +352,16 @@ export class WorkLinkClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-worklink/runtimeConfig.browser.ts b/clients/client-worklink/runtimeConfig.browser.ts index 25670e2c8ea0..663f07a10d94 100644 --- a/clients/client-worklink/runtimeConfig.browser.ts +++ b/clients/client-worklink/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-worklink/runtimeConfig.native.ts b/clients/client-worklink/runtimeConfig.native.ts index abcc18ec5e85..b34e35b0027f 100644 --- a/clients/client-worklink/runtimeConfig.native.ts +++ b/clients/client-worklink/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WorkLinkClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-worklink/runtimeConfig.ts b/clients/client-worklink/runtimeConfig.ts index 5d88e326f001..803f7ec2bccf 100644 --- a/clients/client-worklink/runtimeConfig.ts +++ b/clients/client-worklink/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-workmail/WorkMailClient.ts b/clients/client-workmail/WorkMailClient.ts index a574302885f7..4663d7168996 100644 --- a/clients/client-workmail/WorkMailClient.ts +++ b/clients/client-workmail/WorkMailClient.ts @@ -101,6 +101,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -111,6 +112,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -230,11 +232,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -276,6 +273,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type WorkMailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -284,8 +287,8 @@ export type WorkMailClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOp EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WorkMailClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -293,8 +296,8 @@ export type WorkMailClientResolvedConfig = __SmithyResolvedConfiguration<__HttpH EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

Amazon WorkMail is a secure, managed business email and calendaring service with support for @@ -350,16 +353,16 @@ export class WorkMailClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-workmail/runtimeConfig.browser.ts b/clients/client-workmail/runtimeConfig.browser.ts index 3e89fe07279b..de4422b136f3 100644 --- a/clients/client-workmail/runtimeConfig.browser.ts +++ b/clients/client-workmail/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-workmail/runtimeConfig.native.ts b/clients/client-workmail/runtimeConfig.native.ts index 267f6a91b508..c4a1cc49ca21 100644 --- a/clients/client-workmail/runtimeConfig.native.ts +++ b/clients/client-workmail/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WorkMailClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-workmail/runtimeConfig.ts b/clients/client-workmail/runtimeConfig.ts index c7312806cff0..730636127777 100644 --- a/clients/client-workmail/runtimeConfig.ts +++ b/clients/client-workmail/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-workmailmessageflow/WorkMailMessageFlowClient.ts b/clients/client-workmailmessageflow/WorkMailMessageFlowClient.ts index 909297966bd5..a466a2ab9bc8 100644 --- a/clients/client-workmailmessageflow/WorkMailMessageFlowClient.ts +++ b/clients/client-workmailmessageflow/WorkMailMessageFlowClient.ts @@ -39,6 +39,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -49,6 +50,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = GetRawMessageContentCommandInput; @@ -102,11 +104,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -148,6 +145,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type WorkMailMessageFlowClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -156,8 +159,8 @@ export type WorkMailMessageFlowClientConfig = Partial<__SmithyConfiguration<__Ht EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WorkMailMessageFlowClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -165,8 +168,8 @@ export type WorkMailMessageFlowClientResolvedConfig = __SmithyResolvedConfigurat EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

The WorkMail Message Flow API provides access to email messages as they are @@ -192,16 +195,16 @@ export class WorkMailMessageFlowClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-workmailmessageflow/runtimeConfig.browser.ts b/clients/client-workmailmessageflow/runtimeConfig.browser.ts index 3455971ed8e0..08dd2fc81b76 100644 --- a/clients/client-workmailmessageflow/runtimeConfig.browser.ts +++ b/clients/client-workmailmessageflow/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-workmailmessageflow/runtimeConfig.native.ts b/clients/client-workmailmessageflow/runtimeConfig.native.ts index 80b3d31ae917..a7338b76ceaa 100644 --- a/clients/client-workmailmessageflow/runtimeConfig.native.ts +++ b/clients/client-workmailmessageflow/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WorkMailMessageFlowClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-workmailmessageflow/runtimeConfig.ts b/clients/client-workmailmessageflow/runtimeConfig.ts index f3a1a8530e1b..4e9d7f9e77f4 100644 --- a/clients/client-workmailmessageflow/runtimeConfig.ts +++ b/clients/client-workmailmessageflow/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-workspaces/WorkSpacesClient.ts b/clients/client-workspaces/WorkSpacesClient.ts index 312aa2164022..91950442ae6d 100644 --- a/clients/client-workspaces/WorkSpacesClient.ts +++ b/clients/client-workspaces/WorkSpacesClient.ts @@ -175,6 +175,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -185,6 +186,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -338,11 +340,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -384,6 +381,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type WorkSpacesClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -392,8 +395,8 @@ export type WorkSpacesClientConfig = Partial<__SmithyConfiguration<__HttpHandler EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type WorkSpacesClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -401,8 +404,8 @@ export type WorkSpacesClientResolvedConfig = __SmithyResolvedConfiguration<__Htt EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * Amazon WorkSpaces Service @@ -426,16 +429,16 @@ export class WorkSpacesClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-workspaces/runtimeConfig.browser.ts b/clients/client-workspaces/runtimeConfig.browser.ts index df2b7c8083d0..f2d8015ebb6d 100644 --- a/clients/client-workspaces/runtimeConfig.browser.ts +++ b/clients/client-workspaces/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-workspaces/runtimeConfig.native.ts b/clients/client-workspaces/runtimeConfig.native.ts index cdc750bee262..cbd244f45cc8 100644 --- a/clients/client-workspaces/runtimeConfig.native.ts +++ b/clients/client-workspaces/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./WorkSpacesClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-workspaces/runtimeConfig.ts b/clients/client-workspaces/runtimeConfig.ts index a92d954a6960..4bf4a2c63574 100644 --- a/clients/client-workspaces/runtimeConfig.ts +++ b/clients/client-workspaces/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/clients/client-xray/XRayClient.ts b/clients/client-xray/XRayClient.ts index fec4ca2d5183..b5fcaf72dfbb 100644 --- a/clients/client-xray/XRayClient.ts +++ b/clients/client-xray/XRayClient.ts @@ -86,6 +86,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -96,6 +97,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -203,11 +205,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -249,6 +246,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type XRayClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -257,8 +260,8 @@ export type XRayClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOption EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type XRayClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -266,8 +269,8 @@ export type XRayClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandl EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** *

AWS X-Ray provides APIs for managing debug traces and retrieving service maps @@ -290,16 +293,16 @@ export class XRayClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/clients/client-xray/runtimeConfig.browser.ts b/clients/client-xray/runtimeConfig.browser.ts index 79d9cf6f79af..fab31f339564 100644 --- a/clients/client-xray/runtimeConfig.browser.ts +++ b/clients/client-xray/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/clients/client-xray/runtimeConfig.native.ts b/clients/client-xray/runtimeConfig.native.ts index 98479b6c516d..3bae662eef74 100644 --- a/clients/client-xray/runtimeConfig.native.ts +++ b/clients/client-xray/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./XRayClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/clients/client-xray/runtimeConfig.ts b/clients/client-xray/runtimeConfig.ts index 513597ae3219..eb7fd3d789e4 100644 --- a/clients/client-xray/runtimeConfig.ts +++ b/clients/client-xray/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddBuiltinPlugins.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddBuiltinPlugins.java index f4db8f115793..bda22f067162 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddBuiltinPlugins.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddBuiltinPlugins.java @@ -72,9 +72,6 @@ public List getClientPlugins() { RuntimeClientPlugin.builder() .withConventions(TypeScriptDependency.MIDDLEWARE_RETRY.dependency, "Retry") .build(), - RuntimeClientPlugin.builder() - .withConventions(TypeScriptDependency.MIDDLEWARE_USER_AGENT.dependency, "UserAgent") - .build(), RuntimeClientPlugin.builder() .withConventions(TypeScriptDependency.MIDDLEWARE_CONTENT_LENGTH.dependency, "ContentLength", HAS_MIDDLEWARE) diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddUserAgentDependency.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddUserAgentDependency.java new file mode 100644 index 000000000000..0f4732befd01 --- /dev/null +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddUserAgentDependency.java @@ -0,0 +1,93 @@ +/* + * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package software.amazon.smithy.aws.typescript.codegen; + +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; + +import software.amazon.smithy.codegen.core.SymbolProvider; +import software.amazon.smithy.model.Model; +import software.amazon.smithy.typescript.codegen.LanguageTarget; +import software.amazon.smithy.typescript.codegen.TypeScriptDependency; +import software.amazon.smithy.typescript.codegen.TypeScriptSettings; +import software.amazon.smithy.typescript.codegen.TypeScriptWriter; +import software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin; +import software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration; +import software.amazon.smithy.utils.ListUtils; +import software.amazon.smithy.utils.MapUtils; + +/** + * Add client plubins and configs to support injecting user agent. + */ +public class AddUserAgentDependency implements TypeScriptIntegration { + @Override + public List getClientPlugins() { + return ListUtils.of( + RuntimeClientPlugin.builder() + .withConventions(AwsDependency.MIDDLEWARE_USER_AGENT.dependency, "UserAgent").build()); + } + + @Override + public void addConfigInterfaceFields( + TypeScriptSettings settings, + Model model, + SymbolProvider symbolProvider, + TypeScriptWriter writer + ) { + writer.addImport("Provider", "Provider", TypeScriptDependency.AWS_SDK_TYPES.packageName); + writer.addImport("UserAgent", "__UserAgent", TypeScriptDependency.AWS_SDK_TYPES.packageName); + writer.writeDocs("The provider populating default tracking information to be sent with `user-agent`, " + + "`x-amz-user-agent` header\n@internal"); + writer.write("defaultUserAgentProvider?: Provider<__UserAgent>;\n"); + } + + @Override + public Map> getRuntimeConfigWriters( + TypeScriptSettings settings, + Model model, + SymbolProvider symbolProvider, + LanguageTarget target + ) { + switch (target) { + case NODE: + return MapUtils.of( + "defaultUserAgentProvider", writer -> { + writer.addDependency(AwsDependency.AWS_SDK_UTIL_USER_AGENT_NODE.dependency); + writer.addImport("defaultUserAgent", "defaultUserAgent", + AwsDependency.AWS_SDK_UTIL_USER_AGENT_NODE.packageName); + writer.addDefaultImport("packageInfo", "./package.json"); + writer.write("defaultUserAgentProvider: defaultUserAgent({serviceId: " + + "ClientSharedValues.serviceId, clientVersion: packageInfo.version}),"); + } + ); + case BROWSER: + return MapUtils.of( + "defaultUserAgentProvider", writer -> { + writer.addDependency(AwsDependency.AWS_SDK_UTIL_USER_AGENT_BROWSER.dependency); + writer.addImport("defaultUserAgent", "defaultUserAgent", + AwsDependency.AWS_SDK_UTIL_USER_AGENT_BROWSER.packageName); + writer.addDefaultImport("packageInfo", "./package.json"); + writer.write("defaultUserAgentProvider: defaultUserAgent({serviceId: " + + "ClientSharedValues.serviceId, clientVersion: packageInfo.version}),"); + } + ); + default: + return Collections.emptyMap(); + } + } +} diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsDependency.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsDependency.java index 773be39d70c5..7401979bd55d 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsDependency.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsDependency.java @@ -29,39 +29,42 @@ */ public enum AwsDependency implements SymbolDependencyContainer { - MIDDLEWARE_SIGNING(NORMAL_DEPENDENCY, "@aws-sdk/middleware-signing", "^1.0.0-beta.1"), - CREDENTIAL_PROVIDER_NODE(NORMAL_DEPENDENCY, "@aws-sdk/credential-provider-node", "^1.0.0-beta.1"), - ACCEPT_HEADER(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-api-gateway", "^1.0.0-beta.1"), - S3_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-s3", "^1.0.0-beta.1"), - ADD_EXPECT_CONTINUE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-expect-continue", "^1.0.0-beta.1"), - GLACIER_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-glacier", "^1.0.0-beta.1"), - MACHINELEARNING_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-machinelearning", "^1.0.0-beta.1"), - S3_CONTROL_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-s3-control", "^1.0.0-beta.1"), - SSEC_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-ssec", "^1.0.0-beta.1"), - RDS_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-rds", "^1.0.0-beta.1"), - LOCATION_CONSTRAINT(NORMAL_DEPENDENCY, "@aws-sdk/middleware-location-constraint", "^1.0.0-beta.1"), - MD5_BROWSER(NORMAL_DEPENDENCY, "@aws-sdk/md5-js", "^1.0.0-beta.1"), - STREAM_HASHER_NODE(NORMAL_DEPENDENCY, "@aws-sdk/hash-stream-node", "^1.0.0-beta.1"), - STREAM_HASHER_BROWSER(NORMAL_DEPENDENCY, "@aws-sdk/hash-blob-browser", "^1.0.0-beta.1"), - ROUTE53_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-route53", "^1.0.0-beta.1"), - EC2_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-ec2", "^1.0.0-beta.0"), - BUCKET_ENDPOINT_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-bucket-endpoint", "^1.0.0-beta.1"), - BODY_CHECKSUM(NORMAL_DEPENDENCY, "@aws-sdk/middleware-apply-body-checksum", "^1.0.0-beta.1"), - MIDDLEWARE_HOST_HEADER(NORMAL_DEPENDENCY, "@aws-sdk/middleware-host-header", "^1.0.0-beta.1"), - SQS_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-sqs", "^1.0.0-beta.0"), - BODY_CHECKSUM_GENERATOR_BROWSER(NORMAL_DEPENDENCY, "@aws-sdk/body-checksum-browser", "^1.0.0-beta.0"), - BODY_CHECKSUM_GENERATOR_NODE(NORMAL_DEPENDENCY, "@aws-sdk/body-checksum-node", "^1.0.0-beta.0"), - XML_BUILDER(NORMAL_DEPENDENCY, "@aws-sdk/xml-builder", "^1.0.0-beta.1"), + MIDDLEWARE_SIGNING(NORMAL_DEPENDENCY, "@aws-sdk/middleware-signing", "^1.0.0-rc.1"), + CREDENTIAL_PROVIDER_NODE(NORMAL_DEPENDENCY, "@aws-sdk/credential-provider-node", "^1.0.0-rc.1"), + ACCEPT_HEADER(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-api-gateway", "^1.0.0-rc.1"), + S3_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-s3", "^1.0.0-rc.1"), + ADD_EXPECT_CONTINUE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-expect-continue", "^1.0.0-rc.1"), + GLACIER_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-glacier", "^1.0.0-rc.1"), + MACHINELEARNING_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-machinelearning", "^1.0.0-rc.1"), + S3_CONTROL_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-s3-control", "^1.0.0-rc.1"), + SSEC_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-ssec", "^1.0.0-rc.1"), + RDS_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-rds", "^1.0.0-rc.1"), + LOCATION_CONSTRAINT(NORMAL_DEPENDENCY, "@aws-sdk/middleware-location-constraint", "^1.0.0-rc.1"), + MD5_BROWSER(NORMAL_DEPENDENCY, "@aws-sdk/md5-js", "^1.0.0-rc.1"), + STREAM_HASHER_NODE(NORMAL_DEPENDENCY, "@aws-sdk/hash-stream-node", "^1.0.0-rc.1"), + STREAM_HASHER_BROWSER(NORMAL_DEPENDENCY, "@aws-sdk/hash-blob-browser", "^1.0.0-rc.1"), + ROUTE53_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-route53", "^1.0.0-rc.1"), + EC2_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-ec2", "^1.0.0-rc.1"), + BUCKET_ENDPOINT_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-bucket-endpoint", "^1.0.0-rc.1"), + BODY_CHECKSUM(NORMAL_DEPENDENCY, "@aws-sdk/middleware-apply-body-checksum", "^1.0.0-rc.1"), + MIDDLEWARE_HOST_HEADER(NORMAL_DEPENDENCY, "@aws-sdk/middleware-host-header", "^1.0.0-rc.1"), + SQS_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-sqs", "^1.0.0-rc.1"), + BODY_CHECKSUM_GENERATOR_BROWSER(NORMAL_DEPENDENCY, "@aws-sdk/body-checksum-browser", "^1.0.0-rc.1"), + BODY_CHECKSUM_GENERATOR_NODE(NORMAL_DEPENDENCY, "@aws-sdk/body-checksum-node", "^1.0.0-rc.1"), + XML_BUILDER(NORMAL_DEPENDENCY, "@aws-sdk/xml-builder", "^1.0.0-rc.1"), XML_PARSER(NORMAL_DEPENDENCY, "fast-xml-parser", "^3.16.0"), UUID_GENERATOR(NORMAL_DEPENDENCY, "uuid", "^3.0.0"), UUID_GENERATOR_TYPES(DEV_DEPENDENCY, "@types/uuid", "^3.0.0"), - MIDDLEWARE_EVENTSTREAM(NORMAL_DEPENDENCY, "@aws-sdk/middleware-eventstream", "^1.0.0-beta.0"), - AWS_SDK_EVENTSTREAM_HANDLER_NODE(NORMAL_DEPENDENCY, "@aws-sdk/eventstream-handler-node", "^1.0.0-beta.0"), + MIDDLEWARE_EVENTSTREAM(NORMAL_DEPENDENCY, "@aws-sdk/middleware-eventstream", "^1.0.0-rc.1"), + AWS_SDK_EVENTSTREAM_HANDLER_NODE(NORMAL_DEPENDENCY, "@aws-sdk/eventstream-handler-node", "^1.0.0-rc.1"), TRANSCRIBE_STREAMING_MIDDLEWARE(NORMAL_DEPENDENCY, "@aws-sdk/middleware-sdk-transcribe-streaming", - "^1.0.0-gamma.0"), - RETRY_CONFIG_PROVIDER(NORMAL_DEPENDENCY, "@aws-sdk/retry-config-provider", "^1.0.0-gamma.0"), - NODE_CONFIG_PROVIDER(NORMAL_DEPENDENCY, "@aws-sdk/node-config-provider", "^1.0.0-gamma.0"), - MIDDLEWARE_LOGGER(NORMAL_DEPENDENCY, "@aws-sdk/middleware-logger", "^1.0.0-gamma.0"); + "^1.0.0-rc.1"), + RETRY_CONFIG_PROVIDER(NORMAL_DEPENDENCY, "@aws-sdk/retry-config-provider", "^1.0.0-rc.1"), + NODE_CONFIG_PROVIDER(NORMAL_DEPENDENCY, "@aws-sdk/node-config-provider", "^1.0.0-rc.1"), + MIDDLEWARE_LOGGER(NORMAL_DEPENDENCY, "@aws-sdk/middleware-logger", "^1.0.0-rc.1"), + MIDDLEWARE_USER_AGENT("dependencies", "@aws-sdk/middleware-user-agent", "1.0.0-rc.1"), + AWS_SDK_UTIL_USER_AGENT_BROWSER(NORMAL_DEPENDENCY, "@aws-sdk/util-user-agent-browser", "1.0.0-rc.1"), + AWS_SDK_UTIL_USER_AGENT_NODE(NORMAL_DEPENDENCY, "@aws-sdk/util-user-agent-node", "1.0.0-rc.1"); public final String packageName; public final String version; diff --git a/codegen/smithy-aws-typescript-codegen/src/main/resources/META-INF/services/software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration b/codegen/smithy-aws-typescript-codegen/src/main/resources/META-INF/services/software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration index e6ca0957defd..cc49c3d7e7e9 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/resources/META-INF/services/software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration +++ b/codegen/smithy-aws-typescript-codegen/src/main/resources/META-INF/services/software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration @@ -12,3 +12,4 @@ software.amazon.smithy.aws.typescript.codegen.AddS3ControlDependency software.amazon.smithy.aws.typescript.codegen.AddEventStreamHandlingDependency software.amazon.smithy.aws.typescript.codegen.AddHttp2Dependency software.amazon.smithy.aws.typescript.codegen.AddTranscribeStreamingDependency +software.amazon.smithy.aws.typescript.codegen.AddUserAgentDependency diff --git a/packages/middleware-retry/src/defaultStrategy.ts b/packages/middleware-retry/src/defaultStrategy.ts index a2a4fba13322..473812a800f2 100644 --- a/packages/middleware-retry/src/defaultStrategy.ts +++ b/packages/middleware-retry/src/defaultStrategy.ts @@ -74,6 +74,7 @@ export class StandardRetryStrategy implements RetryStrategy { private retryDecider: RetryDecider; private delayDecider: DelayDecider; private retryQuota: RetryQuota; + public readonly mode = DEFAULT_RETRY_MODE; constructor(private readonly maxAttemptsProvider: Provider, options?: StandardRetryStrategyOptions) { this.retryDecider = options?.retryDecider ?? defaultRetryDecider; diff --git a/packages/middleware-retry/src/retryMiddleware.spec.ts b/packages/middleware-retry/src/retryMiddleware.spec.ts index a005686a4c9c..e915c191f6f6 100644 --- a/packages/middleware-retry/src/retryMiddleware.spec.ts +++ b/packages/middleware-retry/src/retryMiddleware.spec.ts @@ -1,4 +1,4 @@ -import { FinalizeHandlerArguments, MiddlewareStack, RetryStrategy } from "@aws-sdk/types"; +import { FinalizeHandlerArguments, HandlerExecutionContext, MiddlewareStack, RetryStrategy } from "@aws-sdk/types"; import { getRetryPlugin, retryMiddleware, retryMiddlewareOptions } from "./retryMiddleware"; @@ -37,15 +37,21 @@ describe("retryMiddleware", () => { request: {}, }; const mockRetryStrategy = { + mode: "mock", maxAttempts, retry: jest.fn(), }; + const context: HandlerExecutionContext = {}; await retryMiddleware({ maxAttempts: () => Promise.resolve(maxAttempts), retryStrategy: mockRetryStrategy, - })(next)(args as FinalizeHandlerArguments); + })( + next, + context + )(args as FinalizeHandlerArguments); expect(mockRetryStrategy.retry).toHaveBeenCalledTimes(1); expect(mockRetryStrategy.retry).toHaveBeenCalledWith(next, args); + expect(context.userAgent).toContainEqual(["cfg/retry-mode", "mock"]); }); }); diff --git a/packages/middleware-retry/src/retryMiddleware.ts b/packages/middleware-retry/src/retryMiddleware.ts index 2e589a7fc01d..d66042a67f42 100644 --- a/packages/middleware-retry/src/retryMiddleware.ts +++ b/packages/middleware-retry/src/retryMiddleware.ts @@ -4,6 +4,7 @@ import { FinalizeHandlerArguments, FinalizeHandlerOutput, FinalizeRequestHandlerOptions, + HandlerExecutionContext, MetadataBearer, Pluggable, } from "@aws-sdk/types"; @@ -11,10 +12,15 @@ import { import { RetryResolvedConfig } from "./configurations"; export const retryMiddleware = (options: RetryResolvedConfig) => ( - next: FinalizeHandler + next: FinalizeHandler, + context: HandlerExecutionContext ): FinalizeHandler => async ( args: FinalizeHandlerArguments -): Promise> => options.retryStrategy.retry(next, args); +): Promise> => { + if (options?.retryStrategy?.mode) + context.userAgent = [...(context.userAgent || []), ["cfg/retry-mode", options.retryStrategy.mode]]; + return options.retryStrategy.retry(next, args); +}; export const retryMiddlewareOptions: FinalizeRequestHandlerOptions & AbsoluteLocation = { name: "retryMiddleware", diff --git a/packages/middleware-user-agent/jest.config.js b/packages/middleware-user-agent/jest.config.js new file mode 100644 index 000000000000..a8d1c2e49912 --- /dev/null +++ b/packages/middleware-user-agent/jest.config.js @@ -0,0 +1,5 @@ +const base = require("../../jest.config.base.js"); + +module.exports = { + ...base, +}; diff --git a/packages/middleware-user-agent/package.json b/packages/middleware-user-agent/package.json index 4d53afdde12d..5f29d71b47ae 100644 --- a/packages/middleware-user-agent/package.json +++ b/packages/middleware-user-agent/package.json @@ -22,6 +22,7 @@ "tslib": "^1.8.0" }, "devDependencies": { + "@aws-sdk/middleware-stack": "3.0.0", "@aws-sdk/types": "3.0.0", "@types/jest": "^26.0.4", "jest": "^26.1.0", diff --git a/packages/middleware-user-agent/src/configurations.ts b/packages/middleware-user-agent/src/configurations.ts index 5dfa80e60d4e..a591fcab163d 100644 --- a/packages/middleware-user-agent/src/configurations.ts +++ b/packages/middleware-user-agent/src/configurations.ts @@ -1,20 +1,24 @@ +import { Provider, UserAgent } from "@aws-sdk/types"; export interface UserAgentInputConfig { /** * The custom user agent header that would be appended to default one */ - customUserAgent?: string; + customUserAgent?: string | UserAgent; } interface PreviouslyResolved { - defaultUserAgent: string; + defaultUserAgentProvider: Provider; runtime: string; } export interface UserAgentResolvedConfig { - defaultUserAgent: string; - customUserAgent?: string; + defaultUserAgentProvider: Provider; + customUserAgent?: UserAgent; runtime: string; } export function resolveUserAgentConfig( input: T & PreviouslyResolved & UserAgentInputConfig ): T & UserAgentResolvedConfig { - return input; + return { + ...input, + customUserAgent: typeof input.customUserAgent === "string" ? [[input.customUserAgent]] : input.customUserAgent, + }; } diff --git a/packages/middleware-user-agent/src/constants.ts b/packages/middleware-user-agent/src/constants.ts new file mode 100644 index 000000000000..2a3d91ff38fc --- /dev/null +++ b/packages/middleware-user-agent/src/constants.ts @@ -0,0 +1,7 @@ +export const USER_AGENT = "user-agent"; + +export const X_AMZ_USER_AGENT = "x-amz-user-agent"; + +export const SPACE = " "; + +export const UA_ESCAPE_REGEX = /[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g; diff --git a/packages/middleware-user-agent/src/index.ts b/packages/middleware-user-agent/src/index.ts index ef4de14542fe..0456ec7b37cf 100644 --- a/packages/middleware-user-agent/src/index.ts +++ b/packages/middleware-user-agent/src/index.ts @@ -1,2 +1,2 @@ export * from "./configurations"; -export * from "./middleware"; +export * from "./user-agent-middleware"; diff --git a/packages/middleware-user-agent/src/middleware.ts b/packages/middleware-user-agent/src/middleware.ts deleted file mode 100644 index f36c97a758fd..000000000000 --- a/packages/middleware-user-agent/src/middleware.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { HttpRequest } from "@aws-sdk/protocol-http"; -import { - BuildHandler, - BuildHandlerArguments, - BuildHandlerOptions, - BuildHandlerOutput, - MetadataBearer, - Pluggable, -} from "@aws-sdk/types"; - -import { UserAgentResolvedConfig } from "./configurations"; - -export function userAgentMiddleware(options: UserAgentResolvedConfig) { - return (next: BuildHandler): BuildHandler => ( - args: BuildHandlerArguments - ): Promise> => { - const { request } = args; - if (!HttpRequest.isInstance(request)) return next(args); - const { headers } = request; - const userAgentHeader = options.runtime === "node" ? "user-agent" : "x-amz-user-agent"; - if (!headers[userAgentHeader]) { - headers[userAgentHeader] = `${options.defaultUserAgent}`; - } else { - headers[userAgentHeader] += ` ${options.defaultUserAgent}`; - } - if (options.customUserAgent) { - headers[userAgentHeader] += ` ${options.customUserAgent}`; - } - return next({ - ...args, - request, - }); - }; -} - -export const getUserAgentMiddlewareOptions: BuildHandlerOptions = { - name: "getUserAgentMiddleware", - step: "build", - tags: ["SET_USER_AGENT", "USER_AGENT"], -}; - -export const getUserAgentPlugin = (config: UserAgentResolvedConfig): Pluggable => ({ - applyToStack: (clientStack) => { - clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions); - }, -}); diff --git a/packages/middleware-user-agent/src/user-agent-middleware.spec.ts b/packages/middleware-user-agent/src/user-agent-middleware.spec.ts new file mode 100644 index 000000000000..c64d38bbab08 --- /dev/null +++ b/packages/middleware-user-agent/src/user-agent-middleware.spec.ts @@ -0,0 +1,71 @@ +import { HttpRequest } from "@aws-sdk/protocol-http"; +import { UserAgentPair } from "@aws-sdk/types"; + +import { USER_AGENT, X_AMZ_USER_AGENT } from "./constants"; +import { userAgentMiddleware } from "./user-agent-middleware"; + +describe("userAgentMiddleware", () => { + const mockNextHandler = jest.fn(); + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it("should collect user agent pair from default, custom-supplied, and handler context", async () => { + const middleware = userAgentMiddleware({ + defaultUserAgentProvider: async () => [ + ["default_agent", "1.0.0"], + ["aws-sdk-js", "1.0.0"], + ], + customUserAgent: [["custom_ua/abc"]], + runtime: "node", + }); + const handler = middleware(mockNextHandler, { userAgent: [["cfg/retry-mode", "standard"]] }); + await handler({ input: {}, request: new HttpRequest({ headers: {} }) }); + expect(mockNextHandler.mock.calls.length).toEqual(1); + const sdkUserAgent = mockNextHandler.mock.calls[0][0].request.headers[X_AMZ_USER_AGENT]; + expect(sdkUserAgent).toEqual(expect.stringContaining("aws-sdk-js/1.0.0")); + expect(sdkUserAgent).toEqual(expect.stringContaining("default_agent/1.0.0")); + expect(sdkUserAgent).toEqual(expect.stringContaining("custom_ua/abc")); + expect(sdkUserAgent).toEqual(expect.stringContaining("cfg/retry-mode/standard")); + expect(mockNextHandler.mock.calls[0][0].request.headers[USER_AGENT]).toEqual( + expect.stringContaining("aws-sdk-js/1.0.0") + ); + }); + + it(`should not set ${USER_AGENT} header in browser`, async () => { + const middleware = userAgentMiddleware({ + defaultUserAgentProvider: async () => [["aws-sdk-js", "1.0.0"]], + runtime: "browser", + }); + const handler = middleware(mockNextHandler, {}); + await handler({ input: {}, request: new HttpRequest({ headers: {} }) }); + expect(mockNextHandler.mock.calls.length).toEqual(1); + expect(mockNextHandler.mock.calls[0][0].request.headers[USER_AGENT]).toBeUndefined(); + }); + + describe("should sanitize the user agent string", () => { + const cases: { ua: UserAgentPair; expected: string }[] = [ + { ua: ["/name", "1.0.0"], expected: "name/1.0.0" }, + { ua: ["Name", "1.0.0"], expected: "Name/1.0.0" }, + { ua: ["md/name", "1.0.0"], expected: "md/name/1.0.0" }, + { ua: ["$prefix/&name", "1.0.0"], expected: "$prefix/&name/1.0.0" }, + { ua: ["name(or not)", "1.0.0"], expected: "name_or_not_/1.0.0" }, + { ua: ["name", "1.0.0(test_version)"], expected: "name/1.0.0_test_version" }, + { ua: ["api/Service", "1.0.0"], expected: "api/service/1.0.0" }, + ]; + for (const { ua, expected } of cases) { + it(`should sanitize user agent ${ua} to ${expected}`, async () => { + const middleware = userAgentMiddleware({ + defaultUserAgentProvider: async () => [ua], + runtime: "browser", + }); + const handler = middleware(mockNextHandler, {}); + await handler({ input: {}, request: new HttpRequest({ headers: {} }) }); + expect(mockNextHandler.mock.calls[0][0].request.headers[X_AMZ_USER_AGENT]).toEqual( + expect.stringContaining(expected) + ); + }); + } + }); +}); diff --git a/packages/middleware-user-agent/src/user-agent-middleware.ts b/packages/middleware-user-agent/src/user-agent-middleware.ts new file mode 100644 index 000000000000..e386af048dea --- /dev/null +++ b/packages/middleware-user-agent/src/user-agent-middleware.ts @@ -0,0 +1,84 @@ +import { HttpRequest } from "@aws-sdk/protocol-http"; +import { + FinalizeHandler, + FinalizeHandlerArguments, + FinalizeHandlerOutput, + HandlerExecutionContext, + MetadataBearer, + Pluggable, + RelativeMiddlewareOptions, + UserAgentPair, +} from "@aws-sdk/types"; + +import { UserAgentResolvedConfig } from "./configurations"; +import { SPACE, UA_ESCAPE_REGEX, USER_AGENT, X_AMZ_USER_AGENT } from "./constants"; + +/** + * Build user agent header sections from: + * 1. runtime-specific default user agent provider; + * 2. custom user agent from `customUserAgent` client config; + * 3. handler execution context set by internal SDK components; + * The built user agent will be set to `x-amz-user-agent` header for ALL the + * runtimes. + * Please note that any override to the `user-agent` or `x-amz-user-agent` header + * in the HTTP request is discouraged. Please use `customUserAgent` client + * config or middleware setting the `userAgent` context to generate desired user + * agent. + */ +export const userAgentMiddleware = (options: UserAgentResolvedConfig) => ( + next: FinalizeHandler, + context: HandlerExecutionContext +): FinalizeHandler => async (args: FinalizeHandlerArguments): Promise> => { + const { request } = args; + if (!HttpRequest.isInstance(request)) return next(args); + const { headers } = request; + const userAgent = context?.userAgent?.map(escapeUserAgent) || []; + const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent); + const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || []; + // Set value to AWS-specific user agent header + headers[X_AMZ_USER_AGENT] = [...defaultUserAgent, ...userAgent, ...customUserAgent].join(SPACE); + // Get value to be sent with non-AWS-specific user agent header. + const normalUAValue = [ + ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")), + ...customUserAgent, + ].join(SPACE); + if (options.runtime !== "browser" && normalUAValue) { + headers[USER_AGENT] = headers[USER_AGENT] ? `${headers[USER_AGENT]} ${normalUAValue}` : normalUAValue; + } + + return next({ + ...args, + request, + }); +}; + +/** + * Escape the each pair according to https://tools.ietf.org/html/rfc5234 and join the pair with pattern `name/version`. + * User agent name may include prefix like `md/`, `api/`, `os/` etc., we should not escape the `/` after the prefix. + * @private + */ +const escapeUserAgent = ([name, version]: UserAgentPair): string => { + const prefixSeparatorIndex = name.indexOf("/"); + const prefix = name.substring(0, prefixSeparatorIndex); // If no prefix, prefix is just "" + let uaName = name.substring(prefixSeparatorIndex + 1); + if (prefix === "api") { + uaName = uaName.toLowerCase(); + } + return [prefix, uaName, version] + .filter((item) => item && item.length > 0) + .map((item) => item?.replace(UA_ESCAPE_REGEX, "_")) + .join("/"); +}; + +export const getUserAgentMiddlewareOptions: RelativeMiddlewareOptions = { + name: "getUserAgentMiddleware", + relation: "before", + toMiddleware: "awsAuthMiddleware", + tags: ["SET_USER_AGENT", "USER_AGENT"], +}; + +export const getUserAgentPlugin = (config: UserAgentResolvedConfig): Pluggable => ({ + applyToStack: (clientStack) => { + clientStack.addRelativeTo(userAgentMiddleware(config), getUserAgentMiddlewareOptions); + }, +}); diff --git a/packages/types/src/middleware.ts b/packages/types/src/middleware.ts index a8d5119ce661..0f9078c2550c 100644 --- a/packages/types/src/middleware.ts +++ b/packages/types/src/middleware.ts @@ -1,4 +1,5 @@ import { Logger } from "./logger"; +import { UserAgent } from "./util"; export interface InitializeHandlerArguments { /** @@ -372,6 +373,13 @@ export interface HandlerExecutionContext { */ logger?: Logger; + /** + * Additional user agent that inferred by middleware. It can be used to save + * the internal user agent sections without overriding the `customUserAgent` + * config in clients. + */ + userAgent?: UserAgent; + [key: string]: any; } diff --git a/packages/types/src/util.ts b/packages/types/src/util.ts index 07bf695a2ab5..3f1889cf4cf8 100644 --- a/packages/types/src/util.ts +++ b/packages/types/src/util.ts @@ -1,5 +1,10 @@ import { Endpoint } from "./http"; -import { FinalizeHandler, FinalizeHandlerArguments, FinalizeHandlerOutput } from "./middleware"; +import { + FinalizeHandler, + FinalizeHandlerArguments, + FinalizeHandlerOutput, + HandlerExecutionContext, +} from "./middleware"; import { MetadataBearer } from "./response"; /** @@ -53,6 +58,10 @@ export interface BodyLengthCalculator { * Interface that specifies the retry behavior */ export interface RetryStrategy { + /** + * The retry mode describing how the retry strategy control the traffic flow. + */ + mode?: string; /** * the retry behavior the will invoke the next handler and handle the retry accordingly. * This function should also update the $metadata from the response accordingly. @@ -92,3 +101,15 @@ export interface RegionInfo { export interface RegionInfoProvider { (region: string, options?: any): Promise; } + +/** + * A tuple that represents an API name and optional version + * of a library built using the AWS SDK. + */ +export type UserAgentPair = [name: string, version?: string]; + +/** + * User agent data that to be put into the request's user + * agent. + */ +export type UserAgent = UserAgentPair[]; diff --git a/packages/util-user-agent-browser/package.json b/packages/util-user-agent-browser/package.json index b4dcf0a221ab..2d28088dc0ec 100644 --- a/packages/util-user-agent-browser/package.json +++ b/packages/util-user-agent-browser/package.json @@ -17,12 +17,16 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "react-native": { + "./index": "./index.native" + }, "dependencies": { + "@aws-sdk/types": "3.0.0", + "bowser": "^2.11.0", "tslib": "^1.8.0" }, "devDependencies": { "@aws-sdk/protocol-http": "3.0.0", - "@aws-sdk/types": "3.0.0", "@types/jest": "^26.0.4", "jest": "^26.1.0", "typescript": "~4.1.2" diff --git a/packages/util-user-agent-browser/src/configurations.ts b/packages/util-user-agent-browser/src/configurations.ts new file mode 100644 index 000000000000..1428231da01a --- /dev/null +++ b/packages/util-user-agent-browser/src/configurations.ts @@ -0,0 +1,4 @@ +export interface DefaultUserAgentOptions { + serviceId?: string; + clientVersion: string; +} diff --git a/packages/util-user-agent-browser/src/index.native.spec.ts b/packages/util-user-agent-browser/src/index.native.spec.ts new file mode 100644 index 000000000000..b2f23ff19d25 --- /dev/null +++ b/packages/util-user-agent-browser/src/index.native.spec.ts @@ -0,0 +1,12 @@ +import { defaultUserAgent } from "./index.native"; + +it("should response basic browser default user agent", async () => { + // RN doesn't have userAgent in window.navigator. + //@ts-ignore mock no userAgent exists. + jest.spyOn(window.navigator, "userAgent", "get").mockReturnValue(undefined); + const userAgent = await defaultUserAgent({ serviceId: "s3", clientVersion: "0.1.0" })(); + expect(userAgent).toContainEqual(["os/other"]); + expect(userAgent).toContainEqual(["md/rn"]); + expect(userAgent).toContainEqual(["lang/js"]); + jest.clearAllMocks(); +}); diff --git a/packages/util-user-agent-browser/src/index.native.ts b/packages/util-user-agent-browser/src/index.native.ts new file mode 100644 index 000000000000..8753c8334394 --- /dev/null +++ b/packages/util-user-agent-browser/src/index.native.ts @@ -0,0 +1,31 @@ +import { Provider, UserAgent } from "@aws-sdk/types"; + +import { DefaultUserAgentOptions } from "./configurations"; + +/** + * Default provider to the user agent in ReactNative. It's a best effort to infer + * the device information. It uses bowser library to detect the browser and virsion + */ +export const defaultUserAgent = ({ + serviceId, + clientVersion, +}: DefaultUserAgentOptions): Provider => async () => { + const sections: UserAgent = [ + // sdk-metadata + ["aws-sdk-js", clientVersion], + // os-metadata + ["os/other"], + // language-metadata + // ECMAScript edition doesn't matter in JS. + ["lang/js"], + ["md/rn"], + ]; + + if (serviceId) { + // api-metadata + // service Id may not appear in non-AWS clients + sections.push([`api/${serviceId}`, clientVersion]); + } + + return sections; +}; diff --git a/packages/util-user-agent-browser/src/index.spec.ts b/packages/util-user-agent-browser/src/index.spec.ts index 45666948fa7e..97b0bea2c933 100644 --- a/packages/util-user-agent-browser/src/index.spec.ts +++ b/packages/util-user-agent-browser/src/index.spec.ts @@ -1,14 +1,22 @@ import { defaultUserAgent } from "."; -it("should response basic node default user agent", () => { - let originUserAgent = ""; - if (typeof navigator === "undefined") { - navigator = {} as any; - originUserAgent = "foo/1.0"; - (navigator.userAgent as any) = originUserAgent; - } else { - originUserAgent = navigator.userAgent; - } +const ua = + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"; - expect(defaultUserAgent("client-s3-node", "0.1.0")).toBe(`aws-sdk-js-v3-client-s3-node/0.1.0 ${originUserAgent}`); +it("should populate metrics", async () => { + jest.spyOn(window.navigator, "userAgent", "get").mockReturnValue(ua); + const userAgent = await defaultUserAgent({ serviceId: "s3", clientVersion: "0.1.0" })(); + expect(userAgent).toContainEqual(["aws-sdk-js", "0.1.0"]); + expect(userAgent).toContainEqual(["api/s3", "0.1.0"]); + expect(userAgent).toContainEqual(["os/macOS", "10.15.7"]); + expect(userAgent).toContainEqual(["md/browser", "Chrome_86.0.4240.111"]); + expect(userAgent).toContainEqual(["lang/js"]); + jest.clearAllMocks(); +}); + +it("should populate metrics when service id not available", async () => { + jest.spyOn(window.navigator, "userAgent", "get").mockReturnValue(ua); + const userAgent = await defaultUserAgent({ serviceId: undefined, clientVersion: "0.1.0" })(); + expect(userAgent).not.toContainEqual(["api/s3", "0.1.0"]); + jest.clearAllMocks(); }); diff --git a/packages/util-user-agent-browser/src/index.ts b/packages/util-user-agent-browser/src/index.ts index 5b063a7f443b..201989c887c1 100644 --- a/packages/util-user-agent-browser/src/index.ts +++ b/packages/util-user-agent-browser/src/index.ts @@ -1,5 +1,34 @@ -export function defaultUserAgent(packageName: string, packageVersion: string): string { - const originUserAgent = - typeof navigator !== "undefined" && typeof navigator.userAgent === "string" ? navigator.userAgent : ""; - return `aws-sdk-js-v3-${packageName}/${packageVersion} ${originUserAgent}`; -} +import { Provider, UserAgent } from "@aws-sdk/types"; +import { parse } from "bowser"; + +import { DefaultUserAgentOptions } from "./configurations"; + +/** + * Default provider to the user agent in browsers. It's a best effort to infer + * the device information. It uses bowser library to detect the browser and virsion + */ +export const defaultUserAgent = ({ + serviceId, + clientVersion, +}: DefaultUserAgentOptions): Provider => async () => { + const parsedUA = window?.navigator?.userAgent ? parse(window.navigator.userAgent) : undefined; + const sections: UserAgent = [ + // sdk-metadata + ["aws-sdk-js", clientVersion], + // os-metadata + [`os/${parsedUA?.os?.name || "other"}`, parsedUA?.os?.version], + // language-metadata + // ECMAScript edition doesn't matter in JS. + ["lang/js"], + // browser vendor and version. + ["md/browser", `${parsedUA?.browser?.name ?? "unknown"}_${parsedUA?.browser?.version ?? "unknown"}`], + ]; + + if (serviceId) { + // api-metadata + // service Id may not appear in non-AWS clients + sections.push([`api/${serviceId}`, clientVersion]); + } + + return sections; +}; diff --git a/packages/util-user-agent-node/package.json b/packages/util-user-agent-node/package.json index 5b10c4266e23..ac083825b308 100644 --- a/packages/util-user-agent-node/package.json +++ b/packages/util-user-agent-node/package.json @@ -18,11 +18,12 @@ }, "license": "Apache-2.0", "dependencies": { - "tslib": "^1.8.0" + "tslib": "^1.8.0", + "@aws-sdk/types": "3.0.0", + "@aws-sdk/node-config-provider": "3.0.0" }, "devDependencies": { "@aws-sdk/protocol-http": "3.0.0", - "@aws-sdk/types": "3.0.0", "@types/jest": "^26.0.4", "@types/node": "^10.0.0", "jest": "^26.1.0", diff --git a/packages/util-user-agent-node/src/index.spec.ts b/packages/util-user-agent-node/src/index.spec.ts index 8f0a62560848..bcb9ff3e48d8 100644 --- a/packages/util-user-agent-node/src/index.spec.ts +++ b/packages/util-user-agent-node/src/index.spec.ts @@ -1,23 +1,57 @@ -import process from "process"; +jest.mock("os", () => ({ + platform: () => "darwin", + release: () => "19.6.0", +})); + +const mockEnv = {}; +jest.mock("process", () => ({ + env: mockEnv, + versions: { + node: "14.13.1", + }, +})); + +const mockAppIdLoader = jest.fn().mockResolvedValue(undefined); +jest.mock("@aws-sdk/node-config-provider", () => ({ + loadConfig: () => mockAppIdLoader, +})); import { defaultUserAgent } from "."; describe("defaultUserAgent", () => { - it("should response basic node default user agent", () => { - const originEnv = process.env.AWS_EXECUTION_ENV; - delete process.env.AWS_EXECUTION_ENV; - expect(defaultUserAgent("client-s3-node", "0.1.0")).toBe( - `aws-sdk-nodejs-v3-client-s3-node/0.1.0 ${process.platform}/${process.version}` - ); - if (originEnv) process.env.AWS_EXECUTION_ENV = originEnv; + beforeEach(() => { + jest.resetAllMocks(); + }); + + afterAll(() => { + jest.clearAllMocks(); + }); + + it("should response basic node default user agent", async () => { + const userAgent = await defaultUserAgent({ serviceId: "s3", clientVersion: "0.1.0" })(); + expect(userAgent).toContainEqual(["aws-sdk-js", "0.1.0"]); + expect(userAgent).toContainEqual(["api/s3", "0.1.0"]); + expect(userAgent).toContainEqual(["os/darwin", "19.6.0"]); + expect(userAgent).toContainEqual(["lang/js"]); + }); + + it("should skip api version if service id is not supplied", async () => { + const userAgent = await defaultUserAgent({ serviceId: undefined, clientVersion: "0.1.0" })(); + expect(userAgent).not.toContainEqual(["api/s3", "0.1.0"]); + }); + + it("should add AWS_EXECUTION_ENV", async () => { + //@ts-ignore mock environmental variables + mockEnv.AWS_EXECUTION_ENV = "lambda"; + const userAgent = await defaultUserAgent({ serviceId: "s3", clientVersion: "0.1.0" })(); + expect(userAgent).toContainEqual(["exec-env/lambda"]); }); - it("should add AWS_EXECUTION_ENV", () => { - const originEnv = process.env.AWS_EXECUTION_ENV; - process.env.AWS_EXECUTION_ENV = "ecs"; - expect(defaultUserAgent("client-s3-node", "0.1.0")).toBe( - `aws-sdk-nodejs-v3-client-s3-node/0.1.0 ${process.platform}/${process.version} exec-env/ecs` - ); - if (originEnv) process.env.AWS_EXECUTION_ENV = originEnv; + it("should load app id if available", async () => { + mockAppIdLoader.mockClear(); + const appId = "appId12345"; + mockAppIdLoader.mockResolvedValue(appId); + const userAgent = await defaultUserAgent({ serviceId: "s3", clientVersion: "0.1.0" })(); + expect(userAgent).toContainEqual([`app/${appId}`]); }); }); diff --git a/packages/util-user-agent-node/src/index.ts b/packages/util-user-agent-node/src/index.ts index 0540099bff7e..8b08c2f906c1 100644 --- a/packages/util-user-agent-node/src/index.ts +++ b/packages/util-user-agent-node/src/index.ts @@ -1,9 +1,53 @@ -import process from "process"; +import { loadConfig } from "@aws-sdk/node-config-provider"; +import { Provider, UserAgent } from "@aws-sdk/types"; +import { platform, release } from "os"; +import { env, versions } from "process"; -export function defaultUserAgent(packageName: string, packageVersion: string): string { - let engine = `${process.platform}/${process.version}`; - if (process.env.AWS_EXECUTION_ENV) { - engine += ` exec-env/${process.env.AWS_EXECUTION_ENV}`; - } - return `aws-sdk-nodejs-v3-${packageName}/${packageVersion} ${engine}`; +export const UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; +export const UA_APP_ID_INI_NAME = "sdk-ua-app-id"; + +interface DefaultUserAgentOptions { + serviceId?: string; + clientVersion: string; } + +/** + * Collect metrics from runtime to put into user agent. + */ +export const defaultUserAgent = ({ + serviceId, + clientVersion, +}: DefaultUserAgentOptions): Provider => async () => { + const sections: UserAgent = [ + // sdk-metadata + ["aws-sdk-js", clientVersion], + // os-metadata + [`os/${platform()}`, release()], + // language-metadata + // ECMAScript edition doesn't matter in JS, so no version needed. + ["lang/js"], + ["md/nodejs", `${versions.node}`], + ]; + + if (serviceId) { + // api-metadata + // service Id may not appear in non-AWS clients + sections.push([`api/${serviceId}`, clientVersion]); + } + + if (env.AWS_EXECUTION_ENV) { + // env-metadata + sections.push([`exec-env/${env.AWS_EXECUTION_ENV}`]); + } + + const appId = await loadConfig({ + environmentVariableSelector: (env) => env[UA_APP_ID_ENV_NAME], + configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME], + default: undefined, + })(); + if (appId) { + sections.push([`app/${appId}`]); + } + + return sections; +}; diff --git a/protocol_tests/aws-ec2/EC2ProtocolClient.ts b/protocol_tests/aws-ec2/EC2ProtocolClient.ts index a7150d12dfbc..fb126aa5e50e 100644 --- a/protocol_tests/aws-ec2/EC2ProtocolClient.ts +++ b/protocol_tests/aws-ec2/EC2ProtocolClient.ts @@ -65,6 +65,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -75,6 +76,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -164,11 +166,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -210,6 +207,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type EC2ProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -218,8 +221,8 @@ export type EC2ProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandle EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type EC2ProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -227,8 +230,8 @@ export type EC2ProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__Ht EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * An EC2 query service that sends query requests and XML responses. @@ -250,16 +253,16 @@ export class EC2ProtocolClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/protocol_tests/aws-ec2/runtimeConfig.browser.ts b/protocol_tests/aws-ec2/runtimeConfig.browser.ts index 6f536157708e..0d58d1320614 100644 --- a/protocol_tests/aws-ec2/runtimeConfig.browser.ts +++ b/protocol_tests/aws-ec2/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/protocol_tests/aws-ec2/runtimeConfig.native.ts b/protocol_tests/aws-ec2/runtimeConfig.native.ts index e260a640a068..c2c8364ec283 100644 --- a/protocol_tests/aws-ec2/runtimeConfig.native.ts +++ b/protocol_tests/aws-ec2/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./EC2ProtocolClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/protocol_tests/aws-ec2/runtimeConfig.ts b/protocol_tests/aws-ec2/runtimeConfig.ts index ae050c8c75f8..6e9a4eb636a2 100644 --- a/protocol_tests/aws-ec2/runtimeConfig.ts +++ b/protocol_tests/aws-ec2/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/protocol_tests/aws-json/JsonProtocolClient.ts b/protocol_tests/aws-json/JsonProtocolClient.ts index 3bfeb87c27ba..44d0663f7955 100644 --- a/protocol_tests/aws-json/JsonProtocolClient.ts +++ b/protocol_tests/aws-json/JsonProtocolClient.ts @@ -52,6 +52,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -62,6 +63,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -131,11 +133,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -177,6 +174,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type JsonProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -185,8 +188,8 @@ export type JsonProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandl EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type JsonProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -194,8 +197,8 @@ export type JsonProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__H EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; export class JsonProtocolClient extends __Client< __HttpHandlerOptions, @@ -214,16 +217,16 @@ export class JsonProtocolClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/protocol_tests/aws-json/runtimeConfig.browser.ts b/protocol_tests/aws-json/runtimeConfig.browser.ts index 495f92be689e..3efd7bc8a34c 100644 --- a/protocol_tests/aws-json/runtimeConfig.browser.ts +++ b/protocol_tests/aws-json/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/protocol_tests/aws-json/runtimeConfig.native.ts b/protocol_tests/aws-json/runtimeConfig.native.ts index eecffc6983a3..b83f7ca69972 100644 --- a/protocol_tests/aws-json/runtimeConfig.native.ts +++ b/protocol_tests/aws-json/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./JsonProtocolClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/protocol_tests/aws-json/runtimeConfig.ts b/protocol_tests/aws-json/runtimeConfig.ts index 312ebcb61771..4bcf61bdf302 100644 --- a/protocol_tests/aws-json/runtimeConfig.ts +++ b/protocol_tests/aws-json/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/protocol_tests/aws-query/QueryProtocolClient.ts b/protocol_tests/aws-query/QueryProtocolClient.ts index 185f8575e9e1..d451893b02ae 100644 --- a/protocol_tests/aws-query/QueryProtocolClient.ts +++ b/protocol_tests/aws-query/QueryProtocolClient.ts @@ -79,6 +79,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -89,6 +90,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -194,11 +196,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -240,6 +237,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type QueryProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -248,8 +251,8 @@ export type QueryProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHand EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type QueryProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -257,8 +260,8 @@ export type QueryProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__ EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * A query service that sends query requests and XML responses. @@ -280,16 +283,16 @@ export class QueryProtocolClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/protocol_tests/aws-query/runtimeConfig.browser.ts b/protocol_tests/aws-query/runtimeConfig.browser.ts index 8e70f36a301c..854caebc955a 100644 --- a/protocol_tests/aws-query/runtimeConfig.browser.ts +++ b/protocol_tests/aws-query/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/protocol_tests/aws-query/runtimeConfig.native.ts b/protocol_tests/aws-query/runtimeConfig.native.ts index 819b612eaeee..b4506d896958 100644 --- a/protocol_tests/aws-query/runtimeConfig.native.ts +++ b/protocol_tests/aws-query/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./QueryProtocolClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/protocol_tests/aws-query/runtimeConfig.ts b/protocol_tests/aws-query/runtimeConfig.ts index b3943e52edad..682eee7ac2d0 100644 --- a/protocol_tests/aws-query/runtimeConfig.ts +++ b/protocol_tests/aws-query/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/protocol_tests/aws-restjson/RestJsonProtocolClient.ts b/protocol_tests/aws-restjson/RestJsonProtocolClient.ts index 39efc20e8bbb..d448a3108373 100644 --- a/protocol_tests/aws-restjson/RestJsonProtocolClient.ts +++ b/protocol_tests/aws-restjson/RestJsonProtocolClient.ts @@ -135,6 +135,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -145,6 +146,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -272,11 +274,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -318,6 +315,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RestJsonProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -326,8 +329,8 @@ export type RestJsonProtocolClientConfig = Partial<__SmithyConfiguration<__HttpH EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RestJsonProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -335,8 +338,8 @@ export type RestJsonProtocolClientResolvedConfig = __SmithyResolvedConfiguration EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * A REST JSON service that sends JSON requests and responses. @@ -358,16 +361,16 @@ export class RestJsonProtocolClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/protocol_tests/aws-restjson/runtimeConfig.browser.ts b/protocol_tests/aws-restjson/runtimeConfig.browser.ts index 5f24183b0bc2..dd586f92ed3c 100644 --- a/protocol_tests/aws-restjson/runtimeConfig.browser.ts +++ b/protocol_tests/aws-restjson/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/protocol_tests/aws-restjson/runtimeConfig.native.ts b/protocol_tests/aws-restjson/runtimeConfig.native.ts index 98a833d6c319..b3086035d829 100644 --- a/protocol_tests/aws-restjson/runtimeConfig.native.ts +++ b/protocol_tests/aws-restjson/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RestJsonProtocolClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/protocol_tests/aws-restjson/runtimeConfig.ts b/protocol_tests/aws-restjson/runtimeConfig.ts index 83527f829a8b..afe44fe761e1 100644 --- a/protocol_tests/aws-restjson/runtimeConfig.ts +++ b/protocol_tests/aws-restjson/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/protocol_tests/aws-restxml/RestXmlProtocolClient.ts b/protocol_tests/aws-restxml/RestXmlProtocolClient.ts index 9c2d8d44418e..b02d95e6aa4d 100644 --- a/protocol_tests/aws-restxml/RestXmlProtocolClient.ts +++ b/protocol_tests/aws-restxml/RestXmlProtocolClient.ts @@ -147,6 +147,7 @@ import { SmithyResolvedConfiguration as __SmithyResolvedConfiguration, } from "@aws-sdk/smithy-client"; import { + Provider, RegionInfoProvider, Credentials as __Credentials, Decoder as __Decoder, @@ -157,6 +158,7 @@ import { Provider as __Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, + UserAgent as __UserAgent, } from "@aws-sdk/types"; export type ServiceInputTypes = @@ -296,11 +298,6 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ */ utf8Encoder?: __Encoder; - /** - * The string that will be used to populate default value in 'User-Agent' header - */ - defaultUserAgent?: string; - /** * The runtime environment */ @@ -342,6 +339,12 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__ * Fetch related hostname, signing name or signing region with given region. */ regionInfoProvider?: RegionInfoProvider; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; } export type RestXmlProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & @@ -350,8 +353,8 @@ export type RestXmlProtocolClientConfig = Partial<__SmithyConfiguration<__HttpHa EndpointsInputConfig & AwsAuthInputConfig & RetryInputConfig & - UserAgentInputConfig & - HostHeaderInputConfig; + HostHeaderInputConfig & + UserAgentInputConfig; export type RestXmlProtocolClientResolvedConfig = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required & @@ -359,8 +362,8 @@ export type RestXmlProtocolClientResolvedConfig = __SmithyResolvedConfiguration< EndpointsResolvedConfig & AwsAuthResolvedConfig & RetryResolvedConfig & - UserAgentResolvedConfig & - HostHeaderResolvedConfig; + HostHeaderResolvedConfig & + UserAgentResolvedConfig; /** * A REST XML service that sends XML requests and responses. @@ -382,16 +385,16 @@ export class RestXmlProtocolClient extends __Client< let _config_2 = resolveEndpointsConfig(_config_1); let _config_3 = resolveAwsAuthConfig(_config_2); let _config_4 = resolveRetryConfig(_config_3); - let _config_5 = resolveUserAgentConfig(_config_4); - let _config_6 = resolveHostHeaderConfig(_config_5); + let _config_5 = resolveHostHeaderConfig(_config_4); + let _config_6 = resolveUserAgentConfig(_config_5); super(_config_6); this.config = _config_6; this.middlewareStack.use(getAwsAuthPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); - this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); } destroy(): void { diff --git a/protocol_tests/aws-restxml/runtimeConfig.browser.ts b/protocol_tests/aws-restxml/runtimeConfig.browser.ts index fa5b8050b0f1..fbb3e306ed3b 100644 --- a/protocol_tests/aws-restxml/runtimeConfig.browser.ts +++ b/protocol_tests/aws-restxml/runtimeConfig.browser.ts @@ -22,7 +22,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: invalidAsyncFunction("Credentialis missing") as any, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidAsyncFunction("Region is missing") as any, requestHandler: new FetchHttpHandler(), diff --git a/protocol_tests/aws-restxml/runtimeConfig.native.ts b/protocol_tests/aws-restxml/runtimeConfig.native.ts index ec7124e99904..cf729595d6e3 100644 --- a/protocol_tests/aws-restxml/runtimeConfig.native.ts +++ b/protocol_tests/aws-restxml/runtimeConfig.native.ts @@ -1,5 +1,3 @@ -import packageInfo from "./package.json"; - import { Sha256 } from "@aws-crypto/sha256-js"; import { parseUrl } from "@aws-sdk/url-parser-node"; import { ClientDefaults } from "./RestXmlProtocolClient"; @@ -11,7 +9,6 @@ import { ClientDefaultValues as BrowserDefaults } from "./runtimeConfig.browser" export const ClientDefaultValues: Required = { ...BrowserDefaults, runtime: "react-native", - defaultUserAgent: `aws-sdk-js-v3-react-native-${packageInfo.name}/${packageInfo.version}`, sha256: Sha256, urlParser: parseUrl, }; diff --git a/protocol_tests/aws-restxml/runtimeConfig.ts b/protocol_tests/aws-restxml/runtimeConfig.ts index 4a3c657f26d1..e831beae8e64 100644 --- a/protocol_tests/aws-restxml/runtimeConfig.ts +++ b/protocol_tests/aws-restxml/runtimeConfig.ts @@ -24,7 +24,10 @@ export const ClientDefaultValues: Required = { base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider, - defaultUserAgent: defaultUserAgent(packageInfo.name, packageInfo.version), + defaultUserAgentProvider: defaultUserAgent({ + serviceId: ClientSharedValues.serviceId, + clientVersion: packageInfo.version, + }), maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: new NodeHttpHandler(), diff --git a/yarn.lock b/yarn.lock index 7f9ca4309b3f..b0359d1adaa6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2763,6 +2763,11 @@ body-parser@1.19.0, body-parser@^1.19.0: raw-body "2.4.0" type-is "~1.6.17" +bowser@^2.11.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/bowser/-/bowser-2.11.0.tgz#5ca3c35757a7aa5771500c70a73a9f91ef420a8f" + integrity sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA== + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"